#keremkusmezer-connect
1 messages · Page 1 of 1 (latest)
@inner path you created the PaymentMethod on the platform, so it can't be used on the connected account. There's two options:
- create the PaymentMethod on the connected account by changing stripe.js (assuming you use Elements to collect the card details) so when the customer enters their card, it's created there : https://stripe.com/docs/connect/authentication#adding-the-connected-account-id-to-a-client-side-application
- clone the PaymentMethod from the platform to a Customer on the connected account first : https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods
should i use const paymentMethod = await stripe.paymentMethods.create({
customer: '{{CUSTOMER_ID}}',
payment_method: '{{PAYMENT_METHOD_ID}}',
}, {
stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
});
so it can be used by the connected account as well?
so then after i should use this cloned method for payment instead?
that is the second option I mentioned yes!
so then after i should use this cloned method for payment instead?
yes, it will return a differentpm_xxxID for the cloned method, and that's the one you'd use
ok one more question, should i copy or add the target customer to the connected account as well?
i am using ios sdk in between and creating pyment intents on the server side
you can't copy the platform customer, you have to create a new customer on the connected account (using stripe.customers.create({...}, {stripeAccount:"acct_xxx"}) as well) if you want to attach the cloned payment method to that
fair warning, this is going to be extremely complicated 😦
yes and shame on multipart payment document noting about is requirements is mentioned
const paymentIntent = await stripe.paymentIntents.create({
payment_method_types: ['card'],
amount: 1000,
currency: 'gbp',
application_fee_amount: 123,
transfer_data: {
destination: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
},
});
vs
// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
const stripe = require('stripe')('sk_test_51Is61QHGO2r4YdVfW2...AAmj6jSES009UlurH3J''sk_test_51Is61QHGO2r4YdVfW2ANTbO9H2zAFu4Dk8IvtRIsyOrdtMqai0zQAIBwK8GjPyYO5hw2kS1CkaKqN4qAAmj6jSES009UlurH3J');
const paymentIntent = await stripe.paymentIntents.create({
payment_method_types: ['card'],
amount: 1000,
currency: 'gbp',
application_fee_amount: 123,
}, {
stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
});
i am trying to establish this scenario
Enable other businesses to accept payments directly
so for each business i have to recreate the scenario in that case if i want to use this?
this is to complicated
then i am just acting on behalf of them right?
what is "the scenario" you would recreate? but yes to create a payment on a connected account(a Direct Charge, like your second example), the payment objects like the PaymentMethod/Customer need to exist on the connected account, so either create them all there from the start(using the StripeAccount option everywhere in the front and backend), or set up a more complicated configuration where you copy information from your platform down to the connected account.
well the point is my scenario is a marketplace
i have lot of different sellers and customers are created on my platform account first
then i made the payment on behalf of them, then the ios sdk should have 2 instances which one of them is using the connected account connection to confirm the paymentintent?
or i can use the first option and the stripe fee goes over my account right?
if you're going to go with the "cloning" model then indeed, it helps to have two instances of STPAPIClient in your app, one that works with objects on the platform (like PaymentMethods) and one that sets stripeAccount and works with connected accounts(like confirming PaymentIntents)
if you use Destination Charges(the first snippet you posted, that uses transfer_data ) then yes, your platform pays the fee and all the payment objects just live on your account.