Skip to content

wobsoriano/retry-stripe-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

retry-stripe-loader

Stripe.js loadStripe function with retries.

Install

npm install @stripe/stripe-js retry-stripe-loader

Usage

import { loadStripe } from 'retry-stripe-loader'

const stripe = await loadStripe('pk_test_xxx', {
  retryOptions: {
    onFailedAttempt: (error) => {
      console.log(`Attempt ${error.attemptNumber} failed. There are ${error.retriesLeft} retries left.`)
      // 1st request => Attempt 1 failed. There are 4 retries left.
      // 2nd request => Attempt 2 failed. There are 3 retries left.
      // …
    },
    retries: 5
  }
})

License

MIT

About

Stripe.js loadStripe function with retries.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published