|
14 | 14 | 'is_sandbox' => true,
|
15 | 15 | ));
|
16 | 16 | $currentUrl = getCurrentUrl();
|
| 17 | +/* Webman: please pass (Request $request) |
| 18 | + $currentUrl = getCurrentUrl(array('webman' => array('request' => $request))); */ |
17 | 19 | $type = $_GET['type'] ?? '';
|
18 |
| -route($type === 'pay/cashier', function () use (&$alipayGlobal, $currentUrl) { |
| 20 | +routeMap($type === 'pay/cashier', function () use (&$alipayGlobal, $currentUrl) { |
19 | 21 | try {
|
20 | 22 | $result = $alipayGlobal->payCashier(array(
|
21 | 23 | 'customer_belongs_to' => CustomerBelongsTo::ALIPAY_CN, // *
|
|
47 | 49 | }
|
48 | 50 | });
|
49 | 51 |
|
50 |
| -route($type === 'auth/consult', function () use (&$alipayGlobal, $currentUrl) { |
| 52 | +routeMap($type === 'auth/consult', function () use (&$alipayGlobal, $currentUrl) { |
51 | 53 | $auth_state = IdTool::CreateAuthState();
|
52 | 54 | try {
|
53 | 55 | $result = $alipayGlobal->authConsult(array(
|
|
65 | 67 | }
|
66 | 68 | });
|
67 | 69 |
|
68 |
| -route($type === 'auth/apply_token/auth_code', function () use (&$alipayGlobal) { |
| 70 | +routeMap($type === 'auth/apply_token/auth_code', function () use (&$alipayGlobal) { |
69 | 71 | $auth_code = $_GET['authCode'] ?? '';
|
70 | 72 | try {
|
71 | 73 | $result = $alipayGlobal->authApplyToken(array(
|
|
88 | 90 | }
|
89 | 91 | });
|
90 | 92 |
|
91 |
| -route($type === 'auth/apply_token/refresh_token', function () use (&$alipayGlobal) { |
| 93 | +routeMap($type === 'auth/apply_token/refresh_token', function () use (&$alipayGlobal) { |
92 | 94 | $refresh_token = $_GET['refreshToken'] ?? '';
|
93 | 95 | try {
|
94 | 96 | $result = $alipayGlobal->authApplyToken(array(
|
|
111 | 113 | }
|
112 | 114 | });
|
113 | 115 |
|
114 |
| -route($type === 'pay/agreement', function () use (&$alipayGlobal, $currentUrl) { |
| 116 | +routeMap($type === 'pay/agreement', function () use (&$alipayGlobal, $currentUrl) { |
115 | 117 | try {
|
116 | 118 | session_start();
|
117 | 119 | $result = $alipayGlobal->payAgreement(array(
|
|
176 | 178 | }
|
177 | 179 | });
|
178 | 180 |
|
179 |
| -route($type === 'notify', function () use (&$alipayGlobal) { |
| 181 | +routeMap($type === 'notify', function () use (&$alipayGlobal) { |
180 | 182 | try {
|
181 | 183 | $notify = $alipayGlobal->getNotify();
|
182 | 184 | // do something
|
|
187 | 189 | }
|
188 | 190 | });
|
189 | 191 |
|
190 |
| -route($type === 'return', function () { |
| 192 | +routeMap($type === 'return', function () { |
191 | 193 | echo 'Payment or Authorization completed';
|
192 | 194 | });
|
193 | 195 |
|
194 |
| -route($type === 'notify/auth/auth_code', function () use (&$alipayGlobal) { |
| 196 | +routeMap($type === 'notify/auth/auth_code', function () use (&$alipayGlobal) { |
195 | 197 | try {
|
196 | 198 | $notify = $alipayGlobal->getNotify();
|
197 | 199 | // do something
|
|
207 | 209 | }
|
208 | 210 | });
|
209 | 211 |
|
210 |
| -route($type === 'refund/refund_online', function () use (&$alipayGlobal) { |
| 212 | +routeMap($type === 'refund/refund_online', function () use (&$alipayGlobal) { |
211 | 213 | try {
|
212 | 214 | $result = $alipayGlobal->sendRefund(array(
|
213 | 215 | 'paymentId' => '20181129190741010007000000XXXX',
|
|
0 commit comments