|
@@ -140,17 +140,43 @@ class TestRefill extends TestCase
|
|
|
|
|
|
public function testSohanFastCB()
|
|
|
{
|
|
|
- $post = '{"operatorTradeNo":"202312198256229371","statusDesc":"交易成功","phone":"13911220681","outTradeNo":"91791702973663689415","sign":"c81575ceb8d2b28cd37e33c65141361c","inTradeNo":"20231219161425561173378018037","status":"success","reportTime":"1702974060008"}';
|
|
|
- $data = json_decode($post, true);
|
|
|
- $provider = $this->getProvider('weisanhuo_normal', 'RefillCallBack');
|
|
|
-
|
|
|
- $ret = $provider->verify($data);
|
|
|
- $resp = $provider->notify($data);
|
|
|
- }
|
|
|
+ $post = [
|
|
|
+ 'Action' => 'CX',
|
|
|
+ 'AgentAccount' => 'api_test',
|
|
|
+ 'Agentbalance' => '-400.000',
|
|
|
+ 'Orderid' => '40661703685798184367',
|
|
|
+ 'Chargeid' => '3386490685',
|
|
|
+ 'Orderstatu_int' => '20',
|
|
|
+ 'TransCash' => '1.000',
|
|
|
+ 'OrderPayment' => '1.000',
|
|
|
+ 'Errorcode' => '0000',
|
|
|
+ 'Errormsg' => '',
|
|
|
+ 'Sign' => '2fee99fc128de20c150d8d55ea8bb008'
|
|
|
+ ];
|
|
|
+ $provider = $this->getProvider('sohan_fast', 'RefillCallBack');
|
|
|
+
|
|
|
+ $ret = $provider->verify($post);
|
|
|
+ $resp = $provider->notify($post);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function testGetOSN()
|
|
|
+ {
|
|
|
+ $get_osn = function($str)
|
|
|
+ {
|
|
|
+ $ret = preg_match("/[\s]+(?P<osn>[0-9a-zA-Z]*)/i",$str,$arr);
|
|
|
+ if($ret > 0) {
|
|
|
+ return $arr['osn'];
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ };
|
|
|
+ $str = "缴费成功 8940247595202312075787697476";
|
|
|
+ $osn = $get_osn($str);
|
|
|
+
|
|
|
+// $ret = preg_match('/[\w\W]+UPDATE[\w\W]+available_predeposit=available_predeposit(?P<oper>[-+]+)(?P<amount>[.\d]+)/i', $line, $matches);
|
|
|
|
|
|
|
|
|
- public function testJson()
|
|
|
- {
|
|
|
$val = json_encode(['account' => '13911129867']);
|
|
|
}
|
|
|
|