From 67a445d899de42d2df709f4f6d970bf6b493475c Mon Sep 17 00:00:00 2001 From: Petrisor Frincu Date: Tue, 3 Sep 2024 09:56:11 +0300 Subject: [PATCH] Testing apple pay --- apps/web/components/PayPal/ApplePayButton.vue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/web/components/PayPal/ApplePayButton.vue b/apps/web/components/PayPal/ApplePayButton.vue index 6be477d1e..8e42b1aac 100644 --- a/apps/web/components/PayPal/ApplePayButton.vue +++ b/apps/web/components/PayPal/ApplePayButton.vue @@ -81,11 +81,20 @@ const applePayPayment = async () => { if (!order || !order.order || !order.order.id) throw new Error('Order creation failed.'); console.log('Confirming Apple Pay order...'); - await applePay.confirmOrder({ - orderId: transaction.id, - token: event.payment.token, - billingContact: event.payment.billingContact, - }); + console.log('Transaction ID:', transaction.id); + console.log('Payment Token:', event.payment.token); + console.log('Billing Contact:', event.payment.billingContact); + + try { + await applePay.confirmOrder({ + orderId: transaction.id, + token: event.payment.token, + billingContact: event.payment.billingContact, + }); + } catch (error) { + console.error('Error during Apple Pay confirmation:', error); + throw new Error('Apple Pay confirmation failed'); + } console.log('Executing order...'); await executeOrder({