tansengming / stripe-rails

A Rails Engine for integrating with Stripe
MIT License
753 stars 123 forks source link

Feature - support name attribute in coupons #207

Closed ZilvinasKucinskas closed 3 years ago

ZilvinasKucinskas commented 3 years ago

Stripe has an optional name parameter while creating coupons. From documentation:

Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the id is shown if name is not set.

I would like a prettier name such as 20% off, forever to appear in invoices and receipts and I cannot do it with the id only.

I would appreciate a review and a new release. 🤗

I have updated tests to include this extra attribute. I have also tested by creating some coupons in test Stripe environment with and without name parameters by using gem "stripe-rails", git: "https://github.com/ZilvinasKucinskas/stripe-rails.git", branch: "feature/support-name-in-coupons" in the Gemfile. It works.

tansengming commented 3 years ago

This looks good, thanks for the pull request!