From 850710a7e218bdebd10527c2209471cad5bc9765 Mon Sep 17 00:00:00 2001 From: Shagufa92 <93454387+Shagufa92@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:35:59 -0600 Subject: [PATCH] Removing the validation on billing address.and modifying the phone number field for UK merchants --- src/paypal/ppcp_apple/ppcpOnPaymentAuthorizedApple.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/paypal/ppcp_apple/ppcpOnPaymentAuthorizedApple.ts b/src/paypal/ppcp_apple/ppcpOnPaymentAuthorizedApple.ts index e905d24..fbf8b9a 100644 --- a/src/paypal/ppcp_apple/ppcpOnPaymentAuthorizedApple.ts +++ b/src/paypal/ppcp_apple/ppcpOnPaymentAuthorizedApple.ts @@ -61,7 +61,7 @@ export async function ppcpOnPaymentAuthorizedApple(event: ApplePayPaymentAuthori }); } - const billingAddressResponse = await callBillingAddressEndpoint(billingAddress, !isSameAddress); + const billingAddressResponse = await callBillingAddressEndpoint(billingAddress, false); if (!billingAddressResponse.success) { return fail({ code: applePayConstants.APPLEPAY_ERROR_CODE_BILLING_CONTACT, @@ -89,7 +89,6 @@ export async function ppcpOnPaymentAuthorizedApple(event: ApplePayPaymentAuthori gateway_public_id: gatewayPublicId, currency: currencyCode, amount: totalAmountDue, - wallet_pay_type: 'applepay', extra_payment_data: { brand: token.paymentMethod.network, last_digits: displayNameLast, @@ -110,6 +109,13 @@ export async function ppcpOnPaymentAuthorizedApple(event: ApplePayPaymentAuthori const {payment: addedPayment} = successResponse.data as IAddPaymentResponse; const orderId = addedPayment.token; + if (billingContact?.phoneNumber?.includes('+')) { + billingContact?.phoneNumber?.replace('+',''); + } + if (shippingContact?.phoneNumber?.includes('+')) { + shippingContact?.phoneNumber?.replace('+',''); + } + await appleInstance.confirmOrder({orderId, token, billingContact, shippingContact}); applePaySession.completePayment(ApplePaySession.STATUS_SUCCESS); orderProcessing();