#meisei81-recurring payments
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
if the Subscription API is not accommodating for all of your use cases maybe take a look at Subscription Schedules which might offer you more flexibility in controlling your subscriptions
I think the stripe subscription solution is too heavy. So I want to use some base api to build my recurring billing
it is doable, in the end we use those APIs with the Subscription API, but it would be as if you're reinventing the wheel.
instead of taking this drastic measure let us help you figure out how to use the Subscription API in the best way that suits your need
ok. the upgrade or downgrade subscription is not flexibility to us. because when customer upgrade, we want to make the customer paid extra amount immediately, and when downgrade, we want to refund the rest amount to the customer card immediately and make the customer paid the new plan immediately
Now in the stripe subscription solution, we don't know how the extra amount or rest amount to generate. what's the function to calculate by percent? And in the downgrade, the rest amount is applied to the customer's balance, not the bank card.
we don't know how the extra amount or rest amount to generate
it depends on how you implement your subscription
what do you mean?
I want to create a monthly subscription, and sometimes there is a one time fee with it.
for the one time fee you could use this https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yeah, i've seen the api
so, if I want to build my own recurring billing, the customer, card, charge ,refund apis could help, right? Any other api should I concern? In my recurring billing solution, it would contain pay and refund
It's probably best to use the PaymentIntent instead of card/charge
but you will have to create a scheduler in your solution
it's ok to manage the recurring
so, if I use the PaymentIntent api, it also generate the invoice, right?
I want to offer the invoice to the customer, so that they can check the bill.
in that case you could generate invoices using the Invoice API and use the PaymentIntent on the invoice for the payment
how to combine the invoice and paymentintent?
I mean, if I create an invoice, I should specify the line items. I want to generate invoice simplify.
an invoice would automatically create the underlying PaymentIntent
if it's necessary
you mean after creating the payment intent, the invoice would create automatically?
no the other way around
well..
so, I should create invoice firstly, and then create the invoice items within invoice id, right?
when the invoice would be paid? can it pay automatically?
you could use the guide at https://stripe.com/docs/invoicing/integration . The invoice items are create first, then the invoice is created and charges for those items.
if you create it with collection_method:charge_automatically and auto_advance:true then after an hour after creating it, it will finalise and charge the customer's default payment method if you've set one.
or there are other ways to force the payment immediately if you want(mainly by confirming the PaymentIntent that the Invoice creates).
ok. If I don't need any invoice, and I just want to make the customer pay the recurring billing, using the PaymentIntent api could make the effect?
yep, you can just create PaymentIntents directly to charge the customer on whatever basis you like, if desired.
the payment attempt happens when you "confirm" the PaymentIntent, which can be done in a separate API call or by passing confirm:true on creation. Maybe reading https://stripe.com/docs/payments/save-during-payment-cards-only?platform=web#web-create-payment-intent-off-session would help
ok. can set the payment intent's confirm to be true when create an invoice?
And, if I don't use the stripe subscription's solution, how to make the recurring period advanced?
no, it works the way described earlier, you create the invoice and then either wait for it to get automatically paid, or confirm the PaymentIntent directly.
you write your own code and backend scripts and cron jobs and stuff so you can schedule when you call the payment processing API.
the test clock doesn't work? or it just work for the stripe subscription solution?
it just work for the stripe subscription solution?
yes
test clocks and really anything in the docs underneath the "https://stripe.com/docs/billing/" section is for our Subscriptions/Invoice solutions. If you want to be doing the recurring payments yourself by directly calling the PaymentIntents API, none of that applies to you.
ok
if I want to make the customer pay immediately, I should confirm the payment intent immediatelly after create an invoice, right?
yes