@@ -30,8 +30,25 @@ require_once '/path/to/global-open-sdk-php/init.php';
30
30
#### 1 Important note
31
31
The SDK mainly shows how to access the alipay gateway, which cannot guarantee the performance and stability.
32
32
33
- #### 2 The demo code for create order
33
+ #### 2 The demo code for create payment
34
34
```
35
+ use Request\pay\AlipayPayRequest;
36
+ use Client\DefaultAlipayClient;
37
+ use Model\Amount;
38
+ use Model\Buyer;
39
+ use Model\Env;
40
+ use Model\Merchant;
41
+ use Model\Order;
42
+ use Model\OsType;
43
+ use Model\PaymentFactor;
44
+ use Model\PaymentMethod;
45
+ use Model\PresentmentMode;
46
+ use Model\ProductCodeType;
47
+ use Model\SettlementStrategy;
48
+ use Model\Store;
49
+ use Model\TerminalType;
50
+ use Model\WalletPaymentMethodType;
51
+
35
52
$request = new AlipayPayRequest();
36
53
$paymentRequestId = 'PR_' . round(microtime(true) * 1000);
37
54
$order = new Order();
@@ -98,12 +115,27 @@ The execute method contains the HTTP request to the gateway.
98
115
If you're concerned about HTTP invocation performance, you can implement HTTP invocation yourself.
99
116
100
117
```
101
- class YourAlipayClient extends BaseAlipayClient{
118
+ class YourAlipayClient extends \Client\BaseAlipayClient{
119
+
120
+ function __construct()
121
+ {
122
+ $a = func_get_args();
123
+ $i = func_num_args() - 2;
124
+ if (method_exists($this, $f = '__construct' . $i)) {
125
+ call_user_func_array(array($this, $f), $a);
126
+ }
127
+ }
102
128
103
- function __construct($gatewayUrl, $merchantPrivateKey, $alipayPublicKey) {
129
+ function __construct1($gatewayUrl, $merchantPrivateKey, $alipayPublicKey)
130
+ {
104
131
parent::__construct($gatewayUrl, $merchantPrivateKey, $alipayPublicKey);
105
132
}
106
133
134
+ function __construct2($gatewayUrl, $merchantPrivateKey, $alipayPublicKey, $clientId)
135
+ {
136
+ parent::__construct($gatewayUrl, $merchantPrivateKey, $alipayPublicKey, $clientId);
137
+ }
138
+
107
139
protected function buildCustomHeader(){
108
140
return null;
109
141
}
0 commit comments