|
@@ 65-83 (lines=19) @@
|
| 62 |
|
return apply_filters( 'wpinv_is_invoice_history_page', $ret ); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
|
function wpinv_send_to_success_page( $args = null ) { |
| 66 |
|
$redirect = wpinv_get_success_page_uri(); |
| 67 |
|
|
| 68 |
|
if ( !empty( $args ) ) { |
| 69 |
|
// Check for backward compatibility |
| 70 |
|
if ( is_string( $args ) ) |
| 71 |
|
$args = str_replace( '?', '', $args ); |
| 72 |
|
|
| 73 |
|
$args = wp_parse_args( $args ); |
| 74 |
|
|
| 75 |
|
$redirect = add_query_arg( $args, $redirect ); |
| 76 |
|
} |
| 77 |
|
|
| 78 |
|
$gateway = isset( $_REQUEST['wpi-gateway'] ) ? $_REQUEST['wpi-gateway'] : ''; |
| 79 |
|
|
| 80 |
|
$redirect = apply_filters( 'wpinv_success_page_redirect', $redirect, $gateway, $args ); |
| 81 |
|
wp_redirect( $redirect ); |
| 82 |
|
exit; |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
function wpinv_send_to_failed_page( $args = null ) { |
| 86 |
|
$redirect = wpinv_get_failed_transaction_uri(); |
|
@@ 85-103 (lines=19) @@
|
| 82 |
|
exit; |
| 83 |
|
} |
| 84 |
|
|
| 85 |
|
function wpinv_send_to_failed_page( $args = null ) { |
| 86 |
|
$redirect = wpinv_get_failed_transaction_uri(); |
| 87 |
|
|
| 88 |
|
if ( !empty( $args ) ) { |
| 89 |
|
// Check for backward compatibility |
| 90 |
|
if ( is_string( $args ) ) |
| 91 |
|
$args = str_replace( '?', '', $args ); |
| 92 |
|
|
| 93 |
|
$args = wp_parse_args( $args ); |
| 94 |
|
|
| 95 |
|
$redirect = add_query_arg( $args, $redirect ); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
$gateway = isset( $_REQUEST['wpi-gateway'] ) ? $_REQUEST['wpi-gateway'] : ''; |
| 99 |
|
|
| 100 |
|
$redirect = apply_filters( 'wpinv_failed_page_redirect', $redirect, $gateway, $args ); |
| 101 |
|
wp_redirect( $redirect ); |
| 102 |
|
exit; |
| 103 |
|
} |
| 104 |
|
|
| 105 |
|
function wpinv_get_checkout_uri( $args = array() ) { |
| 106 |
|
$uri = wpinv_get_option( 'checkout_page', false ); |