@revenexx/cover 0.21.0 → 0.21.1
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.
|
@@ -8,9 +8,11 @@ import { type PspInstrument, PspInputError, type PspMountContext, type PspTokeni
|
|
|
8
8
|
* secure.novalnet.de. `tokenize()` asks the iframe for the card's `pan_hash`
|
|
9
9
|
* and `unique_id`; only those reach the BFF, never card data.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* `do_redirect` in the iframe's answer means the card needs 3-D Secure. It is
|
|
12
|
+
* not a request for the hosted page: the pan hash is still the instrument, the
|
|
13
|
+
* payment is created with it, and Novalnet answers a `redirect_url` to the
|
|
14
|
+
* 3-D Secure step only. Dropping the hash there sent the buyer to the full
|
|
15
|
+
* payment page to type the card a second time.
|
|
14
16
|
*/
|
|
15
17
|
|
|
16
18
|
export const NOVALNET_UTILITY_JS = "https://cdn.novalnet.de/js/v2/NovalnetUtility-1.1.2.js";
|
|
@@ -130,14 +132,11 @@ export function novalnetFormConfig(
|
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
/**
|
|
133
|
-
* What the iframe's hash answer becomes for the order: the instrument
|
|
134
|
-
*
|
|
135
|
+
* What the iframe's hash answer becomes for the order: the instrument. A
|
|
136
|
+
* `do_redirect` answer carries one as well (the card needs 3-D Secure, which
|
|
137
|
+
* the payment's redirect takes care of), so it is handed on like any other.
|
|
135
138
|
*/
|
|
136
139
|
export function novalnetInstrumentOf(answer: NovalnetHashAnswer): PspInstrument {
|
|
137
|
-
const redirect = answer.do_redirect;
|
|
138
|
-
if (redirect === 1 || redirect === "1" || redirect === true) {
|
|
139
|
-
return {};
|
|
140
|
-
}
|
|
141
140
|
const panHash = answer.hash ?? answer.pan_hash;
|
|
142
141
|
if (!panHash || !answer.unique_id) {
|
|
143
142
|
// Novalnet names what is wrong with the card the buyer typed; without a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revenexx/cover",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.1",
|
|
4
4
|
"description": "Cover — revenexx design system for Nuxt. Distributed as a Nuxt layer: generic UI components, theming tokens and stores shared by the demo shop, custom storefronts and the Blokkli theme.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
@@ -55,6 +55,8 @@ interface OrderLikePayload {
|
|
|
55
55
|
payment?: { method: string };
|
|
56
56
|
shipping?: { method: string; price: number; tax_rate: number };
|
|
57
57
|
items: Array<Record<string, unknown>>;
|
|
58
|
+
/** The promotions evaluated and reserved for this cart, in the orders app's own shape. */
|
|
59
|
+
discounts?: Array<Record<string, unknown>>;
|
|
58
60
|
userData?: Record<string, unknown>;
|
|
59
61
|
}
|
|
60
62
|
|
|
@@ -82,6 +84,9 @@ export async function submitThroughProcurement(payload: OrderLikePayload): Promi
|
|
|
82
84
|
...(payload.payment ? { payment: payload.payment } : {}),
|
|
83
85
|
...(payload.shipping ? { shipping: payload.shipping } : {}),
|
|
84
86
|
...(payload.userData ? { user_data: payload.userData } : {}),
|
|
87
|
+
// Without them a direct order was placed at the undiscounted price while
|
|
88
|
+
// the promotion's use was committed (procurement forwards them to orders).
|
|
89
|
+
...(payload.discounts?.length ? { discounts: payload.discounts } : {}),
|
|
85
90
|
items: payload.items,
|
|
86
91
|
},
|
|
87
92
|
});
|