Skip to content

Commit

Permalink
Removing the validation on billing address
Browse files Browse the repository at this point in the history
  • Loading branch information
Shagufa92 committed Feb 21, 2024
1 parent 850710a commit 6820f56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/paypal/ppcp_apple/ppcpOnPaymentAuthorizedApple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
callBillingAddressEndpoint,
callGuestCustomerEndpoint,
callShippingAddressEndpoint,
isObjectEquals,
orderProcessing,
applePayConstants,
getTotals,
Expand Down Expand Up @@ -36,7 +35,6 @@ export async function ppcpOnPaymentAuthorizedApple(event: ApplePayPaymentAuthori

const shippingAddress = formatApplePayContactToCheckoutAddress(shippingContact as ApplePayPaymentContact);
const billingAddress = formatApplePayContactToCheckoutAddress(billingContact as ApplePayPaymentContact);
const isSameAddress = isObjectEquals(shippingAddress, billingAddress);

const fail = (error: ApplePayError) => {
applePaySession.completePayment({
Expand Down Expand Up @@ -89,6 +87,7 @@ 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 Down
6 changes: 1 addition & 5 deletions tests/paypal/ppcp_apple/ppcpOnPaymentAuthorizedApple.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ describe('testing ppcpOnPaymentAuthorizedApple function', () => {
givenName: addressContact.givenName,
familyName: addressContact.familyName,
emailAddress: addressContact.emailAddress,
notSame: true,
eventParam: event
},
{
Expand All @@ -145,7 +144,6 @@ describe('testing ppcpOnPaymentAuthorizedApple function', () => {
givenName: addressContact.givenName,
familyName: addressContact.familyName,
emailAddress: addressContact.emailAddress,
notSame: false,
eventParam: {...event, payment: {...event.payment, billingContact: addressContact}}
},
{
Expand All @@ -155,7 +153,6 @@ describe('testing ppcpOnPaymentAuthorizedApple function', () => {
givenName: '',
familyName: '',
emailAddress: '',
notSame: true,
eventParam: {...event, payment: {...event.payment, shippingContact: undefined}}
},
];
Expand All @@ -167,7 +164,6 @@ describe('testing ppcpOnPaymentAuthorizedApple function', () => {
givenName,
familyName,
emailAddress,
notSame,
eventParam }
) => {
formatApplePayContactToCheckoutAddressMock
Expand Down Expand Up @@ -199,7 +195,7 @@ describe('testing ppcpOnPaymentAuthorizedApple function', () => {
expect(callShippingAddressEndpointMock).toBeCalledTimes(1);
expect(callShippingAddressEndpointMock).toBeCalledWith(shipping, true);
expect(callBillingAddressEndpointMock).toBeCalledTimes(1);
expect(callBillingAddressEndpointMock).toBeCalledWith(billing, notSame);
expect(callBillingAddressEndpointMock).toBeCalledWith(billing, false);
expect(setTaxesMock).toBeCalledTimes(1);
expect(setTaxesMock).toBeCalledWith(API_RETRY);
expect(getPPCPAppleCredentialsCheckedMock).toBeCalledTimes(1);
Expand Down

0 comments on commit 6820f56

Please sign in to comment.