#abhishek06879

1 messages ยท Page 1 of 1 (latest)

lament depotBOT
cinder hound
#

๐Ÿ‘‹ happy to help

#

would you mind sharing the request ID?

spiral mason
#

let me check

#

I don't have access to my client's Stripe dashboard So I can't able to send you the request ID

#

My client only given me the Secret keys to integrate

#

I'm creating checkout session in Stripe

cinder hound
#

in the headers of the response you can see the request ID as well

spiral mason
#

I'm not using the Stripe API directly I'm just using a npm library for Stripe in NestJS

cinder hound
#

even though, you can always have access to that information

#

check the headers tab

spiral mason
#

I got the request ID - req_oy5UZb158tL0Yg

cinder hound
#

ok so you're creating a Checkout Session while also using

    application_fee_amount: "..",
  },```
#

but you're creating it on your own account

#

so what application_fee_amount are you trying to set?

spiral mason
#

I'm trying to set application_fee_amount: 50

cinder hound
#

to what exactly?

#

you're not doing a Destination or a Direct charge

spiral mason
#

I want to do Direct charge

#

In the test mode it's not complaining me about the Direct or Destination charge

#

but in live it's happening

cinder hound
#

if you don't use the Stripe-Account header with the connected account ID then it won't be a Direct Charge anymore

lament depotBOT
spiral mason
#

So what parameter am I missing to create a direct charge?

#

I'm sending these paramter on creating a checkout session {
cancel_url: 'http://localhost:4200/account/cart',
success_url: 'http://localhost:4200/account/shows?session_id={CHECKOUT_SESSION_ID}',
mode: 'payment',
customer_email: 'user@company.com',
payment_intent_data: { application_fee_amount: 50, receipt_email: 'user@company.com' },
payment_method_types: [ 'card' ],
line_items: [
{ quantity: 1, price_data: [Object] },
{ quantity: 1, price_data: [Object] },
{ quantity: 1, price_data: [Object] },
{ quantity: 1, price_data: [Object] }
]
}

spiral mason
#

I'm also sending the same parameters then why it is saying 400 Bad Request

west viper
#

please share the exact backend code you are using to call the API, and the req_xxx request ID from the failed API request.

spiral mason
#

This is the backend code. It's implemented in NestJS backend

west viper
#

I suggest you add logs and confirm that producer.stripeAccountID is not null or undefined.

I suggest making sure the file has been saved and the changes deployed/running on your server.

#

if you're having trouble, share the req_xxx request ID from the failed API request so I can see what you're trying to do.

spiral mason
#

Yeah this is request ID - req_ZVysx0b8mMCn9C

spiral mason
west viper
#

the ID you're passing is wrong.

#

you're passing the ID of your platform account acct_1LAbxlR2tXILb02y. You should be passing the ID of the connected account that you are processing the Direct Charge with and taking the fee from. Please check the docs in detail.

#

alternatively, you are using the secret key of the connected account to initialise the stripe object. Either way, that's wrong.
The way Direct Charges work is you use the secret key of your platform account, and pass Stripe-Account as the ID of a specific connected account.