#sarox85

1 messages · Page 1 of 1 (latest)

subtle cometBOT
low bear
#

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?

dawn granite
#

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

low bear
#

Is this code for your client or server?

dawn granite
#

client

#

I prefer not have data of credsit card in my server

#

run*

low bear
#

var stripe = Stripe('pk_test_1234', {stripeAccount: 'acct_5678'});

dawn granite
#

Do I need insert it in my call JS?

#

stripe.createPaymentMethod({ ....

#

stripe.createPaymentMethod({
type: 'card',
card: card,
}, {stripeAccount: 'acct_...})

low bear
#

No, just in the initialization of Stripe.js

#

And that setting will be used for all future calls on the page

dawn granite
#

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?

low bear
#

Correct, just set it once and it will be good for the rest of the calls on that page

dawn granite
#

can I see PaymentMethod in account connect in test mode?

low bear
#

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

subtle cometBOT
subtle cometBOT
dawn granite
#

hello, I receive "No such PaymentMethod: 'pm_1NBK8kQX7XQod2G2jlAUE5UG'"

#

But why is PaymentMethod in account connect o or not in account connect?

subtle wagon
#

👋

#

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?

dawn granite
subtle wagon
#

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.

dawn granite
#

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

subtle wagon
#

Okay so you are charging on your platform but want to save a PaymentMethod to your Connected Account?

dawn granite
#

there are 4 moments:

create PaymentMethod by client (JS)
create Customer by server
link PaymentMethod by server
default_payment_method for Customer by server

subtle wagon
#

Okay and which step are you running into an issue?

dawn granite
#

create PaymentMethod by client (JS)

#

I need add connectID

#

stripe.createPaymentMethod({
type: 'card',
card: card,
})

#

i make this call

subtle wagon
#

You would do that when you create the Customer and attach the PaymentMethod to the Customer

dawn granite
#

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_...

subtle wagon
#

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

dawn granite
#

No such PaymentMethod" yes

subtle wagon
#

Okay it sounds like you are retrieving the PaymentMethod sever-side, yes? When you do that you need the Stripe Account header.

dawn granite
#

ok yhanks