#sarox85
1 messages · Page 1 of 1 (latest)
Yes, you can call that method on a connected account
Are you asking about how to do this with Stripe.js or one of our server-side libraries?
sorry I don't use ofter JS....
i use this call stripe.createPaymentMethod({
stripe.createPaymentMethod({
type: 'card',
card: card,
}).then(function(result) {
and if save data in my account work
now I need add connectid
to sava data in subaccount
Is this code for your client or server?
Thank you. To make a Stripe.js call as a connected account, you can specify the account's ID when initializing stripe on your page https://stripe.com/docs/js/initializing#init_stripe_js-options-stripeAccount
var stripe = Stripe('pk_test_1234', {stripeAccount: 'acct_5678'});
Do I need insert it in my call JS?
stripe.createPaymentMethod({ ....
stripe.createPaymentMethod({
type: 'card',
card: card,
}, {stripeAccount: 'acct_...})
No, just in the initialization of Stripe.js
And that setting will be used for all future calls on the page
but i use just <script src="https://js.stripe.com/v3/"></script>
oh ok
jsut secodn
Ok good, and don't I need to use it again in the code? Stripe know that createPaymentMethod will be to a account connect?
Correct, just set it once and it will be good for the rest of the calls on that page
can I see PaymentMethod in account connect in test mode?
Yes
Using this method, the PaymentMethod will exist on the connected account. So you need to use the connect dashboard or make the API call as that account to see it
hello, I receive "No such PaymentMethod: 'pm_1NBK8kQX7XQod2G2jlAUE5UG'"
But why is PaymentMethod in account connect o or not in account connect?
👋
Looks like that PaymentMethod is on your Connected Account
Are you passing the Connected Account header to access it?
Can you tell me more about what you are trying to do?
I can't do anything with just a bunch of code.
Please explain what you are trying to do and I'd be happy to unblock any questions you have.
ok resume my propblme
I have a code to save payment data for charging after
and it worke fine
now I need save payment data in account connect
Okay so you are charging on your platform but want to save a PaymentMethod to your Connected Account?
there are 4 moments:
create PaymentMethod by client (JS)
create Customer by server
link PaymentMethod by server
default_payment_method for Customer by server
Okay and which step are you running into an issue?
create PaymentMethod by client (JS)
I need add connectID
stripe.createPaymentMethod({
type: 'card',
card: card,
})
i make this call
Okay so server-side you need to pass the Stripe Account Header like we show in: https://stripe.com/docs/connect/authentication
You would do that when you create the Customer and attach the PaymentMethod to the Customer
in this moment no problem
create Customer by server
link PaymentMethod by server
default_payment_method for Customer by server
but here : create PaymentMethod by client (JS)
where I need to add acc_...
Well that all depends on what step is failing. Can you provide a request ID associated with the "No such PaymentMethod" error you are seeing?
It should look like req_xxxxx
Okay it sounds like you are retrieving the PaymentMethod sever-side, yes? When you do that you need the Stripe Account header.
So when you call https://stripe.com/docs/api/payment_methods/retrieve?lang=php
ok yhanks