Skip to content

Commit f889eee

Browse files
fix(payment): PAYPAL-5925 fixed 3ds PPCP FL nonce (#3013)
1 parent e0af1da commit f889eee

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

packages/paypal-commerce-integration/src/paypal-commerce-fastlane/paypal-commerce-fastlane-payment-strategy.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ describe('PayPalCommerceFastlanePaymentStrategy', () => {
586586

587587
expect(paypalCommerceRequestSender.createOrder).toHaveBeenCalledWith(methodId, {
588588
cartId: cart.id,
589-
fastlaneToken: 'paypal_fastlane_instrument_id_nonce',
589+
fastlaneToken: 'paypal_fastlane_instrument_id_nonce_3ds',
590590
});
591591
});
592592

packages/paypal-commerce-integration/src/paypal-commerce-fastlane/paypal-commerce-fastlane-payment-strategy.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -448,26 +448,17 @@ export default class PaypalCommerceFastlanePaymentStrategy implements PaymentStr
448448

449449
if (
450450
liabilityShift === LiabilityShiftEnum.No ||
451-
liabilityShift === LiabilityShiftEnum.Unknown
451+
liabilityShift === LiabilityShiftEnum.Unknown ||
452+
authenticationState === TDSecureAuthenticationState.Errored ||
453+
authenticationState === TDSecureAuthenticationState.Cancelled
452454
) {
453455
throw new PaymentMethodInvalidError();
454456
}
455457

456-
await this.createOrder(paypalNonce);
457-
458458
if (authenticationState === TDSecureAuthenticationState.Succeeded) {
459+
await this.createOrder(nonce);
459460
return nonce;
460461
}
461-
462-
// Cancelled or errored, merchant can choose to send the customer back to 3D Secure or submit a payment and or vault the payment token.
463-
if (authenticationState === TDSecureAuthenticationState.Errored) {
464-
throw new PaymentMethodInvalidError();
465-
}
466-
467-
if (authenticationState === TDSecureAuthenticationState.Cancelled) {
468-
console.error('3DS check was canceled');
469-
throw new PaymentMethodInvalidError();
470-
}
471462
}
472463

473464
return paypalNonce;

0 commit comments

Comments
 (0)