1
1
```
2
2
Language:PHP
3
3
PHP version:5.4.7+
4
+ Releass ^1.3.1
4
5
Copyright:Ant financial services group
5
6
```
6
7
@@ -20,21 +21,35 @@ require_once 'vendor/autoload.php';
20
21
21
22
### Manual Installation
22
23
23
- If you do not wish to use Composer, you can download
24
- the [ latest release] ( https://github.com/alipay/global-open-sdk-php/releases ) . Then, to use the bindings, include the
25
- ` init.php ` file.
24
+ If you do not wish to use Composer, you can download the [ latest release] ( https://github.com/alipay/global-open-sdk-php/releases ) . Then, to use the bindings, include the ` init.php ` file.
26
25
27
26
``` php
28
27
require_once '/path/to/global-open-sdk-php/init.php';
29
28
```
30
29
31
- #### 1 Important note
32
30
31
+ #### 1 Important note
33
32
The SDK mainly shows how to access the alipay gateway, which cannot guarantee the performance and stability.
34
33
35
- #### 2 The demo code for create order
36
-
34
+ #### 2 The demo code for create payment
37
35
```
36
+ use Request\pay\AlipayPayRequest;
37
+ use Client\DefaultAlipayClient;
38
+ use Model\Amount;
39
+ use Model\Buyer;
40
+ use Model\Env;
41
+ use Model\Merchant;
42
+ use Model\Order;
43
+ use Model\OsType;
44
+ use Model\PaymentFactor;
45
+ use Model\PaymentMethod;
46
+ use Model\PresentmentMode;
47
+ use Model\ProductCodeType;
48
+ use Model\SettlementStrategy;
49
+ use Model\Store;
50
+ use Model\TerminalType;
51
+ use Model\WalletPaymentMethodType;
52
+
38
53
$request = new AlipayPayRequest();
39
54
$paymentRequestId = 'PR_' . round(microtime(true) * 1000);
40
55
$order = new Order();
@@ -101,12 +116,27 @@ The execute method contains the HTTP request to the gateway.
101
116
If you're concerned about HTTP invocation performance, you can implement HTTP invocation yourself.
102
117
103
118
```
104
- class YourAlipayClient extends BaseAlipayClient{
119
+ class YourAlipayClient extends \Client\BaseAlipayClient{
120
+
121
+ function __construct()
122
+ {
123
+ $a = func_get_args();
124
+ $i = func_num_args() - 2;
125
+ if (method_exists($this, $f = '__construct' . $i)) {
126
+ call_user_func_array(array($this, $f), $a);
127
+ }
128
+ }
105
129
106
- function __construct($gatewayUrl, $merchantPrivateKey, $alipayPublicKey) {
130
+ function __construct1($gatewayUrl, $merchantPrivateKey, $alipayPublicKey)
131
+ {
107
132
parent::__construct($gatewayUrl, $merchantPrivateKey, $alipayPublicKey);
108
133
}
109
134
135
+ function __construct2($gatewayUrl, $merchantPrivateKey, $alipayPublicKey, $clientId)
136
+ {
137
+ parent::__construct($gatewayUrl, $merchantPrivateKey, $alipayPublicKey, $clientId);
138
+ }
139
+
110
140
protected function buildCustomHeader(){
111
141
return null;
112
142
}
0 commit comments