#usama_sa
1 messages ยท Page 1 of 1 (latest)
So if you pay the invoice via the api then it will charge the default payment method set here: https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
As far as how to handle the outcome, I would listen to webhooks (invoice.paid and invoice.payment_failed)
Yes, I'm listening to the webhooks. I have also checked the documentation you shared. Let me clear what I'm confused on in next message
So we have sellers onboard their stripe account with our main connect account to receive payment for their order. Now when we want to send them an invoice we are adding that seller as a customer for our main account using the primary email id they provided us.
Now my confusion is on the point that if customer had used a different email for their stripe account that means for stripe that user needs to create an account (correct me if I'm wrong). So in those cases how will stripe charge the customer right away?
Also please clear this other thing as well, when a stripe user onboard their stripe account to our platform account on stripe, don't they get registered as a customer for our main account by default?
Can you clarify this? I don't understand fully.
Also please clear this other thing as well, when a stripe user onboard their stripe account to our platform account on stripe, don't they get registered as a customer for our main account by default?
No this doesn't happen by default. Customers and Accounts are completely separate concepts and the two are not related in any way.
You'd need to explicitly create customers to charge them
Can you clarify this? I don't understand fully.
yes sure, let me make it more clear, although I doubt I'll be able to ๐
Lets say I added a customer to stripe using api and then sent them an invoice and set it to be charged "charge_automatically", how does it gets charged automatically if that customer does not have added any default payment method or if they don't have an account with stripe?
As I'm not setting any default payment method for the customer when adding them
Ah in that case payment would fail
They'd need a card set as default for that payment you trigger to succeed automatically
So in that case the best way is to use the same email for customer creation that they used while creating their stripe account, as that would rule out the possibility of default payment method being not added?
No since customer and stripe account are separate concepts entirely we wouldn't charge anything on the connect account
Also if payment fails or no payment method is added for customer does stripe inform customer to add the payment method for payment and how can I sent retires for the payment on invoice?
Invoice payment associated with the customer only looks at default payment method on the customer
No we wouldn't
You'd need to email the customer or notify them somehow
Ok, So that means no email or alert is sent from your end to the invoiced customer when invoice is generated
And I can send the email to client letting them know to pay the invoice with the payment url that I get on invoice generation for payment
If you're going to do that, I'd do send_invoice instead of charge_automatically
So that we email them the invoice on the stripe-side
for collection_method
Great, let me check that as well
And once the customer pays using their preferred payment method then after that we can use the charge_automatically as stripe will have their default method info then or its best to stick with send invoice for safety?
Yeah it's up to you, but you could do either
Also I don't think default payment method is set automatically after customer pays invoice, but not 100% sure on that. Recommend you test it out
I think you may have to update the customer manually to set the invoice_settings.default_payment_method
Ok sure, thank you for all the help on this matter