#drewbie-doobie_api

1 messages ยท Page 1 of 1 (latest)

frigid sphinxBOT
#

๐Ÿ‘‹ 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.

hidden depotBOT
earnest dagger
#

Hello

boreal steeple
#

Hello

earnest dagger
#

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'",

boreal steeple
#

hold please ๐Ÿ™‚

#

Ok, when I pass the pi_* same result

earnest dagger
#

Can you share that request ID?

boreal steeple
#
earnest dagger
#

Those requests were made on your platform. Can you show me your code? Passing the Stripe Account header works for almost any endpoint

boreal steeple
#

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.

earnest dagger
#

Can you clear your cache and save that code again and run it again and provide me the resulting request ID?

boreal steeple
#

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.

earnest dagger
#

Thanks one min

boreal steeple
#

No worries, take your time.

hidden depotBOT
shy plover
#

Can you add an empty object parameter and see if that fixes it?

  'pi_3P8PA8BCzm3EZpDB1rM5vEFE', 
  {},
  {
    stripe_account: 'acct_1P6DAMBCzm3EZpDB'
  }
)```
boreal steeple
#

Tried that too. No bueno

#

hah!

#

jk

#

it worked ๐Ÿ™‚

#

I had tried that when I accidentally put the payme method in there

#

alright, coolies. thank you so much

#

I think maybe adding an options block somewhere in the api docs would be good here