66use Omnipay \Alipay \Common \Signer ;
77use Omnipay \Alipay \Responses \AopCompletePurchaseResponse ;
88use Omnipay \Alipay \Responses \AopCompleteRefundResponse ;
9- use Omnipay \Alipay \Responses \DataServiceBillDownloadUrlQueryResponse ;
109use Omnipay \Alipay \Responses \AopTradePayResponse ;
1110use Omnipay \Alipay \Responses \AopTradePreCreateResponse ;
1211use Omnipay \Alipay \Responses \AopTradeQueryResponse ;
1312use Omnipay \Alipay \Responses \AopTradeRefundQueryResponse ;
1413use Omnipay \Alipay \Responses \AopTradeRefundResponse ;
14+ use Omnipay \Alipay \Responses \DataServiceBillDownloadUrlQueryResponse ;
1515
1616class AopF2FGatewayTest extends AbstractGatewayTestCase
1717{
@@ -47,9 +47,9 @@ public function testCapture()
4747 [
4848 'biz_content ' => [
4949 'out_trade_no ' => date ('YmdHis ' ) . mt_rand (1000 , 9999 ),
50- 'scene ' => 'bar_code ' ,
51- 'auth_code ' => '288412621343841260 ' ,
52- 'subject ' => 'test ' ,
50+ 'scene ' => 'bar_code ' ,
51+ 'auth_code ' => '288412621343841260 ' ,
52+ 'subject ' => 'test ' ,
5353 'total_amount ' => '0.01 ' ,
5454 ]
5555 ]
@@ -71,7 +71,7 @@ public function testPurchase()
7171 [
7272 'biz_content ' => [
7373 'out_trade_no ' => date ('YmdHis ' ) . mt_rand (1000 , 9999 ),
74- 'subject ' => 'test ' ,
74+ 'subject ' => 'test ' ,
7575 'total_amount ' => '0.01 ' ,
7676 ]
7777 ]
@@ -114,7 +114,7 @@ public function testRefund()
114114 [
115115 'biz_content ' => [
116116 'refund_amount ' => '10.01 ' ,
117- 'out_trade_no ' => '201609220542532413 '
117+ 'out_trade_no ' => '201609220542532413 '
118118 ]
119119 ]
120120 )->send ();
@@ -134,8 +134,8 @@ public function testQueryRefund()
134134 $ response = $ this ->gateway ->refundQuery (
135135 [
136136 'biz_content ' => [
137- 'refund_amount ' => '10.01 ' ,
138- 'out_trade_no ' => '201609220542532412 ' ,
137+ 'refund_amount ' => '10.01 ' ,
138+ 'out_trade_no ' => '201609220542532412 ' ,
139139 'out_request_no ' => '201609220542532412 '
140140 ]
141141 ]
@@ -156,18 +156,18 @@ public function testSettle()
156156 $ response = $ this ->gateway ->settle (
157157 [
158158 'biz_content ' => [
159- 'out_request_no ' => '201609220542532412 ' ,
160- 'trade_no ' => '2014030411001007850000672009 ' ,
159+ 'out_request_no ' => '201609220542532412 ' ,
160+ 'trade_no ' => '2014030411001007850000672009 ' ,
161161 'royalty_parameters ' => [
162162 [
163163 'trans_out ' => '111111 ' ,
164- 'trans_in ' => '222222 ' ,
165- 'amount ' => '0.01 ' ,
164+ 'trans_in ' => '222222 ' ,
165+ 'amount ' => '0.01 ' ,
166166 ],
167167 [
168168 'trans_out ' => '111111 ' ,
169- 'trans_in ' => '333333 ' ,
170- 'amount ' => '0.02 ' ,
169+ 'trans_in ' => '333333 ' ,
170+ 'amount ' => '0.02 ' ,
171171 ]
172172 ]
173173 ]
@@ -202,7 +202,7 @@ public function testQueryBillDownloadUrl()
202202 public function testCompletePurchase ()
203203 {
204204 $ testPrivateKey = ALIPAY_ASSET_DIR . '/dist/common/rsa_private_key.pem ' ;
205- $ testPublicKey = ALIPAY_ASSET_DIR . '/dist/common/rsa_public_key.pem ' ;
205+ $ testPublicKey = ALIPAY_ASSET_DIR . '/dist/common/rsa_public_key.pem ' ;
206206
207207 $ this ->gateway = new AopF2FGateway ($ this ->getHttpClient (), $ this ->getHttpRequest ());
208208 $ this ->gateway ->setAppId ($ this ->appId );
@@ -216,7 +216,7 @@ public function testCompletePurchase()
216216 $ signer = new Signer ($ data );
217217 $ signer ->setSort (true );
218218 $ signer ->setEncodePolicy (Signer::ENCODE_POLICY_QUERY );
219- $ data ['sign ' ] = $ signer ->signWithRSA ($ testPrivateKey );
219+ $ data ['sign ' ] = $ signer ->signWithRSA ($ testPrivateKey );
220220 $ data ['sign_type ' ] = 'RSA ' ;
221221
222222 $ this ->gateway ->setAlipayPublicKey ($ testPublicKey );
@@ -227,7 +227,7 @@ public function testCompletePurchase()
227227 $ response = $ this ->gateway ->completePurchase (['params ' => $ data ])->send ();
228228
229229 $ this ->assertEquals (
230- '{"gmt_payment":"2015-06-11 22:33:59","notify_id":"42af7baacd1d3746cf7b56752b91edcj34","seller_email":"[email protected] ","notify_type":"trade_status_sync","sign":"T4JCUXoO5sK\/7UjupKEfsSQnjDnw\/1aSJnC6s53SYJyqdjFl+1Lt8dWdNuuXl5yX39leQsYzmk2CDwZx6F\/YIQWCo1LHZME3DYMqH\/F5wT5uiSUk2KYsYbLluW9pi7YHtBXRWKB6jtnn73DWWbC2sN3tDky9KySPizL5jQ1Cd0I =","trade_no":"2015061121001004400068549373","out_trade_no":"21repl2ac2eOutTradeNo322","gmt_create":"2015-06-11 22:33:46","seller_id":"2088211521646673","notify_time":"2015-06-11 22:34:03","subject":"FACE_TO_FACE_PAYMENT_PRECREATE\u4e2d\u6587","trade_status":"TRADE_SUCCESS","sign_type":"RSA"} ' ,
230+ '{"gmt_payment":"2015-06-11 22:33:59","notify_id":"42af7baacd1d3746cf7b56752b91edcj34","seller_email":"[email protected] ","notify_type":"trade_status_sync","sign":"cJfsQ18JD4CfM1x9MlXY+dO1Q4L647giOmVQvtDJ+4QgpxFL7mEcU8InkAySWxr\/fRXuy8+FMtowYoN2Pmy7z3WcaX0qC5u8rr5hiidnKq\/m4\/7Tt6v5T4xDnYde6GWRchexsTFpMEFDVYs3Hy\/7ga+1Fgvs4bt0borNcjKNJNQ =","trade_no":"2015061121001004400068549373","out_trade_no":"21repl2ac2eOutTradeNo322","gmt_create":"2015-06-11 22:33:46","seller_id":"2088211521646673","notify_time":"2015-06-11 22:34:03","subject":"FACE_TO_FACE_PAYMENT_PRECREATE\u4e2d\u6587","trade_status":"TRADE_SUCCESS","sign_type":"RSA"} ' ,
231231 json_encode ($ response ->data ())
232232 );
233233
@@ -240,7 +240,7 @@ public function testCompletePurchase()
240240 public function testCompleteRefund ()
241241 {
242242 $ testPrivateKey = ALIPAY_ASSET_DIR . '/dist/common/rsa_private_key.pem ' ;
243- $ testPublicKey = ALIPAY_ASSET_DIR . '/dist/common/rsa_public_key.pem ' ;
243+ $ testPublicKey = ALIPAY_ASSET_DIR . '/dist/common/rsa_public_key.pem ' ;
244244
245245 $ this ->gateway = new AopF2FGateway ($ this ->getHttpClient (), $ this ->getHttpRequest ());
246246 $ this ->gateway ->setAppId ($ this ->appId );
@@ -254,7 +254,7 @@ public function testCompleteRefund()
254254 $ signer = new Signer ($ data );
255255 $ signer ->setSort (true );
256256 $ signer ->setEncodePolicy (Signer::ENCODE_POLICY_QUERY );
257- $ data ['sign ' ] = $ signer ->signWithRSA ($ testPrivateKey );
257+ $ data ['sign ' ] = $ signer ->signWithRSA ($ testPrivateKey );
258258 $ data ['sign_type ' ] = 'RSA ' ;
259259
260260 $ this ->gateway ->setAlipayPublicKey ($ testPublicKey );
@@ -265,7 +265,7 @@ public function testCompleteRefund()
265265 $ response = $ this ->gateway ->completeRefund (['params ' => $ data ])->send ();
266266
267267 $ this ->assertEquals (
268- '{"gmt_payment":"2015-06-11 22:33:59","notify_id":"42af7baacd1d3746cf7b56752b91edcj34","seller_email":"[email protected] ","notify_type":"trade_status_sync","sign":"T4JCUXoO5sK\/7UjupKEfsSQnjDnw\/1aSJnC6s53SYJyqdjFl+1Lt8dWdNuuXl5yX39leQsYzmk2CDwZx6F\/YIQWCo1LHZME3DYMqH\/F5wT5uiSUk2KYsYbLluW9pi7YHtBXRWKB6jtnn73DWWbC2sN3tDky9KySPizL5jQ1Cd0I =","trade_no":"2015061121001004400068549373","out_trade_no":"21repl2ac2eOutTradeNo322","gmt_create":"2015-06-11 22:33:46","seller_id":"2088211521646673","notify_time":"2015-06-11 22:34:03","subject":"FACE_TO_FACE_PAYMENT_PRECREATE\u4e2d\u6587","trade_status":"TRADE_SUCCESS","sign_type":"RSA"} ' ,
268+ '{"gmt_payment":"2015-06-11 22:33:59","notify_id":"42af7baacd1d3746cf7b56752b91edcj34","seller_email":"[email protected] ","notify_type":"trade_status_sync","sign":"cJfsQ18JD4CfM1x9MlXY+dO1Q4L647giOmVQvtDJ+4QgpxFL7mEcU8InkAySWxr\/fRXuy8+FMtowYoN2Pmy7z3WcaX0qC5u8rr5hiidnKq\/m4\/7Tt6v5T4xDnYde6GWRchexsTFpMEFDVYs3Hy\/7ga+1Fgvs4bt0borNcjKNJNQ =","trade_no":"2015061121001004400068549373","out_trade_no":"21repl2ac2eOutTradeNo322","gmt_create":"2015-06-11 22:33:46","seller_id":"2088211521646673","notify_time":"2015-06-11 22:34:03","subject":"FACE_TO_FACE_PAYMENT_PRECREATE\u4e2d\u6587","trade_status":"TRADE_SUCCESS","sign_type":"RSA"} ' ,
269269 json_encode ($ response ->data ())
270270 );
271271
0 commit comments