#mattsulima
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
the pending_setup_intent is populated when the first invoice is 0
either because it's a trial or having a 100% discount
Hey, thanks, does it mean I can simply have:
100 gbp recurring
and when I add additional invoice -100 gbp to it sums to 0 then it will populate pending_setup_intent instead of last invoice?
do you mean on the first invoice?
yea, first invoice
So I set recurring price 100, and then first invoice item added -100
if the total of the first invoice is 0 then pending_setup_intent would be populated rather than latest_invoice.payment_intent
Ok, thanks, I'll try this ๐
hey @sick socket another quetion if you don't mind - I am unable to create invoice or price with negative value , how to make first invoice total = 0?
Hi! I'm taking over this thread.
You want to make the first invoice of a subscription for $0? Can you give me a little more context on what you are trying to achieve?
Sure, I can give you as much details as I can ๐
We use Stripe for payments for our products. It's single payment (we use custom code payment element).
We also want to start using Stripe for our monthly payments too. I need to cover few scenarios:
- someone pays initial payment only (done)
- someone pays initial payment e.g. 150 gbp and checks "I want to turn on subscription too" (recurring monthly payment 100 gbp)
- someone paid already, we want to offer option to set up subscription only
So:
I am building a method which takes 2 params, recurring amount (e.g. 100 gbp monthly) and nullable option "initial amount" (as sometimes initial amount is already taken)
If initial amount is passed we want to charge user immediately and then charge him every month
If initial amount is null (because user paid earlier) then we want to charge user next month
I had problems how to make initial payment different amount than monthly amount (as initial payment contains other charges like deposit, commision, additional fees ect) . On this channel I got an info I can make and invoice (when creating subscription) and adjust initial amount. And it works if initial amount is bigger than recurring (e.g. recurring is 100, initial 150, I am adding 50 gbp to invoice and all is fine). But It doens't work if initial is smaller than recurring (e.g. 80 as we have a discount)
And also I got an info I can only skip initial payment if I make initial invoice 0, but how to make it 0 if I can't use negative amounts when I am setting initial invoice (or price for this invoice) ?
fyi pirices 100, 150 ect are an example, each product has own prices ๐
I had problems how to make initial payment different amount than monthly amount
I think the simplest solution is to use a coupon when you create the subscription, that makes the first month free.
Hmm I didn't try it!
So someone paid already, then wants to create subscription - we add coupon so first invoice is 0? (so it's payment intent not setup intent)?
You would add a 100% off coupon to the first month yes. So the first invoice would be zero. And because the invoice is zero, there would be no PaymentIntent but on the Subscription object there will be a pending_setup_intent if needed.
Okay thank you, I'll try it then ๐
Thanks you, it seems it's working ๐ It's a bit confusing, I need to test it but sounds like a solution
just to confirm, if we have initial payment but we offer a discout, e.g. recurring payment is 500 gbp but initial payment we need is 400 so I am also making a "coupon"?
Yes in this case you would make a 100gbp off coupon for the first month.