JSPM

stripe-coupon-to-string

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q11035F
  • License MIT

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

Package Exports

  • stripe-coupon-to-string

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stripe-coupon-to-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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