#disha
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
Do you want to calculate tax during the payment method collection or during charge?
payment collection
so basically, we are providing EV charging service
once the customer has charged the EV, we know how much is the amount billable
Yes, automatic tax works with Invoices, however you will need to collect additional information to calculate the tax, like address. This will require the invoice to be sent to the customer.
yes, right upon first time login, we will capture user's address details, so we will have that info
So, in our case, if we go with invoice option, how should capture the user's card info?
Would that still be via 'Set up intent'? Will that intent be connected to and auto collection Invoice?
You can see here how to use Tax with Invoices: https://stripe.com/docs/tax/invoicing?dashboard-or-api=api#enable
You can use Setup Intent to get the credit card info. Then you will need to update the customer record to set the new Payment Method as default for the customer: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
You can as well use Stripe Checkout with mode setup: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-mode
Ok, so here is my understanding
I will collect customer's address info upon login
then I will create set up intent (to capture card details and associate it with customer object)
then once service is availed and amount is finalized, I will create a product and a price and generate Invoice with 'auto collection' set to true
that way, the customer will get automatically charged on the provided card
is that accurate?
Yes, sounds good.
You can add invoice items with just amount and currency, no need to create products and prices: https://stripe.com/docs/api/invoiceitems/object#invoiceitem_object-amount
Happy to help. Let me know if you have any other questions.
How will we get to know whether automatic collection of invoice succeeded or not?
and what is the actual amount received?
An invoice.paid webhook event will be sent when it happens: https://stripe.com/docs/api/events/types#event_types-invoice.paid