Skip to content

Commit 092ead7

Browse files
committed
Optimized gateway.
1 parent fa91c19 commit 092ead7

File tree

8 files changed

+89
-19
lines changed

8 files changed

+89
-19
lines changed

src/AbstractLegacyGateway.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Omnipay\Alipay\Requests\LegacyQueryRequest;
88
use Omnipay\Alipay\Requests\LegacyRefundRequest;
99
use Omnipay\Common\AbstractGateway;
10+
use Omnipay\Common\Message\AbstractRequest;
1011

1112
abstract class AbstractLegacyGateway extends AbstractGateway
1213
{
@@ -304,7 +305,7 @@ public function setAlipaySdk($value)
304305
/**
305306
* @param array $parameters
306307
*
307-
* @return \Omnipay\Alipay\Requests\LegacyCompletePurchaseRequest
308+
* @return LegacyCompletePurchaseRequest|AbstractRequest
308309
*/
309310
public function completePurchase(array $parameters = [])
310311
{
@@ -315,7 +316,7 @@ public function completePurchase(array $parameters = [])
315316
/**
316317
* @param array $parameters
317318
*
318-
* @return \Omnipay\Alipay\Requests\LegacyRefundRequest
319+
* @return LegacyRefundRequest|AbstractRequest
319320
*/
320321
public function refund(array $parameters = [])
321322
{
@@ -326,7 +327,7 @@ public function refund(array $parameters = [])
326327
/**
327328
* @param array $parameters
328329
*
329-
* @return \Omnipay\Alipay\Requests\LegacyRefundRequest
330+
* @return LegacyRefundRequest|AbstractRequest
330331
*/
331332
public function completeRefund(array $parameters = [])
332333
{
@@ -337,7 +338,7 @@ public function completeRefund(array $parameters = [])
337338
/**
338339
* @param array $parameters
339340
*
340-
* @return \Omnipay\Alipay\Requests\LegacyQueryRequest
341+
* @return LegacyQueryRequest|AbstractRequest
341342
*/
342343
public function query(array $parameters = [])
343344
{

src/AopAppGateway.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
namespace Omnipay\Alipay;
44

55
use Omnipay\Alipay\Requests\AopTradeAppPayRequest;
6+
use Omnipay\Common\Message\AbstractRequest;
7+
use Omnipay\Common\Message\RequestInterface;
68

79
/**
810
* Class AopAppGateway
11+
*
912
* @package Omnipay\Alipay
10-
* @link https://doc.open.alipay.com/docs/doc.htm?treeId=204&articleId=105051&docType=1
13+
* @link https://docs.open.alipay.com/204/105051
14+
* @method RequestInterface authorize(array $options = [])
15+
* @method RequestInterface completeAuthorize(array $options = [])
16+
* @method RequestInterface capture(array $options = [])
17+
* @method RequestInterface void(array $options = [])
18+
* @method RequestInterface createCard(array $options = [])
19+
* @method RequestInterface updateCard(array $options = [])
20+
* @method RequestInterface deleteCard(array $options = [])
1121
*/
1222
class AopAppGateway extends AbstractAopGateway
1323
{
@@ -26,7 +36,7 @@ public function getName()
2636
/**
2737
* @param array $parameters
2838
*
29-
* @return \Omnipay\Alipay\Requests\AopTradeAppPayRequest
39+
* @return AopTradeAppPayRequest|AbstractRequest
3040
*/
3141
public function purchase(array $parameters = [])
3242
{

src/AopF2FGateway.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44

55
use Omnipay\Alipay\Requests\AopTradePayRequest;
66
use Omnipay\Alipay\Requests\AopTradePreCreateRequest;
7+
use Omnipay\Common\Message\AbstractRequest;
8+
use Omnipay\Common\Message\RequestInterface;
79

810
/**
911
* Class AopF2FGateway
12+
*
1013
* @package Omnipay\Alipay
11-
* @link https://doc.open.alipay.com/docs/doc.htm?treeId=194&articleId=105072&docType=1
14+
* @link https://docs.open.alipay.com/194/105072
15+
* @method RequestInterface authorize(array $options = [])
16+
* @method RequestInterface completeAuthorize(array $options = [])
17+
* @method RequestInterface void(array $options = [])
18+
* @method RequestInterface createCard(array $options = [])
19+
* @method RequestInterface updateCard(array $options = [])
20+
* @method RequestInterface deleteCard(array $options = [])
1221
*/
1322
class AopF2FGateway extends AbstractAopGateway
1423
{
@@ -27,7 +36,7 @@ public function getName()
2736
/**
2837
* @param array $parameters
2938
*
30-
* @return \Omnipay\Alipay\Requests\AopTradePayRequest
39+
* @return AopTradePayRequest|AbstractRequest
3140
*/
3241
public function capture(array $parameters = [])
3342
{
@@ -38,7 +47,7 @@ public function capture(array $parameters = [])
3847
/**
3948
* @param array $parameters
4049
*
41-
* @return \Omnipay\Alipay\Requests\AopTradePreCreateRequest
50+
* @return AopTradePreCreateRequest|AbstractRequest
4251
*/
4352
public function purchase(array $parameters = [])
4453
{

src/AopJsGateway.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,22 @@
33
namespace Omnipay\Alipay;
44

55
use Omnipay\Alipay\Requests\AopTradeCreateRequest;
6+
use Omnipay\Common\Message\AbstractRequest;
7+
use Omnipay\Common\Message\RequestInterface;
68

79
/**
810
* Class AopJsGateway
11+
*
912
* @package Omnipay\Alipay
1013
* @link https://docs.open.alipay.com/api_1/alipay.trade.create
1114
* @link https://myjsapi.alipay.com/jsapi/native/trade-pay.html
15+
* @method RequestInterface authorize(array $options = array())
16+
* @method RequestInterface completeAuthorize(array $options = array())
17+
* @method RequestInterface capture(array $options = array())
18+
* @method RequestInterface void(array $options = array())
19+
* @method RequestInterface createCard(array $options = array())
20+
* @method RequestInterface updateCard(array $options = array())
21+
* @method RequestInterface deleteCard(array $options = [])
1222
*/
1323
class AopJsGateway extends AbstractAopGateway
1424
{
@@ -27,7 +37,7 @@ public function getName()
2737
/**
2838
* @param array $parameters
2939
*
30-
* @return \Omnipay\Common\Message\AbstractRequest
40+
* @return AbstractRequest
3141
*/
3242
public function purchase(array $parameters = [])
3343
{

src/AopPageGateway.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
namespace Omnipay\Alipay;
44

55
use Omnipay\Alipay\Requests\AopTradePagePayRequest;
6+
use Omnipay\Common\Message\AbstractRequest;
7+
use Omnipay\Common\Message\RequestInterface;
68

79
/**
810
* Class AopPageGateway
11+
*
912
* @package Omnipay\Alipay
10-
* @link https://doc.open.alipay.com/doc2/detail.htm?treeId=270&articleId=105901&docType=1
13+
* @link https://docs.open.alipay.com/api_1/alipay.trade.page.pay
14+
* @method RequestInterface authorize(array $options = array())
15+
* @method RequestInterface completeAuthorize(array $options = array())
16+
* @method RequestInterface capture(array $options = array())
17+
* @method RequestInterface void(array $options = array())
18+
* @method RequestInterface createCard(array $options = array())
19+
* @method RequestInterface updateCard(array $options = array())
20+
* @method RequestInterface deleteCard(array $options = [])
1121
*/
1222
class AopPageGateway extends AbstractAopGateway
1323
{
@@ -46,7 +56,7 @@ public function setReturnUrl($value)
4656
/**
4757
* @param array $parameters
4858
*
49-
* @return \Omnipay\Common\Message\AbstractRequest
59+
* @return AbstractRequest
5060
*/
5161
public function purchase(array $parameters = [])
5262
{

src/AopWapGateway.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
namespace Omnipay\Alipay;
44

55
use Omnipay\Alipay\Requests\AopTradeWapPayRequest;
6+
use Omnipay\Common\Message\AbstractRequest;
7+
use Omnipay\Common\Message\RequestInterface;
68

79
/**
810
* Class AopWapGateway
11+
*
912
* @package Omnipay\Alipay
10-
* @link https://doc.open.alipay.com/docs/doc.htm?treeId=203&articleId=105288&docType=1
13+
* @link https://docs.open.alipay.com/203/105288
14+
* @method RequestInterface authorize(array $options = [])
15+
* @method RequestInterface completeAuthorize(array $options = [])
16+
* @method RequestInterface capture(array $options = [])
17+
* @method RequestInterface void(array $options = [])
18+
* @method RequestInterface createCard(array $options = [])
19+
* @method RequestInterface updateCard(array $options = [])
20+
* @method RequestInterface deleteCard(array $options = [])
1121
*/
1222
class AopWapGateway extends AbstractAopGateway
1323
{
@@ -46,7 +56,7 @@ public function setReturnUrl($value)
4656
/**
4757
* @param array $parameters
4858
*
49-
* @return \Omnipay\Common\Message\AbstractRequest
59+
* @return AbstractRequest
5060
*/
5161
public function purchase(array $parameters = [])
5262
{

src/LegacyAppGateway.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,21 @@
44

55
use Omnipay\Alipay\Requests\LegacyAppPurchaseRequest;
66
use Omnipay\Alipay\Requests\LegacyRefundNoPwdRequest;
7+
use Omnipay\Common\Message\AbstractRequest;
8+
use Omnipay\Common\Message\RequestInterface;
79

810
/**
911
* Class LegacyAppGateway
12+
*
1013
* @package Omnipay\Alipay
11-
* @link https://doc.open.alipay.com/doc2/detail?treeId=59&articleId=103563&docType=1
14+
* @link https://docs.open.alipay.com/59/103563
15+
* @method RequestInterface authorize(array $options = [])
16+
* @method RequestInterface completeAuthorize(array $options = [])
17+
* @method RequestInterface capture(array $options = [])
18+
* @method RequestInterface void(array $options = [])
19+
* @method RequestInterface createCard(array $options = [])
20+
* @method RequestInterface updateCard(array $options = [])
21+
* @method RequestInterface deleteCard(array $options = [])
1222
*/
1323
class LegacyAppGateway extends AbstractLegacyGateway
1424
{
@@ -57,7 +67,7 @@ public function setRnCheck($value)
5767
/**
5868
* @param array $parameters
5969
*
60-
* @return \Omnipay\Common\Message\AbstractRequest
70+
* @return AbstractRequest
6171
*/
6272
public function purchase(array $parameters = [])
6373
{
@@ -68,7 +78,7 @@ public function purchase(array $parameters = [])
6878
/**
6979
* @param array $parameters
7080
*
71-
* @return LegacyRefundNoPwdRequest
81+
* @return LegacyRefundNoPwdRequest|AbstractRequest
7282
*/
7383
public function refundNoPwd(array $parameters = [])
7484
{

src/LegacyExpressGateway.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@
33
namespace Omnipay\Alipay;
44

55
use Omnipay\Alipay\Requests\LegacyExpressPurchaseRequest;
6+
use Omnipay\Common\Message\AbstractRequest;
7+
use Omnipay\Common\Message\RequestInterface;
68

79
/**
810
* Class LegacyExpressGateway
11+
*
912
* @package Omnipay\Alipay
10-
* @link https://doc.open.alipay.com/docs/doc.htm?treeId=108&articleId=103950&docType=1
13+
* @link https://alipay.open.taobao.com/docs/doc.htm?treeId=108&articleId=103950&docType=1
14+
* @method RequestInterface authorize(array $options = [])
15+
* @method RequestInterface completeAuthorize(array $options = [])
16+
* @method RequestInterface capture(array $options = [])
17+
* @method RequestInterface void(array $options = [])
18+
* @method RequestInterface createCard(array $options = [])
19+
* @method RequestInterface updateCard(array $options = [])
20+
* @method RequestInterface deleteCard(array $options = [])
1121
*/
1222
class LegacyExpressGateway extends AbstractLegacyGateway
1323
{
@@ -26,7 +36,7 @@ public function getName()
2636
/**
2737
* @param array $parameters
2838
*
29-
* @return \Omnipay\Common\Message\AbstractRequest
39+
* @return AbstractRequest
3040
*/
3141
public function purchase(array $parameters = [])
3242
{

0 commit comments

Comments
 (0)