0.1.2 • Published 4 years ago

stripe-coupon-to-string v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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