pay-sdk-react 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -20
- package/README.zh-CN.md +38 -20
- package/dist/css/index.css +703 -1
- package/dist/css/index.min.css +1 -0
- package/dist/es/Airwallex/airwallex-button.js +56 -36
- package/dist/es/Airwallex/airwallex-modal.js +41 -34
- package/dist/es/Airwallex/airwallex-popup.js +43 -38
- package/dist/es/Airwallex/airwallex.js +26 -28
- package/dist/es/Airwallex/index.js +1 -1
- package/dist/es/Airwallex/style/index.css +335 -1
- package/dist/es/Airwallex/style/index.min.css +1 -0
- package/dist/es/Alipay/alipay-button.js +39 -24
- package/dist/es/Alipay/alipay-modal.js +38 -32
- package/dist/es/Alipay/alipay.js +22 -15
- package/dist/es/Alipay/index.d.ts +4 -4
- package/dist/es/Alipay/index.js +5 -5
- package/dist/es/Alipay/interface.d.ts +7 -9
- package/dist/es/Alipay/style/index.css +18 -1
- package/dist/es/Alipay/style/index.min.css +1 -0
- package/dist/es/Button/button.js +62 -37
- package/dist/es/Button/index.d.ts +2 -2
- package/dist/es/Button/index.js +2 -2
- package/dist/es/Button/interface.d.ts +4 -0
- package/dist/es/Button/style/index.css +95 -1
- package/dist/es/Button/style/index.min.css +1 -0
- package/dist/es/FullScreenLoading/index.js +40 -40
- package/dist/es/FullScreenLoading/interface.d.ts +2 -2
- package/dist/es/FullScreenLoading/style/index.css +239 -1
- package/dist/es/FullScreenLoading/style/index.min.css +1 -0
- package/dist/es/MAlipay/index.js +1 -1
- package/dist/es/MAlipay/m-alipay-auto-submit.js +9 -11
- package/dist/es/MAlipay/m-alipay-button.js +86 -55
- package/dist/es/MAlipay/style/index.css +252 -1
- package/dist/es/MAlipay/style/index.min.css +1 -0
- package/dist/es/MWeChat/index.d.ts +2 -2
- package/dist/es/MWeChat/index.js +2 -2
- package/dist/es/MWeChat/m-wechat-button.js +86 -54
- package/dist/es/MWeChat/style/index.css +252 -1
- package/dist/es/MWeChat/style/index.min.css +1 -0
- package/dist/es/Mask/index.d.ts +2 -2
- package/dist/es/Mask/index.js +2 -2
- package/dist/es/Mask/mask.js +48 -45
- package/dist/es/Mask/style/index.css +11 -1
- package/dist/es/Mask/style/index.min.css +1 -0
- package/dist/es/PayButton/index.js +2 -2
- package/dist/es/PayButton/interface.d.ts +9 -9
- package/dist/es/PayButton/interface.js +1 -1
- package/dist/es/PayMask/index.d.ts +2 -2
- package/dist/es/PayMask/index.js +2 -2
- package/dist/es/PayMask/interface.d.ts +2 -2
- package/dist/es/PayMask/pay-mask.js +41 -40
- package/dist/es/PayMask/style/index.css +62 -1
- package/dist/es/PayMask/style/index.min.css +1 -0
- package/dist/es/Paypal/index.d.ts +2 -2
- package/dist/es/Paypal/index.js +2 -2
- package/dist/es/Paypal/paypal-button.js +55 -36
- package/dist/es/Paypal/style/index.css +207 -1
- package/dist/es/Paypal/style/index.min.css +1 -0
- package/dist/es/Payssion/index.d.ts +2 -2
- package/dist/es/Payssion/index.js +2 -2
- package/dist/es/Payssion/payssion-button.js +56 -37
- package/dist/es/Payssion/style/index.css +157 -1
- package/dist/es/Payssion/style/index.min.css +1 -0
- package/dist/es/Stripe/index.d.ts +5 -5
- package/dist/es/Stripe/index.js +6 -6
- package/dist/es/Stripe/stripe-button.js +47 -33
- package/dist/es/Stripe/stripe-modal.js +38 -32
- package/dist/es/Stripe/stripe-popup.js +42 -37
- package/dist/es/Stripe/stripe.js +15 -15
- package/dist/es/Stripe/style/index.css +365 -1
- package/dist/es/Stripe/style/index.min.css +1 -0
- package/dist/es/Wechat/index.d.ts +4 -4
- package/dist/es/Wechat/index.js +5 -5
- package/dist/es/Wechat/style/index.css +25 -1
- package/dist/es/Wechat/style/index.min.css +1 -0
- package/dist/es/Wechat/wechat-button.js +38 -23
- package/dist/es/Wechat/wechat-modal.js +37 -31
- package/dist/es/Wechat/wechat.js +16 -12
- package/dist/es/confirm-modal/index.d.ts +3 -3
- package/dist/es/confirm-modal/index.js +53 -35
- package/dist/es/confirm-modal/interface.d.ts +2 -2
- package/dist/es/confirm-modal/style/index.css +95 -1
- package/dist/es/confirm-modal/style/index.min.css +1 -0
- package/dist/es/dot-loading/dot-loading.js +25 -23
- package/dist/es/dot-loading/index.d.ts +2 -2
- package/dist/es/dot-loading/index.js +2 -2
- package/dist/es/dot-loading/style/index.css +3 -1
- package/dist/es/dot-loading/style/index.min.css +1 -0
- package/dist/es/hooks/use-initialized.js +2 -2
- package/dist/es/hooks/use-inner-visible.js +8 -4
- package/dist/es/hooks/use-lock-scroll.d.ts +2 -2
- package/dist/es/hooks/use-lock-scroll.js +30 -34
- package/dist/es/hooks/use-touch.d.ts +1 -1
- package/dist/es/hooks/use-touch.js +35 -31
- package/dist/es/hooks/usePayWindowOpen.d.ts +1 -1
- package/dist/es/hooks/usePayWindowOpen.js +31 -27
- package/dist/es/icons/IconAlipay/index.js +18 -16
- package/dist/es/icons/IconClose/index.js +24 -22
- package/dist/es/icons/IconPaypalText/index.js +24 -22
- package/dist/es/icons/IconPaypalWhite/index.js +19 -17
- package/dist/es/icons/IconPayssionPay/index.js +47 -45
- package/dist/es/icons/IconStripe/index.js +19 -17
- package/dist/es/icons/IconStripeText/index.js +19 -17
- package/dist/es/icons/IconWechatPay/index.js +18 -16
- package/dist/es/icons/interface.d.ts +1 -1
- package/dist/es/icons/style/index.css +45 -1
- package/dist/es/icons/style/index.min.css +1 -0
- package/dist/es/index.d.ts +1 -1
- package/dist/es/pay-modal/index.d.ts +2 -2
- package/dist/es/pay-modal/index.js +2 -2
- package/dist/es/pay-modal/interface.d.ts +8 -18
- package/dist/es/pay-modal/pay-modal.js +53 -42
- package/dist/es/pay-modal/style/index.css +95 -1
- package/dist/es/pay-modal/style/index.min.css +1 -0
- package/dist/es/pay-popup/index.js +51 -53
- package/dist/es/pay-popup/interface.d.ts +6 -6
- package/dist/es/pay-popup/style/index.css +145 -1
- package/dist/es/pay-popup/style/index.min.css +1 -0
- package/dist/es/shared/enums/index.js +1 -1
- package/dist/es/shared/index.d.ts +1 -1
- package/dist/es/shared/index.js +1 -1
- package/dist/es/utils/can-use-dom.js +1 -1
- package/dist/es/utils/classNames.js +15 -11
- package/dist/es/utils/dom.js +18 -18
- package/dist/es/utils/get-container.js +2 -2
- package/dist/es/utils/get-scroll-parent.js +8 -9
- package/dist/es/utils/is.js +54 -32
- package/dist/es/utils/native-props.d.ts +2 -2
- package/dist/es/utils/native-props.js +7 -9
- package/dist/es/utils/omit.js +3 -5
- package/dist/es/utils/qrcode.js +5 -5
- package/dist/es/utils/render-to-container.d.ts +1 -1
- package/dist/es/utils/render-to-container.js +4 -4
- package/dist/es/utils/should-render.d.ts +1 -1
- package/dist/es/utils/should-render.js +4 -4
- package/dist/es/utils/supports-passive.js +8 -7
- package/dist/es/utils/warning.js +0 -1
- package/dist/es/utils/with-default-props.js +6 -4
- package/dist/es/utils/with-stop-propagation.d.ts +3 -3
- package/dist/es/utils/with-stop-propagation.js +27 -14
- package/dist/lib/Airwallex/airwallex-button.js +12 -15
- package/dist/lib/Airwallex/airwallex-modal.js +11 -14
- package/dist/lib/Airwallex/airwallex-popup.js +16 -23
- package/dist/lib/Airwallex/airwallex.js +20 -25
- package/dist/lib/Airwallex/index.js +1 -1
- package/dist/lib/Airwallex/style/index.css +335 -1
- package/dist/lib/Airwallex/style/index.min.css +1 -0
- package/dist/lib/Alipay/alipay-button.js +12 -15
- package/dist/lib/Alipay/alipay-modal.js +10 -13
- package/dist/lib/Alipay/alipay.js +19 -23
- package/dist/lib/Alipay/index.js +1 -1
- package/dist/lib/Alipay/style/index.css +18 -1
- package/dist/lib/Alipay/style/index.min.css +1 -0
- package/dist/lib/Button/button.js +13 -13
- package/dist/lib/Button/index.js +1 -1
- package/dist/lib/Button/style/index.css +95 -1
- package/dist/lib/Button/style/index.min.css +1 -0
- package/dist/lib/FullScreenLoading/index.js +28 -29
- package/dist/lib/FullScreenLoading/style/index.css +239 -1
- package/dist/lib/FullScreenLoading/style/index.min.css +1 -0
- package/dist/lib/MAlipay/index.js +1 -1
- package/dist/lib/MAlipay/m-alipay-auto-submit.js +3 -4
- package/dist/lib/MAlipay/m-alipay-button.js +42 -41
- package/dist/lib/MAlipay/style/index.css +252 -1
- package/dist/lib/MAlipay/style/index.min.css +1 -0
- package/dist/lib/MWeChat/index.js +2 -2
- package/dist/lib/MWeChat/m-wechat-button.js +43 -41
- package/dist/lib/MWeChat/style/index.css +252 -1
- package/dist/lib/MWeChat/style/index.min.css +1 -0
- package/dist/lib/Mask/index.js +1 -1
- package/dist/lib/Mask/mask.js +6 -11
- package/dist/lib/Mask/style/index.css +11 -1
- package/dist/lib/Mask/style/index.min.css +1 -0
- package/dist/lib/PayButton/index.js +10 -10
- package/dist/lib/PayMask/index.js +1 -1
- package/dist/lib/PayMask/pay-mask.js +20 -23
- package/dist/lib/PayMask/style/index.css +62 -1
- package/dist/lib/PayMask/style/index.min.css +1 -0
- package/dist/lib/Paypal/index.js +2 -2
- package/dist/lib/Paypal/paypal-button.js +17 -22
- package/dist/lib/Paypal/style/index.css +207 -1
- package/dist/lib/Paypal/style/index.min.css +1 -0
- package/dist/lib/Payssion/index.js +2 -2
- package/dist/lib/Payssion/payssion-button.js +17 -22
- package/dist/lib/Payssion/style/index.css +157 -1
- package/dist/lib/Payssion/style/index.min.css +1 -0
- package/dist/lib/Stripe/index.js +1 -1
- package/dist/lib/Stripe/stripe-button.js +14 -17
- package/dist/lib/Stripe/stripe-modal.js +10 -13
- package/dist/lib/Stripe/stripe-popup.js +16 -23
- package/dist/lib/Stripe/stripe.js +8 -11
- package/dist/lib/Stripe/style/index.css +365 -1
- package/dist/lib/Stripe/style/index.min.css +1 -0
- package/dist/lib/Wechat/index.js +1 -1
- package/dist/lib/Wechat/style/index.css +25 -1
- package/dist/lib/Wechat/style/index.min.css +1 -0
- package/dist/lib/Wechat/wechat-button.js +12 -15
- package/dist/lib/Wechat/wechat-modal.js +9 -12
- package/dist/lib/Wechat/wechat.js +11 -12
- package/dist/lib/confirm-modal/index.js +22 -12
- package/dist/lib/confirm-modal/style/index.css +95 -1
- package/dist/lib/confirm-modal/style/index.min.css +1 -0
- package/dist/lib/dot-loading/dot-loading.js +3 -4
- package/dist/lib/dot-loading/index.js +1 -1
- package/dist/lib/dot-loading/style/index.css +3 -1
- package/dist/lib/dot-loading/style/index.min.css +1 -0
- package/dist/lib/hooks/use-lock-scroll.js +11 -12
- package/dist/lib/hooks/use-touch.js +10 -10
- package/dist/lib/hooks/usePayWindowOpen.js +14 -15
- package/dist/lib/icons/IconAlipay/index.js +6 -6
- package/dist/lib/icons/IconClose/index.js +8 -8
- package/dist/lib/icons/IconPaypalText/index.js +7 -7
- package/dist/lib/icons/IconPaypalWhite/index.js +6 -6
- package/dist/lib/icons/IconPayssionPay/index.js +13 -13
- package/dist/lib/icons/IconStripe/index.js +6 -6
- package/dist/lib/icons/IconStripeText/index.js +6 -6
- package/dist/lib/icons/IconWechatPay/index.js +6 -6
- package/dist/lib/icons/index.js +2 -2
- package/dist/lib/icons/style/index.css +45 -1
- package/dist/lib/icons/style/index.min.css +1 -0
- package/dist/lib/index.js +2 -2
- package/dist/lib/pay-modal/index.js +1 -1
- package/dist/lib/pay-modal/pay-modal.js +29 -21
- package/dist/lib/pay-modal/style/index.css +95 -1
- package/dist/lib/pay-modal/style/index.min.css +1 -0
- package/dist/lib/pay-popup/index.js +24 -28
- package/dist/lib/pay-popup/style/index.css +145 -1
- package/dist/lib/pay-popup/style/index.min.css +1 -0
- package/dist/lib/utils/can-use-dom.js +1 -1
- package/dist/lib/utils/classNames.js +6 -7
- package/dist/lib/utils/dom.js +9 -11
- package/dist/lib/utils/get-scroll-parent.js +2 -3
- package/dist/lib/utils/getPrefixCls.js +1 -1
- package/dist/lib/utils/is.js +16 -14
- package/dist/lib/utils/native-props.js +10 -10
- package/dist/lib/utils/omit.js +3 -6
- package/dist/lib/utils/qrcode.js +1 -1
- package/dist/lib/utils/supports-passive.js +4 -3
- package/dist/lib/utils/warning.js +2 -6
- package/dist/lib/utils/with-default-props.js +4 -8
- package/dist/lib/utils/with-stop-propagation.js +6 -9
- package/dist/umd/pay-sdk-react.umd.js +106 -86
- package/dist/umd/pay-sdk-react.umd.js.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ All components are written in TypeScript, ensuring type safety and an excellent
|
|
|
20
20
|
Supports payment buttons, modals, QR codes, forms, popups, modals, overlays, and more. Flexible combinations to suit various business scenarios.
|
|
21
21
|
|
|
22
22
|
# Install
|
|
23
|
-
|
|
23
|
+
[npm package](https://www.npmjs.com/package/pay-sdk-react)
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
26
|
# With npm
|
|
@@ -41,7 +41,7 @@ pnpm add pay-sdk-react
|
|
|
41
41
|
import React from 'react';
|
|
42
42
|
import ReactDOM from 'react-dom';
|
|
43
43
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
44
|
-
import 'pay-sdk-react/dist/css/index.css';
|
|
44
|
+
import 'pay-sdk-react/dist/css/index.min.css';
|
|
45
45
|
|
|
46
46
|
function App() {
|
|
47
47
|
return (
|
|
@@ -85,7 +85,7 @@ plugins: [
|
|
|
85
85
|
### PC
|
|
86
86
|
|
|
87
87
|
#### Method 1: Use the provided Pay Button
|
|
88
|
-
Import the Pay Button, click to trigger a modal displaying the Alipay QR code.
|
|
88
|
+
Import the Pay Button, click to trigger a modal displaying the Alipay QR code. After the user scans the QR code to complete payment, Alipay will notify the business backend of the payment result.
|
|
89
89
|
|
|
90
90
|
```typescript
|
|
91
91
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -112,6 +112,7 @@ export default AlipayComponent;
|
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
#### Method 2: Use a Alipay button
|
|
115
|
+
Import Alipay, Alipay.Button click to trigger a modal displaying the Alipay QR code. After the user scans the QR code to complete payment, Alipay will notify the business backend of the payment result.
|
|
115
116
|
```typescript
|
|
116
117
|
import { Alipay } from 'pay-sdk-react';
|
|
117
118
|
|
|
@@ -135,8 +136,8 @@ export default AlipayComponent;
|
|
|
135
136
|
```
|
|
136
137
|
|
|
137
138
|
|
|
138
|
-
#### Method
|
|
139
|
-
Use your own button, and call the modal component to display the QR code.
|
|
139
|
+
#### Method 3: Use a custom button
|
|
140
|
+
Use your own button, and call the modal component to display the QR code. After the user scans the QR code to complete payment, Alipay will notify the business backend of the payment result.
|
|
140
141
|
|
|
141
142
|
```typescript
|
|
142
143
|
import { useRef, useState } from 'react';
|
|
@@ -177,7 +178,7 @@ export default AlipayComponent;
|
|
|
177
178
|
```
|
|
178
179
|
|
|
179
180
|
#### Method 4: Custom integration
|
|
180
|
-
Directly import the QR code component and customize the integration and display timing.
|
|
181
|
+
Directly import the QR code component and customize the integration and display timing. After the user scans the QR code to complete payment, Alipay will notify the business backend of the payment result.
|
|
181
182
|
|
|
182
183
|
```typescript
|
|
183
184
|
import { Alipay } from 'pay-sdk-react';
|
|
@@ -198,8 +199,7 @@ export default AlipayComponent;
|
|
|
198
199
|
### H5
|
|
199
200
|
|
|
200
201
|
#### Method 1: PayButton
|
|
201
|
-
Import the PayButton, click to trigger a waiting modal (or overlay), auto-submit the iframe form to launch the Alipay app, or open in browser if the app is not installed.
|
|
202
|
-
Result handling: supports both modal and overlay.
|
|
202
|
+
Import the PayButton, click to trigger a waiting modal (or overlay), auto-submit the iframe form to launch the Alipay app, or open in browser if the app is not installed. After the user completes payment, Alipay will notify the business backend of the payment result. Result handling: supports both modal and overlay.
|
|
203
203
|
|
|
204
204
|
```typescript
|
|
205
205
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -230,6 +230,7 @@ export default MAlipayComponent;
|
|
|
230
230
|
```
|
|
231
231
|
|
|
232
232
|
#### Method 2: MAlipay.Button
|
|
233
|
+
Import MAlipay.Button, click to trigger a waiting modal (or overlay), auto-submit the iframe form to launch the Alipay app, or open in browser if the app is not installed. After the user completes payment, Alipay will notify the business backend of the payment result.
|
|
233
234
|
|
|
234
235
|
```typescript
|
|
235
236
|
import { MAlipay } from "pay-sdk-react";
|
|
@@ -261,7 +262,7 @@ export default MAlipayComponent;
|
|
|
261
262
|
|
|
262
263
|
|
|
263
264
|
#### Method 3: Custom form
|
|
264
|
-
Import the MAlipay form component and customize the trigger timing.
|
|
265
|
+
Import the MAlipay form component and customize the trigger timing. After the user completes payment, Alipay will notify the business backend of the payment result.
|
|
265
266
|
|
|
266
267
|
```typescript
|
|
267
268
|
import { MAlipay } from "pay-sdk-react";
|
|
@@ -286,7 +287,7 @@ export default MAlipayComponent;
|
|
|
286
287
|
### PC
|
|
287
288
|
|
|
288
289
|
#### Method 1: PayButton
|
|
289
|
-
Import the PayButton, click to trigger a modal displaying the WeChat QR code.
|
|
290
|
+
Import the PayButton, click to trigger a modal displaying the WeChat QR code. After the user scans the QR code to complete payment, WeChat will notify the business backend of the payment result.
|
|
290
291
|
|
|
291
292
|
```typescript
|
|
292
293
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -313,6 +314,7 @@ export default WechatComponent;
|
|
|
313
314
|
```
|
|
314
315
|
|
|
315
316
|
#### Method 2: Wechat.Button
|
|
317
|
+
Import Wechat.Button, click to trigger a modal displaying the WeChat QR code. After the user scans the QR code to complete payment, WeChat will notify the business backend of the payment result.
|
|
316
318
|
|
|
317
319
|
```typescript
|
|
318
320
|
import { Wechat } from 'pay-sdk-react';
|
|
@@ -337,7 +339,7 @@ export default WechatComponent;
|
|
|
337
339
|
```
|
|
338
340
|
|
|
339
341
|
#### Method 3: Use a custom button
|
|
340
|
-
Use your own button, and call the modal component to display the QR code.
|
|
342
|
+
Use your own button, and call the modal component to display the QR code. After the user scans the QR code to complete payment, WeChat will notify the business backend of the payment result.
|
|
341
343
|
|
|
342
344
|
```typescript
|
|
343
345
|
import { useRef, useState } from 'react';
|
|
@@ -378,7 +380,7 @@ export default WechatComponent;
|
|
|
378
380
|
```
|
|
379
381
|
|
|
380
382
|
#### Method 4: Custom integration
|
|
381
|
-
Directly import the QR code component and customize the integration and display timing.
|
|
383
|
+
Directly import the QR code component and customize the integration and display timing. After the user scans the QR code to complete payment, WeChat will notify the business backend of the payment result.
|
|
382
384
|
|
|
383
385
|
```typescript
|
|
384
386
|
import { Wechat } from 'pay-sdk-react';
|
|
@@ -400,8 +402,7 @@ export default WechatComponent;
|
|
|
400
402
|
### H5
|
|
401
403
|
|
|
402
404
|
#### Method 1: PayButton
|
|
403
|
-
Import the PayButton, click to trigger a waiting modal (or overlay), auto-open the WeChat payment link, and auto-trigger payment in the WeChat browser.
|
|
404
|
-
Result handling: supports both modal and overlay.
|
|
405
|
+
Import the PayButton, click to trigger a waiting modal (or overlay), auto-open the WeChat payment link, and auto-trigger payment in the WeChat browser. After the user completes payment, WeChat will notify the business backend of the payment result. Result handling: supports both modal and overlay.
|
|
405
406
|
|
|
406
407
|
```typescript
|
|
407
408
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -436,6 +437,7 @@ export default MWechatComponent;
|
|
|
436
437
|
```
|
|
437
438
|
|
|
438
439
|
#### Method 2: MWechatButton
|
|
440
|
+
Import MWechatButton, click to trigger a waiting modal (or overlay), auto-open the WeChat payment link, and auto-trigger payment in the WeChat browser. After the user completes payment, WeChat will notify the business backend of the payment result.
|
|
439
441
|
|
|
440
442
|
```typescript
|
|
441
443
|
import { MWechatButton } from 'pay-sdk-react';
|
|
@@ -458,8 +460,10 @@ export default MWechatComponent;
|
|
|
458
460
|
|
|
459
461
|
## PayPal
|
|
460
462
|
|
|
463
|
+
Import the PayButton, click to trigger payment, auto-open the PayPal payment link, and show a waiting overlay. After PayPal payment is completed, PayPal will redirect to the business-specified result page, and the redirect address is passed in when the business backend service calls the PayPal official payment order creation API.
|
|
464
|
+
|
|
461
465
|
### Method 1: PayButton
|
|
462
|
-
Import the PayButton, click to trigger payment, auto-open the PayPal payment link, and show a waiting overlay.
|
|
466
|
+
Import the PayButton, click to trigger payment, auto-open the PayPal payment link, and show a waiting overlay. After the user completes payment, PayPal will redirect to the business-specified result page.
|
|
463
467
|
|
|
464
468
|
```typescript
|
|
465
469
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -495,6 +499,7 @@ export default PaypalComponent;
|
|
|
495
499
|
```
|
|
496
500
|
|
|
497
501
|
### Method 2: PaypalButton
|
|
502
|
+
Import PaypalButton, click to trigger payment, auto-open the PayPal payment link, and show a waiting overlay. After the user completes payment, PayPal will redirect to the business-specified result page.
|
|
498
503
|
|
|
499
504
|
```typescript
|
|
500
505
|
import { PaypalButton } from 'pay-sdk-react';
|
|
@@ -546,7 +551,10 @@ export default PaypalComponent;
|
|
|
546
551
|
|
|
547
552
|
## Stripe
|
|
548
553
|
|
|
554
|
+
Import payment components to use Stripe payment. After Stripe payment is completed, Stripe will redirect to the business-specified result page, and the redirect address is passed in when the business backend service calls the Stripe official payment order creation API.
|
|
555
|
+
|
|
549
556
|
### Method 1: PayButton
|
|
557
|
+
Import the PayButton, click to trigger payment modal or popup, display Stripe payment form. After the user completes payment, Stripe will redirect to the business-specified result page.
|
|
550
558
|
|
|
551
559
|
```typescript
|
|
552
560
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -572,6 +580,7 @@ export default StripeComponent;
|
|
|
572
580
|
```
|
|
573
581
|
|
|
574
582
|
### Method 2: Stripe.Button
|
|
583
|
+
Import Stripe.Button, click to trigger payment modal or popup, display Stripe payment form. After the user completes payment, Stripe will redirect to the business-specified result page.
|
|
575
584
|
|
|
576
585
|
```typescript
|
|
577
586
|
import { Stripe } from 'pay-sdk-react';
|
|
@@ -596,6 +605,7 @@ export default StripeComponent;
|
|
|
596
605
|
|
|
597
606
|
|
|
598
607
|
### Method 3: Custom trigger popup - Recommended for mobile
|
|
608
|
+
Use custom button to call Stripe.Popup component, display Stripe payment form. After the user completes payment, Stripe will redirect to the business-specified result page.
|
|
599
609
|
|
|
600
610
|
```typescript
|
|
601
611
|
import { useRef, useState } from 'react';
|
|
@@ -638,6 +648,7 @@ export default StripeComponent;
|
|
|
638
648
|
```
|
|
639
649
|
|
|
640
650
|
### Method 4: Custom trigger modal - Recommended for PC
|
|
651
|
+
Use custom button to call Stripe.Modal component, display Stripe payment form. After the user completes payment, Stripe will redirect to the business-specified result page.
|
|
641
652
|
|
|
642
653
|
```typescript
|
|
643
654
|
import { useRef, useState } from 'react';
|
|
@@ -681,7 +692,7 @@ export default StripeComponent;
|
|
|
681
692
|
```
|
|
682
693
|
|
|
683
694
|
### Method 5: Stripe Form
|
|
684
|
-
Import the Stripe form component and customize the integration and display timing.
|
|
695
|
+
Import the Stripe form component and customize the integration and display timing. After the user completes payment, Stripe will redirect to the business-specified result page.
|
|
685
696
|
|
|
686
697
|
```typescript
|
|
687
698
|
import { Stripe } from 'pay-sdk-react';
|
|
@@ -705,8 +716,10 @@ export default StripeComponent;
|
|
|
705
716
|
|
|
706
717
|
## Airwallex
|
|
707
718
|
|
|
719
|
+
Import payment components to use Airwallex payment. After Airwallex payment is completed, the Airwallex payment component will callback the onSuccess method, and the business executes subsequent logic.
|
|
720
|
+
|
|
708
721
|
### Method 1: PayButton
|
|
709
|
-
Import the PayButton, click to trigger a popup for the payment form (recommended for mobile), or a modal for PC.
|
|
722
|
+
Import the PayButton, click to trigger a popup for the payment form (recommended for mobile), or a modal for PC. After the user completes payment, the Airwallex payment component will callback the onSuccess method, and the business executes subsequent logic.
|
|
710
723
|
|
|
711
724
|
```typescript
|
|
712
725
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -755,6 +768,7 @@ export default AirwallexComponent;
|
|
|
755
768
|
```
|
|
756
769
|
|
|
757
770
|
### Method 2: Custom trigger popup
|
|
771
|
+
Use custom button to call Airwallex.Popup component, display Airwallex payment form. After the user completes payment, the Airwallex payment component will callback the onSuccess method, and the business executes subsequent logic.
|
|
758
772
|
|
|
759
773
|
```typescript
|
|
760
774
|
import { useRef, useState } from 'react';
|
|
@@ -832,6 +846,7 @@ export default AirwallexComponent;
|
|
|
832
846
|
```
|
|
833
847
|
|
|
834
848
|
### Method 3: Trigger modal
|
|
849
|
+
Use custom button to call Airwallex.Modal component, display Airwallex payment form. After the user completes payment, the Airwallex payment component will callback the onSuccess method, and the business executes subsequent logic.
|
|
835
850
|
|
|
836
851
|
```typescript
|
|
837
852
|
import { useRef, useState } from 'react';
|
|
@@ -910,7 +925,7 @@ export default AirwallexComponent;
|
|
|
910
925
|
|
|
911
926
|
|
|
912
927
|
### Method 4: Custom integration
|
|
913
|
-
Import the Airwallex form component and customize the integration and display timing.
|
|
928
|
+
Import the Airwallex form component and customize the integration and display timing. After the user completes payment, the Airwallex payment component will callback the onSuccess method, and the business executes subsequent logic.
|
|
914
929
|
|
|
915
930
|
```typescript
|
|
916
931
|
import { Airwallex } from 'pay-sdk-react';
|
|
@@ -950,7 +965,7 @@ export default AirwallexComponent;
|
|
|
950
965
|
```
|
|
951
966
|
|
|
952
967
|
### Method 5: Airwallex.Button
|
|
953
|
-
Import the Pay Button, click to open a third-party payment link and show a waiting overlay.
|
|
968
|
+
Import the Pay Button, click to open a third-party payment link and show a waiting overlay. After the user completes payment, Airwallex will redirect to the business-specified result page.
|
|
954
969
|
|
|
955
970
|
```typescript
|
|
956
971
|
import { Airwallex } from 'pay-sdk-react';
|
|
@@ -978,8 +993,10 @@ export default AirwallexComponent;
|
|
|
978
993
|
|
|
979
994
|
## Payssion
|
|
980
995
|
|
|
996
|
+
Import payment components to use Payssion payment. After Payssion payment is completed, Payssion will redirect to the business-specified result page, and the redirect address is passed in when the business backend service calls the Payssion official payment order creation API.
|
|
997
|
+
|
|
981
998
|
### Method 1: PayButton
|
|
982
|
-
Import the PayButton, click to open a third-party payment link and show a waiting overlay.
|
|
999
|
+
Import the PayButton, click to open a third-party payment link and show a waiting overlay. After the user completes payment, Payssion will redirect to the business-specified result page.
|
|
983
1000
|
|
|
984
1001
|
```typescript
|
|
985
1002
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -1014,6 +1031,7 @@ export default PayssionComponent;
|
|
|
1014
1031
|
```
|
|
1015
1032
|
|
|
1016
1033
|
### Method 2: PayssionButton
|
|
1034
|
+
Import PayssionButton, click to open a third-party payment link and show a waiting overlay. After the user completes payment, Payssion will redirect to the business-specified result page.
|
|
1017
1035
|
|
|
1018
1036
|
```typescript
|
|
1019
1037
|
import { PayssionButton } from 'pay-sdk-react';
|
package/README.zh-CN.md
CHANGED
|
@@ -20,7 +20,7 @@ H5、PC、App跨端 场景均可用,适配多端,满足多样化业务需求
|
|
|
20
20
|
支持支付按钮、弹窗、二维码、表单、popup、modal、蒙层等多种支付承接方式,灵活组合,满足不同业务场景。
|
|
21
21
|
|
|
22
22
|
# 安装
|
|
23
|
-
|
|
23
|
+
[npm package](https://www.npmjs.com/package/pay-sdk-react)
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
26
|
# 使用 npm
|
|
@@ -41,7 +41,7 @@ pnpm add pay-sdk-react
|
|
|
41
41
|
import React from 'react';
|
|
42
42
|
import ReactDOM from 'react-dom';
|
|
43
43
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
44
|
-
import 'pay-sdk-react/dist/css/index.css';
|
|
44
|
+
import 'pay-sdk-react/dist/css/index.min.css';
|
|
45
45
|
|
|
46
46
|
function App() {
|
|
47
47
|
return (
|
|
@@ -85,7 +85,7 @@ plugins: [
|
|
|
85
85
|
### PC 端
|
|
86
86
|
|
|
87
87
|
#### 方式一:使用 PayButton
|
|
88
|
-
引入 PayButton
|
|
88
|
+
引入 PayButton 按钮,点击唤起支付弹窗,展示支付宝二维码。用户扫码完成支付后,支付宝会通知业务后端支付结果。
|
|
89
89
|
|
|
90
90
|
```typescript
|
|
91
91
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -113,7 +113,8 @@ export default AlipayComponent;
|
|
|
113
113
|
```
|
|
114
114
|
|
|
115
115
|
#### 方式二:Alipay.Button
|
|
116
|
-
引入 Alipay,Alipay.Button
|
|
116
|
+
引入 Alipay,Alipay.Button 点击唤起支付弹窗,展示支付宝二维码。用户扫码完成支付后,支付宝会通知业务后端支付结果。
|
|
117
|
+
|
|
117
118
|
```typescript
|
|
118
119
|
import { Alipay } from 'pay-sdk-react';
|
|
119
120
|
|
|
@@ -138,7 +139,7 @@ export default AlipayComponent;
|
|
|
138
139
|
|
|
139
140
|
|
|
140
141
|
#### 方式三:自定义按钮
|
|
141
|
-
|
|
142
|
+
使用自定义按钮,调用支付弹窗组件,展示二维码。用户扫码完成支付后,支付宝会通知业务后端支付结果。
|
|
142
143
|
|
|
143
144
|
```typescript
|
|
144
145
|
import { useRef, useState } from 'react';
|
|
@@ -179,7 +180,7 @@ export default AlipayComponent;
|
|
|
179
180
|
```
|
|
180
181
|
|
|
181
182
|
#### 方式四:自定义承接
|
|
182
|
-
|
|
183
|
+
直接引入二维码组件,自定义承接方式&展示时机。用户扫码完成支付后,支付宝会通知业务后端支付结果。
|
|
183
184
|
|
|
184
185
|
```typescript
|
|
185
186
|
import { Alipay } from 'pay-sdk-react';
|
|
@@ -200,8 +201,7 @@ export default AlipayComponent;
|
|
|
200
201
|
### H5 端
|
|
201
202
|
|
|
202
203
|
#### 方式一:PayButton
|
|
203
|
-
引入支付按钮,点击唤起等待支付弹窗(或蒙层),自动提交 iframe 表单唤起支付宝 App,无 App
|
|
204
|
-
等待结果承接:支持弹窗和蒙层两种方式。
|
|
204
|
+
引入支付按钮,点击唤起等待支付弹窗(或蒙层),自动提交 iframe 表单唤起支付宝 App,无 App 时跳转浏览器。用户完成支付后,支付宝会通知业务后端支付结果。等待结果承接:支持弹窗和蒙层两种方式。
|
|
205
205
|
|
|
206
206
|
```typescript
|
|
207
207
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -232,6 +232,7 @@ export default MAlipayComponent;
|
|
|
232
232
|
```
|
|
233
233
|
|
|
234
234
|
#### 方式二:MAlipay.Button
|
|
235
|
+
引入 MAlipay.Button 按钮,点击唤起等待支付弹窗(或蒙层),自动提交 iframe 表单唤起支付宝 App,无 App 时跳转浏览器。用户完成支付后,支付宝会通知业务后端支付结果。
|
|
235
236
|
|
|
236
237
|
```typescript
|
|
237
238
|
import { MAlipay } from "pay-sdk-react";
|
|
@@ -263,7 +264,7 @@ export default MAlipayComponent;
|
|
|
263
264
|
|
|
264
265
|
|
|
265
266
|
#### 方式三:自定义表单
|
|
266
|
-
引入 MAlipay
|
|
267
|
+
引入 MAlipay 表单组件,自定义触发表单时机。用户完成支付后,支付宝会通知业务后端支付结果。
|
|
267
268
|
|
|
268
269
|
```typescript
|
|
269
270
|
import { MAlipay } from "pay-sdk-react";
|
|
@@ -288,7 +289,7 @@ export default MAlipayComponent;
|
|
|
288
289
|
### PC 端
|
|
289
290
|
|
|
290
291
|
#### 方式一:PayButton
|
|
291
|
-
|
|
292
|
+
引入支付按钮,点击唤起支付弹窗,展示微信二维码。用户扫码完成支付后,微信会通知业务后端支付结果。
|
|
292
293
|
|
|
293
294
|
```typescript
|
|
294
295
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -315,6 +316,7 @@ export default WechatComponent;
|
|
|
315
316
|
```
|
|
316
317
|
|
|
317
318
|
#### 方式二:Wechat.Button
|
|
319
|
+
引入 Wechat.Button 按钮,点击唤起支付弹窗,展示微信二维码。用户扫码完成支付后,微信会通知业务后端支付结果。
|
|
318
320
|
|
|
319
321
|
```typescript
|
|
320
322
|
import { Wechat } from 'pay-sdk-react';
|
|
@@ -339,7 +341,7 @@ export default WechatComponent;
|
|
|
339
341
|
```
|
|
340
342
|
|
|
341
343
|
#### 方式三:自定义按钮
|
|
342
|
-
|
|
344
|
+
使用自定义按钮,调用支付弹窗组件,展示二维码。用户扫码完成支付后,微信会通知业务后端支付结果。
|
|
343
345
|
|
|
344
346
|
```typescript
|
|
345
347
|
import { useRef, useState } from 'react';
|
|
@@ -380,7 +382,7 @@ export default WechatComponent;
|
|
|
380
382
|
```
|
|
381
383
|
|
|
382
384
|
#### 方式四:自定义承接
|
|
383
|
-
|
|
385
|
+
直接引入二维码组件,自定义承接和唤起方式。用户扫码完成支付后,微信会通知业务后端支付结果。
|
|
384
386
|
|
|
385
387
|
```typescript
|
|
386
388
|
import { Wechat } from 'pay-sdk-react';
|
|
@@ -402,8 +404,7 @@ export default WechatComponent;
|
|
|
402
404
|
### H5 端
|
|
403
405
|
|
|
404
406
|
#### 方式一:PayButton
|
|
405
|
-
|
|
406
|
-
等待结果承接:支持弹窗和蒙层两种方式。
|
|
407
|
+
引入支付按钮,点击唤起等待支付弹窗(或蒙层),自动打开微信支付链接,微信内浏览器自动唤起支付。用户完成支付后,微信会通知业务后端支付结果。等待结果承接:支持弹窗和蒙层两种方式。
|
|
407
408
|
|
|
408
409
|
```typescript
|
|
409
410
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -438,6 +439,7 @@ export default MWechatComponent;
|
|
|
438
439
|
```
|
|
439
440
|
|
|
440
441
|
#### 方式二:MWechatButton
|
|
442
|
+
引入 MWechatButton 按钮,点击唤起等待支付弹窗(或蒙层),自动打开微信支付链接,微信内浏览器自动唤起支付。用户完成支付后,微信会通知业务后端支付结果。
|
|
441
443
|
|
|
442
444
|
```typescript
|
|
443
445
|
import { MWechatButton } from 'pay-sdk-react';
|
|
@@ -460,8 +462,10 @@ export default MWechatComponent;
|
|
|
460
462
|
|
|
461
463
|
## PayPal
|
|
462
464
|
|
|
465
|
+
引入支付按钮,点击唤起支付,自动打开 PayPal 支付链接,同时展示等待支付结果蒙层。PayPal 支付完成后,PayPal 官方会重定向到业务指定的结果页面,重定向地址由业务后端服务调用 PayPal 官方创建支付订单 API 时传入。
|
|
466
|
+
|
|
463
467
|
### 方式一:PayButton
|
|
464
|
-
引入支付按钮,点击唤起支付,自动打开 PayPal
|
|
468
|
+
引入支付按钮,点击唤起支付,自动打开 PayPal 支付链接,同时展示等待支付结果蒙层。用户完成支付后,PayPal 会重定向到业务指定的结果页面。
|
|
465
469
|
|
|
466
470
|
```typescript
|
|
467
471
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -497,6 +501,7 @@ export default PaypalComponent;
|
|
|
497
501
|
```
|
|
498
502
|
|
|
499
503
|
### 方式二:PaypalButton
|
|
504
|
+
引入 PaypalButton 按钮,点击唤起支付,自动打开 PayPal 支付链接,同时展示等待支付结果蒙层。用户完成支付后,PayPal 会重定向到业务指定的结果页面。
|
|
500
505
|
|
|
501
506
|
```typescript
|
|
502
507
|
import { PaypalButton } from 'pay-sdk-react';
|
|
@@ -548,7 +553,10 @@ export default PaypalComponent;
|
|
|
548
553
|
|
|
549
554
|
## Stripe
|
|
550
555
|
|
|
556
|
+
引入支付组件,使用 Stripe 支付。Stripe 支付完成后,Stripe 官方会重定向到业务指定的结果页面,重定向地址由业务后端服务调用 Stripe 官方创建支付订单 API 时传入。
|
|
557
|
+
|
|
551
558
|
### 方式一:PayButton
|
|
559
|
+
引入支付按钮,点击唤起支付 modal 或 popup,展示 Stripe 支付表单。用户完成支付后,Stripe 会重定向到业务指定的结果页面。
|
|
552
560
|
|
|
553
561
|
```typescript
|
|
554
562
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -574,6 +582,7 @@ export default StripeComponent;
|
|
|
574
582
|
```
|
|
575
583
|
|
|
576
584
|
### 方式二:Stripe.Button
|
|
585
|
+
引入 Stripe.Button 按钮,点击唤起支付 modal 或 popup,展示 Stripe 支付表单。用户完成支付后,Stripe 会重定向到业务指定的结果页面。
|
|
577
586
|
|
|
578
587
|
```typescript
|
|
579
588
|
import { Stripe } from 'pay-sdk-react';
|
|
@@ -598,6 +607,7 @@ export default StripeComponent;
|
|
|
598
607
|
|
|
599
608
|
|
|
600
609
|
### 方式三:自定义唤起 popup - 推荐 移动端 使用
|
|
610
|
+
使用自定义按钮,调用 Stripe.Popup 组件,展示 Stripe 支付表单。用户完成支付后,Stripe 会重定向到业务指定的结果页面。
|
|
601
611
|
|
|
602
612
|
```typescript
|
|
603
613
|
import { useRef, useState } from 'react';
|
|
@@ -640,6 +650,7 @@ export default StripeComponent;
|
|
|
640
650
|
```
|
|
641
651
|
|
|
642
652
|
### 方式四:自定义唤起 modal - 推荐 PC 端使用
|
|
653
|
+
使用自定义按钮,调用 Stripe.Modal 组件,展示 Stripe 支付表单。用户完成支付后,Stripe 会重定向到业务指定的结果页面。
|
|
643
654
|
|
|
644
655
|
```typescript
|
|
645
656
|
import { useRef, useState } from 'react';
|
|
@@ -683,7 +694,7 @@ export default StripeComponent;
|
|
|
683
694
|
```
|
|
684
695
|
|
|
685
696
|
### 方式五:Stripe 表单
|
|
686
|
-
引入 Stripe
|
|
697
|
+
引入 Stripe 表单组件,自定义承接和展示时机。用户完成支付后,Stripe 会重定向到业务指定的结果页面。
|
|
687
698
|
|
|
688
699
|
```typescript
|
|
689
700
|
import { Stripe } from 'pay-sdk-react';
|
|
@@ -707,8 +718,10 @@ export default StripeComponent;
|
|
|
707
718
|
|
|
708
719
|
## 空中云汇(Airwallex)
|
|
709
720
|
|
|
721
|
+
引入支付组件,使用空中云汇支付。空中云汇支付完成后,空中云汇支付组件会回调 onSuccess 方法,业务执行后续逻辑。
|
|
722
|
+
|
|
710
723
|
### 方式一:PayButton
|
|
711
|
-
引入支付按钮,点击唤起 popup 承接表单(推荐移动端),PC 端推荐唤起 modal
|
|
724
|
+
引入支付按钮,点击唤起 popup 承接表单(推荐移动端),PC 端推荐唤起 modal。用户完成支付后,空中云汇支付组件会回调 onSuccess 方法,业务执行后续逻辑。
|
|
712
725
|
|
|
713
726
|
```typescript
|
|
714
727
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -757,6 +770,7 @@ export default AirwallexComponent;
|
|
|
757
770
|
```
|
|
758
771
|
|
|
759
772
|
### 方式二:自定义唤起 popup
|
|
773
|
+
使用自定义按钮,调用 Airwallex.Popup 组件,展示空中云汇支付表单。用户完成支付后,空中云汇支付组件会回调 onSuccess 方法,业务执行后续逻辑。
|
|
760
774
|
|
|
761
775
|
```typescript
|
|
762
776
|
import { useRef, useState } from 'react';
|
|
@@ -834,6 +848,7 @@ export default AirwallexComponent;
|
|
|
834
848
|
```
|
|
835
849
|
|
|
836
850
|
### 方式三:唤起 modal
|
|
851
|
+
使用自定义按钮,调用 Airwallex.Modal 组件,展示空中云汇支付表单。用户完成支付后,空中云汇支付组件会回调 onSuccess 方法,业务执行后续逻辑。
|
|
837
852
|
|
|
838
853
|
```typescript
|
|
839
854
|
import { useRef, useState } from 'react';
|
|
@@ -912,7 +927,7 @@ export default AirwallexComponent;
|
|
|
912
927
|
|
|
913
928
|
|
|
914
929
|
### 方式四:自定义承接
|
|
915
|
-
引入 Airwallex
|
|
930
|
+
引入 Airwallex 表单组件,自定义承接和展示时机。用户完成支付后,空中云汇支付组件会回调 onSuccess 方法,业务执行后续逻辑。
|
|
916
931
|
|
|
917
932
|
```typescript
|
|
918
933
|
import { Airwallex } from 'pay-sdk-react';
|
|
@@ -952,7 +967,7 @@ export default AirwallexComponent;
|
|
|
952
967
|
```
|
|
953
968
|
|
|
954
969
|
### 方式五:Airwallex.Button
|
|
955
|
-
|
|
970
|
+
引入支付按钮,点击打开第三方支付链接,同时唤起等待支付结果蒙层。用户完成支付后,空中云汇会重定向到业务指定的结果页面。
|
|
956
971
|
|
|
957
972
|
```typescript
|
|
958
973
|
import { Airwallex } from 'pay-sdk-react';
|
|
@@ -980,8 +995,10 @@ export default AirwallexComponent;
|
|
|
980
995
|
|
|
981
996
|
## Payssion
|
|
982
997
|
|
|
998
|
+
引入支付组件,使用 Payssion 支付。Payssion 支付完成后,Payssion 官方会重定向到业务指定的结果页面,重定向地址由业务后端服务调用 Payssion 官方创建支付订单 API 时传入。
|
|
999
|
+
|
|
983
1000
|
### 方式一:PayButton
|
|
984
|
-
|
|
1001
|
+
引入支付按钮,点击打开第三方支付链接,同时唤起等待支付结果蒙层。用户完成支付后,Payssion 会重定向到业务指定的结果页面。
|
|
985
1002
|
|
|
986
1003
|
```typescript
|
|
987
1004
|
import { PayButton, PaymentMethod } from 'pay-sdk-react';
|
|
@@ -1016,6 +1033,7 @@ export default PayssionComponent;
|
|
|
1016
1033
|
```
|
|
1017
1034
|
|
|
1018
1035
|
### 方式二:PayssionButton
|
|
1036
|
+
引入 PayssionButton 按钮,点击打开第三方支付链接,同时唤起等待支付结果蒙层。用户完成支付后,Payssion 会重定向到业务指定的结果页面。
|
|
1019
1037
|
|
|
1020
1038
|
```typescript
|
|
1021
1039
|
import { PayssionButton } from 'pay-sdk-react';
|