nomadreservations / ngx-stripe

Angular 8.x wrapper for StripeJS
41 stars 32 forks source link

Add confirmCardPayment option for PaymentIntents API #31

Closed jordanchitty closed 4 years ago

jordanchitty commented 4 years ago

I have added a confirmCardPayment method to reflect the changes to the Stripe JS API. ConfirmCardPayment replaces CompletePaymentIntent, which has been deprecated. ConfirmCardPayment allows Stripe JS to handle SCA authentication correctly in the modal. https://stripe.com/docs/js/payment_intents/confirm_card_payment

Wlada commented 4 years ago

I used confirmPaymentIntent method instead

 this.stripe
          .confirmPaymentIntent(this.secretToken, this.element, {
            payment_method_data: {
              billing_details: {
                 address: {
                   city: 'Irving',
                   country: 'CA',
                   line1: '123 A Place',
                   line2: 'Suite 100',
                   postal_code: 'VOE 1H0',
                   state: 'BC'
                 },
                email: '',
                name: '',
                phone: '';
              }
            }
          })