#nerder-payment-intent-prices

1 messages ยท Page 1 of 1 (latest)

weak helm
#

Hey! Correct, Payment Intents only currently accept an amount parameter (no line items like Checkout)

#

Instead you'd pass the Price objects when creating the Subscription, which would in turn create the related Payment Intents

spark stump
#

Ok, so what will be the actual correct scenario for subscriptions?

weak helm
spark stump
#

We are looking for a user experience like the following:

The user check on the different types of sub we offer, as soon as they chose one they are prompted a payment sheet directly in the app from where to add their payment details (if they don't have any payment method registered just yet) and then pay

#

the thing with checkout is that in order to use it we need to redirect our users outside the app, and we would like to integrate that in our app experience

#

by doing a custom integration using the Stripe API

weak helm
#

Yup, this is completely possible with a custom integration using Stripe.js and our APIs. Link below details a basic integration in your preferred languages

spark stump
#

Amazing ๐Ÿ™

#

We are a bit confused between setup intent, payment intent eheh

spark stump
weak helm
#

Payment Intent is the object that facilitates a payment and tracks the state of that payment.
Setup Intent is the object that facilitates creating and saving a payment method for future payments.

weak helm
spark stump
#

but there are no example of creating a sub there

#

anyway in alternative a TS/JS integration is fine, if we understand the concept we can port it then

weak helm
#

Sweet! Yeah that's a third-party lib so we have a little understanding of it. Although the maintainers hang out on this Discord

#

If you have any specific questions, I'm happy to help

spark stump
#

Ok, so probably the best for me will be to have a chat with the maintainers directly and explain them the problem

weak helm
#

Well I can try help with any Stripe specific stuff and even Flutter

spark stump
#

Ow amazing

#

ok then the issue here is that we don't understand the actual flow, basically we were using what they called paymentSheet

#

but this seems to actually support only PaymentIntents which for our understanding are not supposed to be working with subscriptions

#

but maybe the way to go there is to actually create a setup intent first, save the payment method and then subsequentially let the user buy their chosen sub

weak helm
#

Yeah I don't think that library has support for Subscriptions per se

#

So you'd likely:

  • Create Subscription server-side
  • Capture payment method (via the Flutter UI)
  • Confirm the Payment Intent or Setup Intent from the Subscription object (also via Flutter)
#

Really not too different from our regular integration

spark stump
#

ok

#

But I can create a sub before of capturing the payment method?

weak helm
#

But obviously adapt client-side components for Flutter

spark stump
#

so in my head will be this:

The user has no payment method registered yet, as soon as they tap on the sub we are going to create the customer and subscription (server side), then we create the setup intent in order and we return the client secret, from there we prompt a UI in order to capture their payment method details and send the request back to Stripe

#

I think it's quite clear, i'll try to spike this one out adapting it with the flutter use-case and hopefully it works ๐Ÿ™ ๐Ÿ™ ๐Ÿ™

#

Thank you so much and sorry for rubber duck this with you, I needed it eheh

weak helm
#

create the setup intent
You won't need this part

#

The Subscription object will have an associated Payment Intent or Setup Intent (depends on some factors, will whether there's a trial)