@blocklet/payment-react 1.19.22 → 1.20.0
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/.aigne/doc-smith/config.yaml +114 -0
- package/.aigne/doc-smith/output/structure-plan.json +361 -0
- package/.aigne/doc-smith/preferences.yml +55 -0
- package/.aigne/doc-smith/upload-cache.yaml +264 -0
- package/README.md +2 -3
- package/docs/_sidebar.md +33 -0
- package/docs/components-business-auto-topup.md +238 -0
- package/docs/components-business-overdue-invoice-payment.md +231 -0
- package/docs/components-business-resume-subscription.md +177 -0
- package/docs/components-business.md +45 -0
- package/docs/components-checkout-checkout-donate.md +199 -0
- package/docs/components-checkout-checkout-form.md +185 -0
- package/docs/components-checkout-checkout-table.md +228 -0
- package/docs/components-checkout.md +131 -0
- package/docs/components-history-credit-grants-list.md +98 -0
- package/docs/components-history-credit-transactions-list.md +116 -0
- package/docs/components-history-invoice-list.md +104 -0
- package/docs/components-history-payment-list.md +65 -0
- package/docs/components-history.md +92 -0
- package/docs/components-ui-form-elements-address-form.md +150 -0
- package/docs/components-ui-form-elements-country-select.md +105 -0
- package/docs/components-ui-form-elements-currency-selector.md +124 -0
- package/docs/components-ui-form-elements-phone-input.md +160 -0
- package/docs/components-ui-form-elements.md +125 -0
- package/docs/components-ui-payment-summary.md +157 -0
- package/docs/components-ui-pricing-table.md +227 -0
- package/docs/components-ui.md +44 -0
- package/docs/components.md +95 -0
- package/docs/getting-started.md +111 -0
- package/docs/guides-theming.md +175 -0
- package/docs/guides-utilities.md +235 -0
- package/docs/guides.md +95 -0
- package/docs/hooks-use-mobile.md +70 -0
- package/docs/hooks-use-subscription.md +129 -0
- package/docs/hooks.md +84 -0
- package/docs/overview.md +87 -0
- package/docs/providers-donate-provider.md +175 -0
- package/docs/providers-payment-provider.md +245 -0
- package/docs/providers.md +101 -0
- package/es/payment/form/index.js +15 -1
- package/lib/payment/form/index.js +14 -1
- package/package.json +5 -5
- package/src/payment/form/index.tsx +16 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/payment-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"description": "Reusable react components for payment kit v2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@arcblock/did-connect-react": "^3.1.32",
|
|
58
58
|
"@arcblock/ux": "^3.1.32",
|
|
59
|
-
"@arcblock/ws": "^1.
|
|
59
|
+
"@arcblock/ws": "^1.24.3",
|
|
60
60
|
"@blocklet/theme": "^3.1.32",
|
|
61
61
|
"@blocklet/ui-react": "^3.1.32",
|
|
62
62
|
"@mui/icons-material": "^7.1.2",
|
|
63
63
|
"@mui/lab": "7.0.0-beta.14",
|
|
64
64
|
"@mui/material": "^7.1.2",
|
|
65
65
|
"@mui/system": "^7.1.1",
|
|
66
|
-
"@ocap/util": "^1.
|
|
66
|
+
"@ocap/util": "^1.24.3",
|
|
67
67
|
"@stripe/react-stripe-js": "^2.9.0",
|
|
68
68
|
"@stripe/stripe-js": "^2.4.0",
|
|
69
69
|
"@vitejs/plugin-legacy": "^7.0.0",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@babel/core": "^7.27.4",
|
|
95
95
|
"@babel/preset-env": "^7.27.2",
|
|
96
96
|
"@babel/preset-react": "^7.27.1",
|
|
97
|
-
"@blocklet/payment-types": "1.
|
|
97
|
+
"@blocklet/payment-types": "1.20.0",
|
|
98
98
|
"@storybook/addon-essentials": "^7.6.20",
|
|
99
99
|
"@storybook/addon-interactions": "^7.6.20",
|
|
100
100
|
"@storybook/addon-links": "^7.6.20",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"vite-plugin-babel": "^1.3.1",
|
|
126
126
|
"vite-plugin-node-polyfills": "^0.23.0"
|
|
127
127
|
},
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "ca71d3996c6c5be18827a9f3d516bab117b327dd"
|
|
129
129
|
}
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
formatError,
|
|
31
31
|
formatQuantityInventory,
|
|
32
32
|
getPrefix,
|
|
33
|
+
getQueryParams,
|
|
33
34
|
getStatementDescriptor,
|
|
34
35
|
getTokenBalanceLink,
|
|
35
36
|
isCrossOrigin,
|
|
@@ -229,6 +230,7 @@ export default function PaymentForm({
|
|
|
229
230
|
});
|
|
230
231
|
|
|
231
232
|
const currencies = flattenPaymentMethods(paymentMethods);
|
|
233
|
+
const searchParams = getQueryParams(window.location.href);
|
|
232
234
|
|
|
233
235
|
const onCheckoutComplete = useMemoizedFn(async ({ response }: { response: TCheckoutSession }) => {
|
|
234
236
|
if (response.id === checkoutSession.id && state.paid === false) {
|
|
@@ -743,6 +745,19 @@ export default function PaymentForm({
|
|
|
743
745
|
/>
|
|
744
746
|
);
|
|
745
747
|
|
|
748
|
+
const getRedirectUrl = () => {
|
|
749
|
+
if (searchParams.redirect) {
|
|
750
|
+
return decodeURIComponent(searchParams.redirect);
|
|
751
|
+
}
|
|
752
|
+
if (checkoutSession.success_url) {
|
|
753
|
+
return checkoutSession.success_url;
|
|
754
|
+
}
|
|
755
|
+
if (paymentLink?.after_completion?.redirect?.url) {
|
|
756
|
+
return paymentLink.after_completion.redirect.url;
|
|
757
|
+
}
|
|
758
|
+
return undefined;
|
|
759
|
+
};
|
|
760
|
+
|
|
746
761
|
if (onlyShowBtn) {
|
|
747
762
|
return (
|
|
748
763
|
<>
|
|
@@ -850,7 +865,7 @@ export default function PaymentForm({
|
|
|
850
865
|
mode={checkoutSession.mode}
|
|
851
866
|
onConfirm={onStripeConfirm}
|
|
852
867
|
onCancel={onStripeCancel}
|
|
853
|
-
returnUrl={
|
|
868
|
+
returnUrl={getRedirectUrl()}
|
|
854
869
|
/>
|
|
855
870
|
)}
|
|
856
871
|
</Stack>
|