New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

stripe-utils

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stripe-utils

utility functions for stripe

latest
Source
npmnpm
Version
2.0.2
Version published
Maintainers
1
Created
Source

Stripe utilities

Utilify functions to develop Stripe integration scrips in Node.js

Requirement

You should use Node8.10.0 or later

subscriptions

RenewalReminder

Get list subscriptions that the remain date is less than X day.

const { RenewalReminder } = require('stripe-utils')
const stripe = require("stripe")(
    "sk_test_XXXXXXXX"
)
const exec = async () => {
    const targetDate = 30
    const worker = new RenewalReminder(stripe)
    const subscriptions = await worker.getNotificationTargetSubscription(targetDate)
    subscriptions.forEach(subscription => {
      console.log(subscription.id)
    })
    console.log('Amount: %j', subscriptions.length)
}
exec()

Charge

GetDeclineCode

Get declines description and next steps bt decline_code Ref: https://stripe.com/docs/declines/codes

const { getDeclineDescription } = require('stripe-utils')
const { code } = getDeclineDescription("try_again_later")
console.log(code)

{
    "description": "The card has been declined for an unknown reason.", 
    "nextSteps": "Ask the customer to attempt the payment again. If subsequent payments are declined, the customer should contact their card issuer for more information."
}

Contributors

  • emaildano

Keywords

stripe

FAQs

Package last updated on 03 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts