#sebastian-flow_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1350191674881474696
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello. What's your question?
Hello, I am trying to get my payment intent secret. What I am trying to do is only collect fees for a transaction. The funds must go the connected account selling the service using my platform. I am submitting the amount, currencyCode, customerID, fee_amount, and connected account ID to a lambda function to obtain the intent secret but I am getting this error. Can only apply an application_fee_amount when the PaymentIntent is attempting a direct payment (using an OAuth key or Stripe-Account header) or destination payment (using transfer_data[destination]
Yep, I believe the error is pretty clear on what needs to be done here [0]
When creating charges with an
application_fee_amount, the full charge amount is immediately transferred from the platform to thetransfer_data[destination]account after the charge is captured. Theapplication_fee_amount(capped at the full amount of the charge) is then transferred back to the platform.
[0] https://docs.stripe.com/connect/destination-charges?platform=react-native#collect-fees
This is my code on the lambda function.
const paymentIntent = await stripe.paymentIntents.create(
{
amount,
currency,
customer,
automatic_payment_methods: {
enabled: true,
},
application_fee_amount: Math.round(amount * 0.1),
},
{
stripeAccount: stripeConnectedAccountId,
}
);
I am getting this error.
{
"result": "error",
"message": "Can only apply an application_fee_amount when the PaymentIntent is attempting a direct payment (using an OAuth key or Stripe-Account header) or destination payment (using transfer_data[destination])."
}
When I add the transfer data destination, like this.
const paymentIntent = await stripe.paymentIntents.create(
{
amount,
currency,
customer,
automatic_payment_methods: {
enabled: true,
},
application_fee_amount: Math.round(amount * 0.1),
transfer_data: {
destination: stripeConnectedAccountId,
,
}
);
I get the same error.