Converts a Stripe Coupon to a string that describes the discount.
Converts a Stripe Coupon to a string that describes the discount.
npm install --save stripe-coupon-to-string
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'
MIT © Travis Fischer
Support my OSS work by following me on twitter