#kellycarpet-subscription

1 messages · Page 1 of 1 (latest)

warm rune
#

Hi, let me clarify a bit on this

#

So you want to use PaymentRequestButton, and SetupIntent?

jade gulch
#

correct

warm rune
#

How are you currently creating the Subscription?

jade gulch
#

i want to be able to allow users to setup a subscription (with 30 day trial) using apple pay

#

(or google pay...)

#

currently, i have a credit card form. on the server side, i create a customer and subscription, and i send the pending_setup_intent's client token to the client-side, and then do:

      stripe
        .confirmCardSetup(clientSecret, {
          payment_method: {
            card: elements.getElement(CardNumberElement),
            billing_details: {
              email: props.customerEmail,
            },
          },
        })
warm rune
#

I see

#

Let me look further into this flow

jade gulch
#

👍

warm rune
#

Hi there, looking around the guide for PaymentRequestButton (https://stripe.com/docs/stripe-js/elements/payment-request-button), I don't see any option to work with SetupIntent, since the confirmCardSetup is entirely different method and it's purpose is also different than PaymentRequestButton's confirmCardPayment. Let me ask some of my colleague to see if they have other useful information for you

#

Hi @jade gulch we think it is possible. You can following the PaymentRequestButton guide above, and then in step 5 "Complete the payment" [0], you will just need to swap the confirmCardPayment method with confirmCardSetup you had, with the payment_method to ev.paymentMethod.id like the doc is doing
[0] https://stripe.com/docs/stripe-js/elements/payment-request-button#html-js-complete-payment

Collect payment and address information from customers who use Apple Pay, Google Pay, and browser-saved cards with Payment Request APIs such as Microsoft Pay on Edge.