#melodyclue
1 messages · Page 1 of 1 (latest)
hi! you can create a PaymentIntent at any time. Can you say more about the use case exactly?
ok, I want to charge the difference in subscription costs when I upgrade my subscription. (instead of pro-rating).
makes sense. Then sure, when you calculate that amount you can create a PaymentIntent for it against the customer's saved card (https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=elements#charge-saved-payment-method), or you could create a one-off invoice for it(https://stripe.com/docs/invoicing/integration); or you could add the amount as an InvoiceItem so it's charged in the next subscription invoice(https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items) .
This may be a silly question, but could creating a paymentIntent on the webhook paymentIntent.created result in an infinite loop?
yes
ok, As long as you take care of that, you can use the stripe sdk freely on the webhook!
👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
Hi , I was wondering if it is OK to use the stripe sdk on webhook and asked the question. I have come to the conclusion that you can use it, but you have to be careful about infinite loops!
Probably not, but is there an option to charge the difference in the cost of the plan when the plan is UPDATED, rather than pro rata?
technically it's possible
but you'd have to do it using add_invoice_items
instead of the prorations way
Okay, so you're saying you're going to disable the proportional allocation and add to the invoice item as the difference?
yes
exactly
so you update the price with prorations "none" and billing_cycle_anchor: "unchanged" and you add the difference as add_invoice_item
This will be reflected in the next invoice?
yes
ok!
unless you create the invoice for the subscription & customer and "pay" it immediately in your code
Is there a property that sets it up?