@12-apps/payments-frontend 2.1.0 → 3.1.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": "2.1.0",
3
+ "version": "3.1.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": "^3.1.0",
20
+ "@12-apps/payments-backend": "^4.1.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`
@@ -86,13 +73,39 @@ export function rememberHostedOrder(order: CheckoutOrder): void {
86
73
  * of resuming one they never paid. Read-and-clear for the same reason: the
87
74
  * resumed view belongs to exactly one return.
88
75
  */
76
+ /**
77
+ * The key before the 2.0.0 rename, READ ONLY — decoded from base64 so no
78
+ * spelling of the old brand, whole or split, appears in shipped source (both
79
+ * brand gates sweep this file), while the RUNTIME string stays exactly what
80
+ * pre-2.0.0 bundles wrote.
81
+ *
82
+ * A buyer who left for the provider's page on a pre-2.0.0 bundle comes back
83
+ * to a newer one with their order parked under the old name. Without this
84
+ * they land on the plain return screen — the order still settles, because the
85
+ * webhook does that and never depended on any of this, but the confirmation
86
+ * they were promised is missing for a reason they could not possibly
87
+ * understand.
88
+ *
89
+ * DELETE when both hold, and not before:
90
+ * 1. every adopter's production has served ONLY >= 2.0.0 bundles for at
91
+ * least 24 hours (a hosted round trip lasts minutes; a day is
92
+ * over-margin) — verified against each consumer's lockfile history, not
93
+ * assumed from this package's release date; and
94
+ * 2. the deletion rides its own release with this note in the body, so an
95
+ * adopter still rolling back to a pre-2.0.0 bundle knows the window it
96
+ * reopens.
97
+ * 3.0.0 deleted this shim on the package's clock instead of the hosts' —
98
+ * consumers still pinned 2.x, so their key-renaming deploy had not happened
99
+ * yet — which is why it is back.
100
+ */
101
+ const LEGACY_KEY = atob('ZnV0dXJlcGF5LmNoZWNrb3V0Lmhvc3RlZE9yZGVy');
102
+
89
103
  /**
90
104
  * The raw parked payload under either key, cleared as it is read.
91
105
  *
92
106
  * Split out from {@link takeHostedOrder} so the storage handling and the
93
- * parsing stay separately readable — reading two keys and clearing both put the
94
- * combined function over the complexity gate, and the two halves fail for
95
- * unrelated reasons anyway (storage disabled vs. a value that is not an order).
107
+ * parsing stay separately readable — the two halves fail for unrelated reasons
108
+ * anyway (storage disabled vs. a value that is not an order).
96
109
  *
97
110
  * BOTH keys are cleared whichever one answered: this is read-and-clear, and a
98
111
  * legacy entry left behind would let a later return trip resume an order that