Skip to content

Commit

Permalink
Removing the validation on billing address.and modifying the phone nu…
Browse files Browse the repository at this point in the history
…mber field for UK merchants
  • Loading branch information
Shagufa92 committed Feb 21, 2024
1 parent 5b11d8d commit 850710a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/paypal/ppcp_apple/ppcpOnPaymentAuthorizedApple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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();
Expand Down

0 comments on commit 850710a

Please sign in to comment.