#RGRTHAT
1 messages · Page 1 of 1 (latest)
Hi there
You need to use the Stripe Account header. See: https://stripe.com/docs/connect/authentication
Assuming you mean "Connected Account" when you say "connected"?
Im trying to check if a payment method already exist for a certain connected customer based on their id
const connected_customer_payment_methods = await stripe.customers.listPaymentMethods(
connected_customer_id,
{ type: "card" },
{ stripeAccount }
);
this doesnt seem to work
Should be const connected_customer_payment_methods = await stripe.customers.listPaymentMethods( connected_customer_id, { type: "card", stripeAccount } );
nope this is worng
I even get error this time ```js
(node:47236) Stripe: Options found in arguments (stripeAccount). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options.
(node:47236) Stripe: Invalid options found (type); ignoring.
Err doh
You had it right the first time
What is happening with your original syntax?
Have you logged out your variables?
if i want to clone a payment method, is it like so: ```js
const connected_payment_method = await stripe.paymentMethods.create(
{
customer: platform_customer_id,
payment_method: platform_payment_method_id,
},
{
stripeAccount: connected_account_id,
}
);
@dense orchid is it the connected customer id, or platform customer id
when u want to add a payment method to the connect customer
Platform Customer ID when you clone
So what you have looks good
Then did you attach the new PaymentMethod to a Customer on the Connected Account?
but i need to attach the payment method to the connected customer i just created
how do i do that, thats what im trying to do
cuz i have a conditional code over this, that check for payment method for the specific connected customer, so i dont clone the payment method multiple times
i have created the payment method now for connected account, but i need to attach the payment method to the customer
You create a Customer on the Connected Account and then you attach it (using https://stripe.com/docs/api/payment_methods/attach)
I just add the payment method that i just cloned to the payment intent? u dont attach the newly cloned payment intent to the actual customer
You can also attach it when you charge it if you are charging it immediately
If you use that PaymentMethod with a PaymentIntent and use setup_future_usage and pass a Customer ID then the PaymentMethod will automatically be attached to that Customer on successful payment