From 4f73556b278a1eddc0912e9febeda4b012be37dd Mon Sep 17 00:00:00 2001 From: htdat Date: Sat, 22 Apr 2017 09:58:48 +0700 Subject: [PATCH] Correct the code for IPN Use exit() instead of wp_die() --- inc/class-wooviet-onepay-domestic.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/inc/class-wooviet-onepay-domestic.php b/inc/class-wooviet-onepay-domestic.php index 036c963..cd39918 100644 --- a/inc/class-wooviet-onepay-domestic.php +++ b/inc/class-wooviet-onepay-domestic.php @@ -201,9 +201,9 @@ class WooViet_OnePay_Domestic extends WC_Payment_Gateway { */ public function handle_onepay_ipn() { - if (isset($_POST['vpc_SecureHash'])) { + if (isset($_REQUEST['vpc_SecureHash'])) { - $this->process_onepay_response_data( $_POST, 'ipn' ); + $this->process_onepay_response_data( $_REQUEST, 'ipn' ); } } @@ -309,7 +309,7 @@ class WooViet_OnePay_Domestic extends WC_Payment_Gateway { break; case 'ipn': - wp_die('responsecode=1&desc=confirm-success'); + exit( 'responsecode=1&desc=confirm-success'); break; case 'querydr': @@ -319,7 +319,8 @@ class WooViet_OnePay_Domestic extends WC_Payment_Gateway { } else { if ( 'ipn' == $type ) - wp_die('responsecode=0&desc=confirm-success'); + exit('responsecode=0&desc=confirm-success'); + } }