@12-apps/payments-frontend 2.1.0 → 3.0.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@12-apps/payments-frontend",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Browser half of the vendor-agnostic payments platform: plug-and-play MUI components for the per-provider settings page (credential form from each provider's schema, masked hints, verify/enable) and the checkout page (PIX QR + polling, card tokenization, hosted-checkout redirect), plus the headless hooks and fetch clients they build on. Talks only to the host's payments HTTP surface — never to a provider directly. Microfrontend-ready: no app coupling, host injects theme and auth.",
|
|
6
6
|
"exports": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"storybook:build": "storybook build"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@12-apps/payments-backend": "^
|
|
20
|
+
"@12-apps/payments-backend": "^4.0.0",
|
|
21
21
|
"react-qr-code": "^2.2.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
@@ -31,19 +31,6 @@ import type { CheckoutOrder } from "./types";
|
|
|
31
31
|
*/
|
|
32
32
|
export const HOSTED_ORDER_STORAGE_KEY = "payments.checkout.hostedOrder";
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* The key before the rename, READ ONLY.
|
|
36
|
-
*
|
|
37
|
-
* A buyer who left for the provider's page on the old bundle comes back to the
|
|
38
|
-
* new one with their order parked under the old name. Without this they land on
|
|
39
|
-
* the plain return screen — the order still settles, because the webhook does
|
|
40
|
-
* that and never depended on any of this, but the confirmation they were
|
|
41
|
-
* promised is missing for a reason they could not possibly understand.
|
|
42
|
-
*
|
|
43
|
-
* Delete once no session can still be mid-redirect across that deploy.
|
|
44
|
-
*/
|
|
45
|
-
const LEGACY_KEY = "futurepay.checkout.hostedOrder";
|
|
46
|
-
|
|
47
34
|
/**
|
|
48
35
|
* What a hosted provider appends to the return URL. InfinitePay sends the
|
|
49
36
|
* first three; Stripe's redirect-based 3-D Secure appends `payment_intent`
|
|
@@ -87,25 +74,21 @@ export function rememberHostedOrder(order: CheckoutOrder): void {
|
|
|
87
74
|
* resumed view belongs to exactly one return.
|
|
88
75
|
*/
|
|
89
76
|
/**
|
|
90
|
-
* The raw parked payload
|
|
77
|
+
* The raw parked payload, cleared as it is read.
|
|
91
78
|
*
|
|
92
79
|
* Split out from {@link takeHostedOrder} so the storage handling and the
|
|
93
|
-
* parsing stay separately readable —
|
|
94
|
-
*
|
|
95
|
-
* unrelated reasons anyway (storage disabled vs. a value that is not an order).
|
|
80
|
+
* parsing stay separately readable — the two halves fail for unrelated reasons
|
|
81
|
+
* anyway (storage disabled vs. a value that is not an order).
|
|
96
82
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
83
|
+
* (This once also read a pre-rename legacy key, kept only for sessions that
|
|
84
|
+
* were mid-redirect across the deploy that renamed the storage key. A hosted
|
|
85
|
+
* round trip lasts minutes, so that window is long closed and the shim is
|
|
86
|
+
* gone.)
|
|
100
87
|
*/
|
|
101
88
|
function takeParkedPayload(): string | null {
|
|
102
89
|
try {
|
|
103
|
-
const raw =
|
|
104
|
-
window.sessionStorage?.getItem(HOSTED_ORDER_STORAGE_KEY) ??
|
|
105
|
-
window.sessionStorage?.getItem(LEGACY_KEY) ??
|
|
106
|
-
null;
|
|
90
|
+
const raw = window.sessionStorage?.getItem(HOSTED_ORDER_STORAGE_KEY) ?? null;
|
|
107
91
|
window.sessionStorage?.removeItem(HOSTED_ORDER_STORAGE_KEY);
|
|
108
|
-
window.sessionStorage?.removeItem(LEGACY_KEY);
|
|
109
92
|
return raw;
|
|
110
93
|
} catch {
|
|
111
94
|
// Storage disabled or unavailable — the same "no parked order" as an empty
|