Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138134

Stripe: Is it possible to create a direct charge with idempotency

$
0
0

I ma trying to make a direct charge to a stripe connected account and I am able to do it with the following

const charge = {
  amount,
  currency,
  source} ;

return stripe.charges.create(
  charge ,
  {stripe_account: stripeVendorAccount});

Question: is there a way to include an idempotency option to the charge object? If not, what is the best way to avoid duplicate charges?

I tried this but it does not work

const charge = {
  amount,
  currency,
  source} ;

return stripe.charges.create(
  charge ,
  {stripe_account: stripeVendorAccount},
  {idempotency_key });

Viewing all articles
Browse latest Browse all 138134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>