#harefx.dev - Connect Accounts Direct Charges

1 messages ยท Page 1 of 1 (latest)

polar wing
#

Hi ๐Ÿ‘‹

#

Okay so you are trying to create a direct charge while specifying the transfer_data attribute, which is used to make destination charges

wraith latch
#

@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 ๐Ÿ™‡

polar wing
#

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.

spark oxide
wraith latch
#

@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

spark oxide
#

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?

wraith latch
#

when I tried to get to the url above, this page showed up

spark oxide
#

Are you looking at your platform account?

#

That's where this request exists.

wraith latch
#

I'm logging in my developer account, so do you mean the account that invited me as a developer, right?

spark oxide
#

The account that matches the API key you're making this request with.

wraith latch
#

@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')
spark oxide
#

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.

wraith latch
#

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'
})
spark oxide
#

So when you run that code what's the associated request ID?

wraith latch
#

@spark oxide let me send a new request and I'll get you the request ID

#

hmm

#

that seems working now with the direct charge

#

I'll try with the destination charge as well ๐Ÿ™‡