Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Jul 17, 2024
1 parent a2b7abe commit c388cec
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/web/assets/elementsform/js/paymentForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ class PaymentIntentsElements {
this.stripeInstance = Stripe(publishableKey);
this.elements = null;
this.scenario = this.container.dataset.clientScenario;
this.completePaymentActionUrl = this.container.dataset.completePaymentActionUrl;
this.completeSubscriptionActionUrl = this.container.dataset.completeSubscriptionActionUrl;
this.completePaymentActionUrl =
this.container.dataset.completePaymentActionUrl;
this.completeSubscriptionActionUrl =
this.container.dataset.completeSubscriptionActionUrl;
this.subscription = this.container.dataset.subscription;
this.processingButtonText = this.container.dataset.processingButtonText;
this.hiddenClass = this.container.dataset.hiddenClass;
Expand Down Expand Up @@ -59,12 +61,15 @@ class PaymentIntentsElements {
}

async requiresActionFlow() {
const completeSubscriptionActionUrl = new URL(this.completeSubscriptionActionUrl);
const completeSubscriptionActionUrl = new URL(
this.completeSubscriptionActionUrl
);
completeSubscriptionActionUrl.searchParams.append(
'subscription',
this.subscription
);
this.completeSubscriptionActionUrl = completeSubscriptionActionUrl.toString();
this.completeSubscriptionActionUrl =
completeSubscriptionActionUrl.toString();

const {error} = await this.stripeInstance.confirmPayment({
clientSecret: this.container.dataset.clientSecret,
Expand Down Expand Up @@ -305,7 +310,7 @@ class PaymentIntentsElements {
}

if (this.scenario === 'requires_action') {
this.requiresActionFlow();
this.requiresActionFlow();
}
}
}
Expand Down

0 comments on commit c388cec

Please sign in to comment.