#masudrhossain
1 messages · Page 1 of 1 (latest)
Do you have a request ID for the request you're making?
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 site 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.
I'm doing this below
@product = Stripe::Product.create({
name: @service.title,
active: true,
})
Stripe::Price.create({
unit_amount: (price[:unit_amount].to_i * 100).round,
currency: params[:currency] || @organization.stripe_account.stripe_account_data["default_currency"],
recurring: {
interval: price[:recurring][:interval]
},
product: @product.id,
metadata: {
trial_period_days: price[:trial].to_i
},
active: true
})
But it seems like stripes product id isn't being valid if i do it one aftr the other quickly.
req_8wnYWtU14EQYcy
You're making the request on this account --> acct_1JelkhKfpKuAV5N2
But the Product you're looking for exists on this account --> acct_1MSnC2G02uXfwr5H
Doing this for a connect account.
we set the access_token for the stripe connect account though. And the product gets successfully created on that connect account, so i don't get why it's gonna try to create the price for OUR platform account.
Stripe.api_key = @organization.stripe_account.access_token
Not sure. You would need to dig through your code and add log lines to see why the token appears to be unset at the time of the call. All I can say is that the Connect account's ID is not being included in the API call as of now
Hence the error
can i include the connect account id then?
oh, so thee connect id isn't being included hmm okay
It's a bit odd, but adding this line to each in the array fixes the issue. This issue wasn't happening before, so not sure what happened. I used to jsut leave that line of code at the top of the method and it worked fine.
Before, i just had it at the top. and normally, it SHOULD use this for all stripe requests.
It probably has to do with the scope of the block. Usually, you'd add that once at the top of the page, but I'm not super familiar with scope as it pertains to this language.