|
@@ -100,23 +100,57 @@ class TestRefill extends TestCase
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public function testBaizePhone()
|
|
|
{
|
|
|
// $providers = new refill\baizeyd\RefillPhone([]);
|
|
|
// $resp = $providers->add(17801048874, 5, 10, ['order_sn' => $this->make_sn()]);
|
|
|
- $str = 'amount=10.00&orderId=92391614943913061206&phone=17801048874&payTime=2021-03-05+19%3A31%3A55&sign=bef6ae50319fb1e8cb3f21302f0abef8&appKey=uECmTOFAY6RPCTtI&payUrl=&statusDes=%E6%94%AF%E4%BB%98%E5%A4%B1%E8%B4%A5&status=7';
|
|
|
- $input['amount'] = 10.00;
|
|
|
- $input['orderId'] = '92391614943913061206';
|
|
|
- $input['phone'] = 17801048874;
|
|
|
- $input['payTime'] = '2021-03-05 19:31:55';
|
|
|
- $input['sign'] = 'bef6ae50319fb1e8cb3f21302f0abef8';
|
|
|
- $input['appKey'] = 'uECmTOFAY6RPCTtI';
|
|
|
- $input['payUrl'] = '';
|
|
|
- $input['statusDes'] = '支付失败';
|
|
|
- $input['status'] = 7;
|
|
|
+ $str = 'amount=10.00&orderId=720668384771999671&phone=13911129867&payTime=2021-03-06+22%3A26%3A12&sign=94dfe83221f7768650e70cce08879b60&appKey=uECmTOFAY6RPCTtI&payUrl=&statusDes=%E6%94%AF%E4%BB%98%E5%A4%B1%E8%B4%A5&status=7';
|
|
|
+ $input = $this->parse_request($str);
|
|
|
+
|
|
|
+// $input['amount'] = 10.00;
|
|
|
+// $input['orderId'] = '92391614943913061206';
|
|
|
+// $input['phone'] = 17801048874;
|
|
|
+// $input['payTime'] = '2021-03-05 19:31:55';
|
|
|
+// $input['sign'] = 'bef6ae50319fb1e8cb3f21302f0abef8';
|
|
|
+// $input['appKey'] = 'uECmTOFAY6RPCTtI';
|
|
|
+// $input['payUrl'] = '';
|
|
|
+// $input['statusDes'] = '支付失败';
|
|
|
+// $input['status'] = 7;
|
|
|
refill\RefillFactory::instance()->notify('baizeyd',$input);
|
|
|
}
|
|
|
|
|
|
+ private function parse_request($squery)
|
|
|
+ {
|
|
|
+ if(empty($squery)) return [];
|
|
|
+
|
|
|
+ $result = [];
|
|
|
+ $params = preg_split('/&/', $squery);
|
|
|
+ foreach ($params as $pair)
|
|
|
+ {
|
|
|
+ if(empty($pair)) continue;
|
|
|
+
|
|
|
+ $kv = explode('=', $pair);
|
|
|
+ $count = count($kv);
|
|
|
+ if($count === 1) {
|
|
|
+ $key = $kv[0];
|
|
|
+ $val = "";
|
|
|
+ }
|
|
|
+ elseif($count === 2) {
|
|
|
+ $key = $kv[0];
|
|
|
+ $val = urldecode($kv[1]);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!empty($key)) {
|
|
|
+ $result[$key] = $val;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
public function testAmPhone()
|
|
|
{
|
|
|
// $providers = new refill\aming\RefillPhone([]);
|
|
@@ -916,7 +950,7 @@ class TestRefill extends TestCase
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
- public function testNotify()
|
|
|
+ public function testNotifyx()
|
|
|
{
|
|
|
$mch_cache = rcache("merchant-notify" , 'refill-');
|
|
|
$caches = empty($mch_cache['data']) ? [] : unserialize($mch_cache['data']);
|