#harefx.dev - Connect Accounts Direct Charges
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Okay so you are trying to create a direct charge while specifying the transfer_data attribute, which is used to make destination charges
Take a look here:
https://stripe.com/docs/connect/direct-charges
The syntax shown above more closely resembles how destination charges are created.
https://stripe.com/docs/connect/destination-charges
@polar wing I'm trying this syntax to make direct charge
payment_intent = Stripe::PaymentIntent.create({
payment_method_types: ['card'],
amount: 1000,
currency: 'sgd',
application_fee_amount: 123,
}, stripe_account: '{{CONNECTED_STRIPE_ACCOUNT_ID}}')
but I don't know why I still get the same error ๐
Can you log out the value of {{CONNECTED_STIRPE_ACCOUNT_ID}}?
Okay @wraith latch I need to step away but my esteemed colleague @spark oxide will be able to answer your questions.
Hello! Can you provide the request ID showing the error you're getting? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
@spark oxide hello Rubeus. Sorry because that request failed so I don't see anything in the Developers > Logs ๐
but here is the CONNECTED_STRIPE_ACCOUNT_ID: acct_1KHcq4BxoFZTAU4o
I think this is the latest request: https://dashboard.stripe.com/test/logs/req_3LCl5FetcYikXG
Can you see that in your Dashboard?
The error message is accurate, you're not specifying anything that would allow you to set an application fee. Are you sure the code you shared above is making that request?
when I tried to get to the url above, this page showed up
I'm logging in my developer account, so do you mean the account that invited me as a developer, right?
The account that matches the API key you're making this request with.
@spark oxide I checked the document that Snufkin sent me, so is this the correct params for direct charge with application_fee_amount?
payment_intent = Stripe::PaymentIntent.create({
payment_method_types: ['card'],
amount: 1000,
currency: 'sgd',
application_fee_amount: 123,
}, stripe_account: 'acct_1KHcq4BxoFZTAU4o')
That code won't work as-is I don't think. Are you using Ruby?
If so, I believe you need to make the second argument an object as well.
You can't just have the stripe_account stuff hanging out there by itself.
yeah actually I made it a second object in my code, but anw in Ruby, the last hash does not need the {} ๐
in my code it's actually like this
payment_intent = Stripe::PaymentIntent.create({
payment_method_types: ['card'],
amount: 1000,
currency: 'sgd',
application_fee_amount: 123,
},
{
stripe_account: 'acct_1KHcq4BxoFZTAU4o'
})
So when you run that code what's the associated request ID?
You can get the request ID from the code itself if you can't find it in the Dashboard: https://stripe.com/docs/api/request_ids