#rodrigodietze_26827
1 messages · Page 1 of 1 (latest)
Hello! The Dashboard creates legacy Card objects for backwards compatibility reasons, but we recommend using the Payment Methods API. Can you give me the request ID showing the error? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Sure, one second
Where do I see it? It is not showing anywhere.
The offending call is this:
$stripe->tokens->create(
['customer' => $userid],
['stripe_account' => 'acct_1Nly9KPmKHmVpRqu']
);
But no log about the token creation shows under the customer or the account tab.
You need to view the Dashboard as the connected account, since you're creating the Token on the connected account.
But you shouldn't be using the Tokens API at all.
More info here: https://stripe.com/docs/payments/older-apis
I was using this guide:
It works for cards added with card_ prefix from the dashboard. Not programatically.
That page is out of date, you should clone Payment Methods instead: https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
I am a market place, so i have a global account. All users and payment methods are created under it. Then depending on which store they make a purchase, i make a direct payment on behalf of that account. But I can't use a global customer, it says I need to clone the customer :\
I will give a quick try here cloning only the pm
one sec
If I try using the global customer (pertaining to the platform not the conncted account) I get this error:
No such customer: 'cus_OcvGcnksDqahPc'
The customer belongs to my account not the connected one.
Let's back up a bit.
You're cloning in order to do direct charges on your connected accounts, correct?
Yes, we have 100K app users. They can go to any store in Brazil and make purchases there by scanning a qrcode of the goods... The qrcode gives us the info on what store that good belongs too, and we make a direct charge for that connected account.
But the users are global (cross-store).
So I create them on my platform but at the payment moment we clone them to be used in the conncted account.
Okay, so on your platform you should have a Customer, and that Customer should have a Payment Method attached that's set up for future use. You can then run this code on your platform account to clone the Payment Method to a connected account to use it for a single direct charge: https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
And then you do it again for the next direct charge, and so on.
Let me try quicly one sec
Wow it worked. I had to remove the customer attribute from the paymentintent and only use the cloned payment method
I guess the api realises if there is no customer, the payment method has it embeded perhaps
When you clone a Payment Method to a connected account the clone is an entirely new, separate Payment Method that exists on the connected account and is not associated with any Customer. You can use it for a single payment (recommended) or attach it to a Customer on the connected account to make it reusable (not recommended).
Thank you so much Rubeus! I appreciate it
Happy to help!
Really! Very grateful! Have a good night!