#faz-Subscription

1 messages · Page 1 of 1 (latest)

unreal bolt
#

Hi @heavy saffron , welcome back!

heavy saffron
#

Thanks!

unreal bolt
#

Can I have the subscription ID?

heavy saffron
#

I have a payment intent creation, then i confirm card payment, then i make a new customer/product/subscription

#

pi_3KiX4oD7lOuiuDEB14yIMT7r is the subscription id

#

pi_3KiX4kD7lOuiuDEB1jqmDRt5 is the single payment made at the same time

#

I only want a subscription, not also a single payment

unreal bolt
#

OK, usually we just need to confirm the latest_invoice.payment_intent on the subscription. May I know why do you create another payment intent? is it collect the payment method?

heavy saffron
#

I'm confused...Another payment intent? Per payment, I'm only creating one

unreal bolt
#

There's another paymentIntent from subscription's latest_invoice, which was created implicitly if the subscription's first invoice requires payment.

#

Maybe can you tell what you want to achieve? and I'll give you some suggetions.

heavy saffron
#

I'd just like to create a subscription payment flow that uses apple pay

#

There's no 1 time payments involved at all

#

Just recurring payments

heavy saffron
unreal bolt
#

Got it, you can use SetupIntent to collect the payment method and use it in the following subscription.

heavy saffron
#

ah ok thanks

#

does the setupintent have the same parameters as payment intent? and is the response object the same? like can i literally just ctrl+f paymentIntent and replace with setupIntent

unreal bolt
#

Just give me a sec, let me test it out in my own integration and I'll let you know the steps

heavy saffron
#

k thanks

unreal bolt
#

Hi @heavy saffron thanks for the waiting. here's the flow

  1. Create a SetupIntent with a customerId and set payment_method_types to ['card']
  2. Set pending to true (https://stripe.com/docs/js/appendix/payment_item_object) when you create the payment request,
  3. In paymentRequest.on('paymentmethod',, call stripe.confirmCardSetup() instead of stripe.confirmPayment()
heavy saffron
#

ok

#

what about when i update the payment request

#

since the price changes depending on the user form input

#

should i keep pending as true

#

also i have a parameter in my current confirmCardPayment function which is setup_future_usage, can i keep this parameter in confirmCardSetup? will it still be valid

unreal bolt
#

I'd suggest you to set the pending to true so that the Apple Pay paymentsheet doesn't display the amount.

heavy saffron
#

ok

#

i mean when i update the request with the total

#

should i keep pending as true

#

or then set it to false

unreal bolt
#

The purpose is to collect the payment details so that you can use it later for the subscription invoice payment.

heavy saffron
#

ok

heavy saffron
#

cheers man it worked

#

thanks

unreal bolt
#

Cool, happy to help!

heavy saffron
#

how can i then force the user to enter in shipping details in apple pay? requestShipping: true in the paymentrequest and then what?

#

I tried that earlier and it said something about setting shippingOptions parameter? in which function do i set that

unreal bolt