#drewbie-doobie_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/1231990095591116830
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
Hello
I think you are confused -- this definitely does work, but if you look at the request you made you passed the PaymentMethod ID instead of the PaymentIntent ID in your path
Which is why you got the error: message: "No such payment_intent: 'pm_1P8Ok2GdIyY4D0x4zlDAFdyc'",
Can you share that request ID?
https://dashboard.stripe.com/test/logs/req_zxkacsSHezg1ka?t=1713800050
https://dashboard.stripe.com/test/logs/req_p8J6g1CpBp3qk4?t=1713800030
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Those requests were made on your platform. Can you show me your code? Passing the Stripe Account header works for almost any endpoint
Sure, I am using the ruby Stripe gem.
Stripe::PaymentIntent.cancel('pi_3P8Os2GdIyY4D0x41OuNtDns', { stripe_account: 'acct_1MBgaiGdIyY4D0x4' })
I ran this via the console, was just testing using the Stripe ruby SDK
No custom code is used.
Can you clear your cache and save that code again and run it again and provide me the resulting request ID?
sure thing
I'll send you a summary of all the commands I run in progression.
# Customer
# cus_PyLhJRce65IEy0
Stripe::Customer.create(
{
description: 'Customer payment',
email: 'drew@selfbook.com',
name: 'Drew Ruppel'
},
{ stripe_account: 'acct_1MBgaiGdIyY4D0x4' }
)
# PaymentMethod
# pm_1P8P0vGdIyY4D0x4qFh9BgZQ
Stripe::PaymentMethod.create(
{
type: 'card',
card: {
number: '4242424242424242',
exp_month: 1,
exp_year: 2026,
cvc: '314',
}
},
{ stripe_account: 'acct_1MBgaiGdIyY4D0x4' }
)
# Attach Payment Method -> Customer
Stripe::PaymentMethod.attach(
'pm_1P8P0vGdIyY4D0x4qFh9BgZQ',
{
customer: 'cus_PyLhJRce65IEy0'
},
{ stripe_account: 'acct_1MBgaiGdIyY4D0x4' }
)
# Create Payment Intent
Stripe::PaymentIntent.create(
{
amount: 100,
confirm: true,
capture_method: 'manual',
currency: 'USD',
customer: 'cus_PyLhJRce65IEy0',
expand: ['payment_method'],
metadata: {},
payment_method: 'pm_1P8P0vGdIyY4D0x4qFh9BgZQ',
payment_method_types: ['card'],
statement_descriptor_suffix: 'zz'
},
{ stripe_account: 'acct_1MBgaiGdIyY4D0x4' }
)
# Cancel Payment Intent
Stripe::PaymentIntent.cancel(
'pi_3P8P38GdIyY4D0x40dcC9AdJ',
{ stripe_account: 'acct_1MBgaiGdIyY4D0x4' }
)
Let me know if there's anything else you need.
Thanks one min
No worries, take your time.
Can you add an empty object parameter and see if that fixes it?
'pi_3P8PA8BCzm3EZpDB1rM5vEFE',
{},
{
stripe_account: 'acct_1P6DAMBCzm3EZpDB'
}
)```