Skip to content

Commit 8fe9d8f

Browse files
authored
Merge pull request #46 from ainarazer/update-response-channel
sync changes with download file and add response channel
2 parents 2a12878 + 6098fc0 commit 8fe9d8f

1 file changed

Lines changed: 35 additions & 12 deletions

File tree

WooCommerce/woocommerce_rms_normal/wc-molpay.php

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function __construct() {
101101
$this->account_type = $this->settings['account_type'];
102102

103103
// Define hostname based on account_type
104-
$this->url = ($this->get_option('account_type')=='1') ? "https://www.onlinepayment.com.my/" : "https://sandbox.merchant.razer.com/" ;
104+
$this->url = ($this->get_option('account_type')=='1') ? "https://pay.merchant.razer.com/" : "https://sandbox.merchant.razer.com/" ;
105105
$this->inquiry_url = ($this->get_option('account_type')=='1') ? "https://api.merchant.razer.com/" : "https://sandbox.merchant.razer.com/" ;
106106

107107
// Actions.
@@ -140,18 +140,36 @@ public function __construct() {
140140
'fpx_pbb' => 'FPX PublicBank (PBB Online)',
141141
'fpx_abb' => 'FPX Affin Bank (Affin Online)',
142142
'fpx_bimb' => 'FPX Bank Islam',
143-
'molwallet' => 'MOLWallet',
144-
'Point-BCard' => 'Point-BCard',
143+
'fpx_agrobank' => 'FPX AgroBank',
144+
'fpx_abmb' => 'FPX Alliance Bank',
145+
'fpx_bkrm' => 'FPX Bank Kerjasama Rakyat Malaysia',
146+
'fpx_bmmb' => 'FPX Bank Muamalat',
147+
'fpx_bsn' => 'FPX Bank Simpanan Nasional',
148+
'fpx_kfh' => 'FPX Kuwait Finance House',
149+
'fpx_hsbc' => 'FPX HSBC',
150+
'fpx_ocbc' => 'FPX OCBC Bank',
151+
'fpx_scb' => 'FPX Standard Chartered Bank',
152+
'fpx_uob' => 'FPX United Oversea Bank',
153+
'point-bcard' => 'Point-BCard',
145154
'dragonpay' => 'Dragonpay',
146-
'NGANLUONG' => 'NGANLUONG',
155+
'nganluong' => 'NGANLUONG',
147156
'paysbuy' => 'PaysBuy',
148157
'cash-711' => '7-Eleven (Razer Cash)',
149-
'ATMVA' => 'ATM Transfer via Permata Bank',
158+
'atmva' => 'ATM Transfer via Permata Bank',
150159
'enetsD' => 'eNETS',
151160
'singpost' => 'Cash-SAM',
152-
'UPOP' => 'China Union Pay',
161+
'upop' => 'China Union Pay',
153162
'alipay' => 'Alipay',
154-
'WeChatPay' => 'WeChatPay Cross Border');
163+
'wechatpay' => 'WeChatPay Cross Border',
164+
'tng_ewallet' => 'Touch `n Go eWallet',
165+
'boost' => 'Boost eWallet',
166+
'shopeepay' => 'Shopee Pay',
167+
'mb2u_qrpay-push' => 'Maybank QRPay',
168+
'grabpay' => 'GrabPay eWallet',
169+
'rpp_duitnowqr' => 'DuitNow QR',
170+
'paynow' => 'PayNow QR',
171+
'pbb-cybs' => 'Public Bank (Installment)'
172+
);
155173
}
156174

157175
/**
@@ -305,7 +323,7 @@ public function generate_form( $order_id ) {
305323
." <input type='checkbox' name='checkbox' value='check' id='agree' /> I have read and agree to the <b> Terms & Conditions, Refund Policy</b> and <b>Privacy Policy</b>."
306324
."<br/>"
307325
."<br/>"
308-
. "<input type='submit' class='button-alt' id='submit_molpay_payment_form' value='" . __('Proceed', 'woothemes') . "' /> "
326+
. "<input type='submit' class='button-alt' id='submit_molpay_payment_form' value='" . __('Pay Now', 'woothemes') . "' /> "
309327
. "<a class='button cancel' href='" . $order->get_cancel_order_url() . "'>".__('Cancel order &amp; restore cart', 'woothemes')."</a>"
310328
//. "<script>document.molpay_payment_form.submit();</script>"
311329
. "</form>";
@@ -491,7 +509,7 @@ public function account_type_missing_message() {
491509
*/
492510
public function inquiry_status($tranID, $amount, $domain) {
493511
$verify_key = $this->verify_key;
494-
$requestUrl = $this->inquiry_url."RMS/q_by_tid.php";
512+
$requestUrl = $this->inquiry_url."MOLPay/q_by_tid.php";
495513
$request_param = array(
496514
"amount" => number_format($amount,2),
497515
"txID" => intval($tranID),
@@ -570,7 +588,12 @@ public function update_Cart_by_Status($orderid, $MOLPay_status, $tranID, $refere
570588
'kuwait-finace' => 'fpx_kfh',
571589
'ocbc' => 'fpx_ocbc',
572590
'scb' => 'fpx_scb',
573-
'uob' => 'fpx_uob'
591+
'uob' => 'fpx_uob',
592+
'agrobank' => 'fpx_agrobank',
593+
'muamalat' => 'fpx_bmmb',
594+
'TNG-EWALLET' => 'TNG_EWALLET',
595+
'RPP_DuitNowQR' => 'RPP_DuitNowQR',
596+
'PBB-CYBS' => 'PBB-CYBS'
574597
);
575598

576599
if (isset($channel_mappings[$channel])) {
@@ -631,7 +654,7 @@ public function acknowledgeResponse($response) {
631654
$postData[]= $k."=".$v;
632655
}
633656
$postdata = implode("&",$postData);
634-
$url = $this->url."RMS/API/chkstat/returnipn.php";
657+
$url = $this->url."MOLPay/API/chkstat/returnipn.php";
635658
$ch = curl_init();
636659
curl_setopt($ch, CURLOPT_POST , 1 );
637660
curl_setopt($ch, CURLOPT_POSTFIELDS , $postdata );
@@ -664,7 +687,7 @@ public function verifySkey($response) {
664687
$appcode = $response['appcode'];
665688
$paydate = $response['paydate'];
666689
$skey = $response['skey'];
667-
$vkey = $this->verify_key;
690+
$vkey = $this->secret_key;
668691

669692
$key0 = md5($tranID.$orderid.$status.$domain.$amount.$currency);
670693
$key1 = md5($paydate.$domain.$key0.$appcode.$vkey);

0 commit comments

Comments
 (0)