mirror of
https://github.com/10h30/woo-viet.git
synced 2026-07-11 18:56:13 +09:00
Handle different payment and queryDR links
This commit is contained in:
@@ -22,6 +22,17 @@ abstract class WooViet_OnePay_Abstract extends WC_Payment_Gateway {
|
||||
* Configure $method_title and $method_description
|
||||
*/
|
||||
abstract public function configure_payment();
|
||||
|
||||
/**
|
||||
* @param bool $testmode
|
||||
*/
|
||||
abstract public function get_onepay_payment_link( $testmode );
|
||||
|
||||
/**
|
||||
* @param bool $testmode
|
||||
*/
|
||||
abstract public function get_onepay_querydr_link( $testmode );
|
||||
|
||||
/**
|
||||
* Constructor for the gateway.
|
||||
*/
|
||||
@@ -64,11 +75,6 @@ abstract class WooViet_OnePay_Abstract extends WC_Payment_Gateway {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialise Gateway Settings Form Fields.
|
||||
*/
|
||||
// abstract public function init_form_fields()
|
||||
|
||||
/**
|
||||
* Get the IPN URL for OnePay
|
||||
* Format: http://my-site.com/wc-api/WooViet_OnePay_Domestic/
|
||||
@@ -135,12 +141,7 @@ abstract class WooViet_OnePay_Abstract extends WC_Payment_Gateway {
|
||||
$message_log = sprintf( 'get_pay_url - Order ID: %1$s - http_args: %2$s', $order->get_id(), print_r( $args, true ) );
|
||||
self::log( $message_log );
|
||||
|
||||
// TODO - need to fix this issue for intl and domestic
|
||||
if ( $this->testmode ) {
|
||||
return 'https://mtf.onepay.vn/onecomm-pay/vpc.op?' . $http_args;
|
||||
} else {
|
||||
return 'https://onepay.vn/onecomm-pay/vpc.op?' . $http_args;
|
||||
}
|
||||
return $this->get_onepay_payment_link( $this->testmode ) . '?' . $http_args;
|
||||
|
||||
}
|
||||
|
||||
@@ -437,12 +438,7 @@ abstract class WooViet_OnePay_Abstract extends WC_Payment_Gateway {
|
||||
|
||||
$http_args = http_build_query( $args, '', '&' );
|
||||
|
||||
// TODO - need to fix this issue for intl and domestic
|
||||
if ( $this->testmode ) {
|
||||
$http_link = 'https://mtf.onepay.vn/onecomm-pay/Vpcdps.op?' . $http_args;
|
||||
} else {
|
||||
$http_link = 'https://onepay.vn/onecomm-pay/Vpcdps.op?' . $http_args;
|
||||
}
|
||||
$http_link = $this->get_onepay_querydr_link( $this->testmode ) . '?' . $http_args;
|
||||
|
||||
// Log data
|
||||
$message_log = sprintf( 'handle_onepay_querydr - http_link: %1$s - http_args: %2$s', $http_link, print_r( $args, true ) );
|
||||
|
||||
Reference in New Issue
Block a user