@economist/web-apple-pay 1.7.2 → 1.7.4
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/dist/index.js +599 -82
- package/dist/src/apple-pay-button.js +594 -77
- package/dist/src/apple-pay-button.stories.js +620 -85
- package/dist/src/apple-pay-modal.d.ts +16 -1
- package/dist/src/apple-pay-modal.js +556 -10
- package/dist/src/apple-pay-modal.stories.js +594 -77
- package/dist/src/clients/payment-checkout/apple-session.js +4 -2
- package/dist/src/clients/payment-checkout/detects.js +2 -1
- package/dist/src/clients/payment-checkout/payment-handler.d.ts +1 -0
- package/dist/src/clients/payment-checkout/payment-handler.js +1 -0
- package/dist/src/clients/payment-checkout/types.d.ts +1 -0
- package/dist/src/index.js +599 -82
- package/dist/src/stories/utils/story-env.js +18 -0
- package/package.json +1 -1
|
@@ -192,7 +192,8 @@ async function handleMerchantValidation(event, session, config) {
|
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
194
|
session.completeMerchantValidation(response.merchantSession);
|
|
195
|
-
} catch {
|
|
195
|
+
} catch (err) {
|
|
196
|
+
console.error("[web-apple-pay] onvalidatemerchant: error during validation", err);
|
|
196
197
|
session.abort();
|
|
197
198
|
redirectToFallbackCheckout(config);
|
|
198
199
|
}
|
|
@@ -225,7 +226,8 @@ function startApplePaySession(config) {
|
|
|
225
226
|
};
|
|
226
227
|
trackWalletPaymentSheetOpen(config.skuId);
|
|
227
228
|
session.begin();
|
|
228
|
-
} catch {
|
|
229
|
+
} catch (err) {
|
|
230
|
+
console.error("[web-apple-pay] startApplePaySession: failed to create session", err);
|
|
229
231
|
redirectToFallbackCheckout(config);
|
|
230
232
|
}
|
|
231
233
|
}
|
|
@@ -34,7 +34,8 @@ var isApplePayAvailable = async () => {
|
|
|
34
34
|
);
|
|
35
35
|
return false;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
const hasActiveCard = await applePaySession.canMakePaymentsWithActiveCard(merchantId);
|
|
38
|
+
return hasActiveCard;
|
|
38
39
|
} catch (error) {
|
|
39
40
|
console.error("Error checking Apple Pay active card status:", error);
|
|
40
41
|
return false;
|
|
@@ -338,6 +338,7 @@ async function handlePaymentAuthorized(event, session, sessionData, config) {
|
|
|
338
338
|
const result = await performPurchase({
|
|
339
339
|
applePayToken: event.payment.token,
|
|
340
340
|
skuId: config.skuId,
|
|
341
|
+
currency: config.currency,
|
|
341
342
|
billingContact: event.payment.billingContact,
|
|
342
343
|
...event.payment.shippingContact && {
|
|
343
344
|
shippingContact: event.payment.shippingContact
|
|
@@ -87,6 +87,7 @@ export type PurchaseRequest = {
|
|
|
87
87
|
* only provide a `skuId`. Frontend uses `skuId` directly — BFF must be aligned.
|
|
88
88
|
*/
|
|
89
89
|
skuId: string;
|
|
90
|
+
currency: string;
|
|
90
91
|
billingContact: ApplePayPaymentContact;
|
|
91
92
|
/** Required if loggedIn: false — contains emailAddress from Apple Pay sheet. */
|
|
92
93
|
shippingContact?: ApplePayPaymentContact;
|