#fon
1 messages · Page 1 of 1 (latest)
if I create a Subscription (payment_behavoir=default_incomplete) , and use the pending_setup_intent from that newly created subscription, and confirm that setup intent from the client, the e-mandates should be handled automatically?
That's my understanding. Are you seeing something different?
The problem is that, creating a Subscription before gathering payment, I think it would make our logic a bit more complicated, since then we need to have a logic to cancel the subscription if payment is not provided within X
So the alternative would be to create a SetupIntent, and only when the payment method is provided, create the Subscription and pass in the payment method from the SetupIntent. But then I guess I do have to manage the mandates manually
If I'm reading this guide correctly, I think you have the full understanding of it, though I'm not 100% sure that you wouldn't have to do some amount of manual handling on your end for the Subscription flow: https://stripe.com/docs/invoicing/india-emandate-guide
As far as I can tell from our docs, Stripe will create the mandate for you, but you will still need to provide the details on the mandate via mandate_options in both the Subscriptions flow and the regular Setup Intents flow without Subscriptions
Only Stripe Checkout handles the full end-to-end mandate workflow for you (unless I'm missing something glaring)
Following this tutorial:
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
When first creating the "inactive" subscription like this:
subscription = stripe.Subscription.create(
customer='cus_xxxx',
items=[{
'price': 'price_xxxx',
}],
payment_behavior='default_incomplete',
payment_settings={'save_default_payment_method': 'on_subscription'},
expand=['latest_invoice.payment_intent'],
)
it says:
At this point the Subscription is inactive and awaiting payment.
Yet both in the UI and in the API the subscription says "active"
that makes sense, that I have to pass in the mandate options, since for a metered plan only I can guess how much would be charge in the future
So I guess my only last question is what I asked above, regarding the active / inactive subscriptions from the Tutorial
Do you have an example Subscription ID I can look at?
yes, I just created sub_1MEyIHG2GxotelpZXYRJCgwq
maybe in the Tutorial they use a non-metered price ?
Yeah, so this is a metered Subscription, which will behave a little different. Since an Invoice is not generated until the end of the billing cycle, the Subscription is considered active as soon as it is created
oh then it seems like it would be easier to:
- First Create a SetupIntent
- Confirm the SetupIntent with Payment Method in the client
- Then Create an active Subscription with that Payment Method --> Attaching here the mandate, as I understand, right?
I think what confuses me the most is this two sentences in https://stripe.com/docs/invoicing/india-emandate-guide
To generate a mandate, you must have already collected your customer’s PaymentMethods. While your customer is signed in, make a call to create a SetupIntent that includes the payment method ID and mandate details
When I first create my SetupIntent, I still don't have the payment method, since I use the client_secret of that SetupIntent to generate the Payment Form.
Then when the client app confirms the SetupIntent after the payment method is introduced, should I then modify the SetupIntent to add the mandate details in the backend?
Yeah, that seems odd. Are you using something like the Card Element or the Payment Element to accept the payment details?
Or do you have your own custom form?
Payment Element
Is the thinking here that the documentation is misleading, and I am able in fact to provide a mandate when creating a SetupIntent even if I haven't yet collected the payment method ?
Let me double-check. I'm not sure. My guess would be that you simply can't use the Payment Element, but I want to make sure I'm understanding correctly
Will circle back in a few
thank you, I really appreciate
Okay, so you can create the Setup Intent with confirm=False in order to create a Setup Intent with all the mandate_options. From there, you should be able to just follow the Payment Element flow as usual and Stripe will automatically create the mandate when the customer completes 3DS
You don't need to have a Payment Method up front in order to create the Setup Intent. I haven't yet tested if this will work with the Payment Element, but I can't see why it wouldn't. If you want, you can open a support email thread and I can get back to you in the next few days about this to confirm for sure. I just don't have the bandwidth to do it immediately in chat, as that requires a lot of coding and I'm juggling a number of other Discord threads.
If you want me to confirm it works with Payment Element, please open a support thread here: https://support.stripe.com/contact/email, then DM me your email address and account ID