#garethdmm - Connect + Subscriptions
1 messages ยท Page 1 of 1 (latest)
Background: we're a platform, we're trying to allow our customers to set up subscriptions with their end-users. We're using connect and subscriptions to do this. One of our requirements is that we'd like the stripe fees to be paid by our platform, so we're using destination charges for the subscriptions. Problem is, this makes the subscriptions appear to come from us (the platform), and not our customer.
I found that for normal invoices, this can be solve by setting the on_behalf_of field in the invoice object. This field normally isn't available for subscriptions, but we've been whitelisted into the stripe beta that allows this.
However, now I'm getting confusing errors when I set the on_behalf_of field for subscriptions with destination charges
e.g. "> (node:37395) UnhandledPromiseRejectionWarning: Error: When using any payment method types other than card and card_present, you cannot specify an on_behalf_of value, settlement of charges must be performed in the country of the platform account. Settling charges in the country of the destination account is ONLY supported with card and card_present types."
Sorry for the wall of text!
Gotcha, what call are you getting that error on?
stripe.subscriptions.create()
Do you have a request ID from a time you got that error (req_123)?
I'm sure I can find one
What's the easiest way to get a request id?
Maybe this? req_QXkLWuEhGAsCqN
Looks good to me thank you.
And to be clear, this exact code was working before?
It might be because the payment types are being automatically generated by Stripe and they specify payment types other than card and card present.
Checking further in to that. Can you try your request again but explicitly set payment_settings.payment_method_types to be a list that only contains card? https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-payment_method_types
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
This code works when I remove the on_behalf_of parameter
Gotcha, thank you. Just making sure we didn't break working code out from under you
Same result, oddly enough: req_W8vNaPkXuHThyD
Interesting. Checking where that error may be coming from
This part of the error seems like its telling us something but I don't understand it:
"settlement of charges must be performed in the country of the platform account. Settling charges in the country of the destination account is ONLY supported with card and card_present types."
We're only trying to charge US customers. Maybe there's a legal reason why this is being disabled
I am unsure, still looking in to this. It looks like the platform and connected account are in the samr country right?
Yeah they should be the same country
We don't have any users outside the US
I know, this is a tricky one eh?
Yeah, because of this whitelisted feature, it may be better to write in to our support to get routed to the team that deals with it. I am going to reach out to some colleagues to see if they have ideas on how to set this up properly
Ok, I'll reach out to our support person as well. Please let me know if any of your colleagues have thoughts too!
It's also possible there's different way to achieve the same goal: subscription/recurring invoices for a connected account where the stripe fees post to the platform account.
I am unsure if we have something for that for subscriptions at the moment but will check with my colleagues as well
So one thing we noticed is that the customer that the subscription was created for has a default payment method that is ACH. Can you retry this on a customer with a card?
Or by specifying the default payment method directly on the subscription?
Sure
Is there a way to change default payment method through the dashboard, or do I do that through another API call?
Yes, you can change it on the Customer's page in the dashboard
It actually might be easiest to just set payment_method: "pm_card_visa" on your Subscription creation call to quickly test this
trying that
is pm_card_visa a testing constant?
I think I'm not getting this right
Yes, it is a test constant that you should be able to just pass in. If that isn't working, it may be best to try changing it manually in the dashboard
Unfortunately this feature can be touchy. If this test doesn't help, I think it would be best to write in to our support with this question https://support.stripe.com/?contact=true so that they can direct you to the team that is in charge of this feature, they will have better context on how to use it than I do.
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Sorry for the delay, I figured out how to change it in the dashboard
At least we got a new error this time! > (node:40479) UnhandledPromiseRejectionWarning: ReferenceError: sent_invoice is not defined
Very interesting though, this response in my console returns an error, but shows up as a 200 in the dashboard: req_12V3FTIiqzZNqg
Interesting, do you have a stack trace for that error? Is it happening somewhere in the Stripe library or your code?
Definitely in the stripe library
Oh wait, nope, I lied
Oh wow this actually is successfully creating a subscription now, that's progress!
Ok, so what we learned is on_behalf_of is touchy with subscriptions in general, and specifically will fail if the customer's default payment method is set to ACH (or potentially, anything other than card)
Ok, I'm going to keep playing with this to understand it better, but thanks so much for helping me over that hurdle ๐