From cc28ebfa290dfb1482b7cd505a023b6731d6e1ed Mon Sep 17 00:00:00 2001 From: Christopher Rogers Date: Wed, 11 Dec 2024 15:08:07 -0800 Subject: [PATCH] Consolidates Stripe intent next action handler selection --- lib/recurly/risk/three-d-secure/strategy/stripe.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/recurly/risk/three-d-secure/strategy/stripe.js b/lib/recurly/risk/three-d-secure/strategy/stripe.js index ec038a4e..36bb81af 100644 --- a/lib/recurly/risk/three-d-secure/strategy/stripe.js +++ b/lib/recurly/risk/three-d-secure/strategy/stripe.js @@ -50,16 +50,12 @@ export default class StripeStrategy extends ThreeDSecureStrategy { }; const handleError = err => this.threeDSecure.error('3ds-auth-error', { cause: err }); - (() => ( - isPaymentIntent - ? this.stripe.handleNextAction({ clientSecret: this.stripeClientSecret }) - : this.stripe.confirmCardSetup(this.stripeClientSecret) - ))() + this.stripe.handleNextAction({ clientSecret: this.stripeClientSecret }) .then(handleResult) .catch(err => { // Handle a Payment Intent which has already had its action handled and succeeded if (err.name === 'IntegrationError') { - return this.stripe.retrievePaymentIntent(this.stripeClientSecret) + return this.stripe[isPaymentIntent ? 'retrievePaymentIntent' : 'retrieveSetupIntent'](this.stripeClientSecret) .then(result => { if (result.error) { throw result.error;