#Senthil-charge-usage
1 messages · Page 1 of 1 (latest)
Can you explain your use case here a bit more?
What usage are you monitoring and how would you like to charge it?
For a payment they get 10 service calls. Once they use that up, they will be automatically replenished when they make the next one.
So you can save the card details and specify that they will be used off session in future, then when you determine their calls need to be replenished, you can make another charge https://stripe.com/docs/payments/save-and-reuse
The first time I want to save and get payment in one go. Is that possible?
Because when I use the "setup" as mode, it won't let me specify the price. So I need to set mode as payment, specify the price and get the payment done. Then I also want the card saved at the same time to use later.
Yes, specify setup_future_usage to off_session https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage
And when you create the off session payments later, set off_session to true to indicate that the customer is not present https://stripe.com/docs/api/payment_intents/create#create_payment_intent-off_session
The customer is present on initial payment though
And I do anyway need to create a checkout session to get the payment info right?
On the initial payment I was only saying to set setup_future_usage
setup_future_usage: off_session on the initial payment. This will mean the user is currently present but you plan to charge in future when they are not present
and then off_session: true on subsequent payments (if the user is not present, if they are you do not need to specify that)
I assume I need to start off with "checkout session" right? This is where the customer gets to enter payment details. And then the system generates payment intent. In this case I am not doing the "Create a PaymentIntent" as the system generates it
Then you can set it via the payment_intent_data.setup_future_usage parameter https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage