#kellycarpet - Setup Intents

1 messages · Page 1 of 1 (latest)

tribal rune
#

You would use the Setup Intent instead of attaching the Payment Method directly to the Customer (the Setup Intent will attach the Payment Method to the Customer for you once successfully confirmed).

sudden current
#

thanks! what does the flow look like on the client side?

#

do i create the subscription first, and then use that setup intent to collect the credit card details?

tribal rune
sudden current
#

Server - create customer, create subscription, send the setup intent's client secret to client side
client side - collect cc, expiry, cvc, send to confirmCardSetup along with the client secret, send payment method to server side
Server - save payment method onto subscription or customer?

tribal rune
#

No need for that last step, running confirmCardSetup will save the Payment Method to the Customer for you.

sudden current
#

ah, gotcha. so after that my subscription with the trial period is all setup for the customer?

tribal rune
#

It should be, yep. You should try this out in test mode to see how it works in practice and make sure everything works as expected. You can create test Subscriptions with a trial that ends in a few minutes to see how the first payment works.

sudden current
#

sounds good, thank you!