stanley-king 8 lat temu
rodzic
commit
b74a5f49eb
1 zmienionych plików z 15 dodań i 2 usunięć
  1. 15 2
      helper/pay/cmbpay.php

+ 15 - 2
helper/pay/cmbpay.php

@@ -133,6 +133,8 @@ class cmbpay implements IPay
 
     const debug_notify_signurl = 'http://121.43.114.153/mobile/cmbpay_sign.php';
     const debug_notify_payurl  = 'http://121.43.114.153/mobile/cmbpay_notify.php';
+    const debug_app_returl     = 'http://121.43.114.153/mobile/index.php';
+
 
     static private function pay_notify_url()
     {
@@ -144,6 +146,17 @@ class cmbpay implements IPay
         }
     }
 
+    static private function app_returl()
+    {
+        if(is_debug()) {
+            return self::debug_app_returl;
+        }
+        else {
+            return self::app_returl;
+        }
+    }
+
+
     static private function sign_notify_url()
     {
         if(is_debug()) {
@@ -187,7 +200,7 @@ class cmbpay implements IPay
             'MerchantUrl' => self::pay_notify_url(),
             'MerchantPara' => $attach,
             'MerchantCode' => $code,
-            'MerchantRetUrl' => self::app_returl,
+            'MerchantRetUrl' => self::app_returl(),
             'MerchantRetPara' => $attach
         ];
 
@@ -219,8 +232,8 @@ class cmbpay implements IPay
             'strCono' => $config['CoNo'],
             'strBillNo' => $bill_no,
             'strAmount' => "{$payprice}",
-            'strMerchantPara' => $attach,
             'strMerchantUrl' => self::pay_notify_url(),
+            'strMerchantPara' => $attach,
             'strPayerID' => "{$user_id}",
             'strPayeeID' => '',
             'strClientIP' => $_SERVER['REMOTE_ADDR'],