#mo.dankwambo
1 messages ยท Page 1 of 1 (latest)
๐ Thanks for reaching out
Did you follow this guide for building a Subscription Integrations in your platform ?
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
I initially ensured that we had the payment methods added to the Invoice template [screenshot 1] and the payment method [screenshot 2] on the Stripe dashboard.
Then I used the curl command to change the billing cycle of an existing subscription, in order to simulate the end of the subscription period and trigger the automatic invoice generation quickly [3]. This successfully created the payment intent on Stripe here (https://dashboard.stripe.com/test/events/evt_3MFbEzKl7yri9QNL0HuOgfFh). You can still it only shows the card as the payment_method_types
[3]
curl https://api.stripe.com/v1/subscriptions/SUB_ID
-u SECRET_KEY:
-d billing_cycle_anchor=now
-d proration_behavior=none
Yes, we did! We have no issues with subscriptions whatsoever, it's just about testing how to add new payment methods to payment intents (without creating a fresh one). So that we can plan how to integrate the Payment Elements into our platform
The customer has a saved Card PaymentMethod already, that's why for the PaymentMethodTypes there were only the card option
You can update the PaymentIntent to support other PaymentMethodTypes:
https://stripe.com/docs/api/payment_intents/update#update_payment_intent-payment_method_types
@spare slate That's one of the first things I tried but it sends me back an error along the lines of โSome of the parameters you provided ([parameter]) cannot be used when modifying a PaymentIntent that was created by an invoice. You can try again without those parameters.โ.
This signals that there are some details or parameters that we canโt update on an existing PaymentIntent, especially if itโs related to amending the transaction details (payment methods, total transaction amount, etc.)
Ah yes the PaymentIntent was created by Subscription update and for an invoice, true.
If the customer want to use another PaymentMehtod type rather than the one saved, you need to update the customer default PaymentMethod, then issue an invoice
I'm not sure I understand this
How can we update the default payment method to a payment method that hasn't been added yet?
Let me summarize this better, actually the customer cus_M8R85ufOOWcEzI has a saved card PaymentMethod. When creating a new Invoice for a subscription action, the related PaymentIntent can be paid by the customer saved PaymentMethod or an other PaymentMethod with the same Type of the saved PaymentMethod. If your customer want to use another PaymentMehtod type, then you need to collect the new PaymentMethod ( for example: https://stripe.com/docs/payments/save-and-reuse?platform=checkout)
Then you update the customer payment method:
https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
Then you invoice the customer for that subscription update
Hhmn, so you're basically saying create a new setup intent with the new payment method, then saving it as the customer's default, then cancelling (voiding) the present invoice, then creating a new one?
That seems like a very long way around it tbh. Will also be very messy to implement
Yes agree, that's because the customer has already saved PaymentMehtod, so the easiest way is to use that pre-setup PaymentMethod (e.g. Card for this customer)
Yeah, I see what you mean. I was hoping I'd get a magic answer to take all my problems away but I guess that's not possible.
Would it be possible to create a new payment intent (after the invoice has been generated automatically) and then update the invoice's payment intent to the new one? Or would Stripe reject that as well as the invoice has been generated (similar to updating the payment intent after creation)?
Nope you can't also do that, you need to use the PaymentIntent created by the Invoice.
Haha, fair enough! Thanks for all your help!
With my pleasure, don't hesitate to come back if you have any follow up Question ๐