#ferreirA

1 messages · Page 1 of 1 (latest)

kind coyoteBOT
shut blaze
#

hello Pompey

#

thank you for ur time

#

my issue is, the documentation says if I want to cancel a paymentIntent, I can pass a parameter to this req:

const paymentIntent = await stripe.paymentIntents.cancel(
  'pi_3LwzBtHuKaBzlxWh1tFVx0n3'
);```
#

but how come

#

how would that be

empty wharf
#

Hello, looks like you should just be able to pass it like a normal parameter, so:

  'pi_3LwzBtHuKaBzlxWh1tFVx0n3',
  cancelation_reason='duplicate;
);```
https://stripe.com/docs/api/payment_intents/cancel#cancel_payment_intent-cancellation_reason
shut blaze
#

only a comma

#

so theres no need for an object there

#

cause it gives me an error

#

or is it:

.cancel({ intent_id: intent_id, cancelation_reason='duplicate'}
)
empty wharf
#

Whoops my syntax is off. I think you need to use something like this:

  'pi_3LwzBtHuKaBzlxWh1tFVx0n3',
  {cancelation_reason: 'duplicate'}
);```
shut blaze
#

ye looks like it is

#

Thank you

empty wharf
#

Glad that worked!

shut blaze
#

maybe the documentation should say that

#

its missing

empty wharf
#

Also quick question: how do you get syntax highlighting on your code blocks here?

shut blaze
#

you use ```

#

and then

#

the lang syntax

#

like ```js codehere

#

I didnt notice

#

I was lost xd

empty wharf
#

I think this is mostly a result of us trying to use as simple an example as possible for the cancel call. Will give feedback that it could be clearer there though

#

And thank you! Very helpful, that will make my messages here look clearer

shut blaze
#

yeah I guess on the post request

#

could be nice

#

having the parameter there

#

ur welcome

#

cya and thanks