#ferreirA
1 messages · Page 1 of 1 (latest)
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
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
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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'}
)
Whoops my syntax is off. I think you need to use something like this:
'pi_3LwzBtHuKaBzlxWh1tFVx0n3',
{cancelation_reason: 'duplicate'}
);```
Glad that worked!
Also quick question: how do you get syntax highlighting on your code blocks here?
We do show that syntax for other calls https://stripe.com/docs/api/payment_intents/update
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
you use ```
and then
the lang syntax
like ```js codehere
I didnt notice
I was lost xd