t( $payment ); } // Throw/rethrow exception. if ( $error instanceof \Exception ) { throw $error; } return $payment; } /** * Get pages. * * @return array */ public function get_pages() { $return = array(); $pages = array( 'completed' => __( 'Completed', 'pronamic_ideal' ), 'cancel' => __( 'Canceled', 'pronamic_ideal' ), 'expired' => __( 'Expired', 'pronamic_ideal' ), 'error' => __( 'Error', 'pronamic_ideal' ), 'unknown' => __( 'Unknown', 'pronamic_ideal' ), ); foreach ( $pages as $key => $label ) { $id = sprintf( 'pronamic_pay_%s_page_id', $key ); $return[ $id ] = $label; } return $return; } /** * Payment redirect URL. * * @param string $url Redirect URL. * @param Payment $payment Payment. * @return string */ public function payment_redirect_url( $url, Payment $payment ) { $url = \apply_filters( 'pronamic_payment_redirect_url_' . $payment->get_source(), $url, $payment ); return $url; } /** * Is debug mode. * * @link https://github.com/easydigitaldownloads/easy-digital-downloads/blob/2.9.26/includes/misc-functions.php#L26-L38 * @return bool True if debug mode is enabled, false otherwise. */ public function is_debug_mode() { $value = \get_option( 'pronamic_pay_debug_mode', false ); if ( PRONAMIC_PAY_DEBUG ) { $value = true; } return (bool) $value; } }