stripe-coupon-to-string

0.1.2 • Public • Published

stripe-coupon-to-string

Converts a Stripe Coupon to a string that describes the discount.

NPM Build Status JavaScript Style Guide

Install

npm install --save stripe-coupon-to-string

Usage

const stripeCouponToString = require('stripe-coupon-to-string')

const coupon = {
  "id": "25_5OFF",
  "object": "coupon",
  "amount_off": null,
  "created": 1595185912,
  "currency": "usd",
  "duration": "repeating",
  "duration_in_months": 3,
  "livemode": false,
  "max_redemptions": null,
  "metadata": {},
  "name": "25.5% off",
  "percent_off": 25.5,
  "redeem_by": null,
  "times_redeemed": 0,
  "valid": true
}

stripeCouponToString(coupon) // '25.5% off for the first 3 months'

License

MIT © Travis Fischer

Support my OSS work by following me on twitter twitter

Package Sidebar

Install

npm i stripe-coupon-to-string

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

5.93 kB

Total Files

13

Last publish

Collaborators

  • fisch0920