Commit Graph

131 Commits

Author SHA1 Message Date
Blake Erickson e92dd39928
DEV: Add verbose logging site setting (#230)
To aid in debugging I'm adding a verbose logging site setting. I'm
adding this because I'm currently getting some errors in production that
I'm unable to replicate locally.

See: https://meta.discourse.org/t/323450/4
2024-08-27 18:40:12 -06:00
Blake Erickson 3cc113973f
FEATURE: Site Setting to enable automatic tax (#218)
FEATURE: Site Setting to enable automatic tax

There is now a new site setting called
`discourse_subscriptions_enable_automatic_tax` that can be enabled if
you would like to automatically compute tax rates on all new
subscriptions.
2024-07-08 13:22:02 -06:00
Ted Johansson 804f5303f4
FIX: Add missing transaction error translation (#214) 2024-05-24 18:27:00 +08:00
Blake Erickson 45754baa00
FEATURE: Add new stripe based pricing table (#202)
This commit adds an optional new stripe based pricing table.
If the user is logged in, the email field will be prepopulated with the users email.

The pricing table can be configured in the stripe dashboard.

Once the discourse_subscriptions_pricing_table setting is filled with the pricing table embed code from the stripe dashboard,
the pricing table will be displayed on /s/subscriptions

For more details see https://stripe.com/docs/payments/checkout/pricing-table
---------

Co-authored-by: spirobel <spirobel@protonmail.com>
2024-04-29 12:47:58 -06:00
Blake Erickson 9190001a3c
FIX: Translation missing for Norway (#196)
Turns out in YAML `NO` is interpreted as a boolean value, so we need to
wrap it in quotes.
2024-03-27 15:50:15 -06:00
Martin Brennan 3608944b9c
DEV: Change settings root from plugins: to discourse_subscriptions (#182)
This is so the plugins settings are better categorized in the site settings UI.
2023-11-13 10:23:25 +10:00
Kris ac81a7a830
fix typo (#179) 2023-10-24 12:39:32 -04:00
Mark Reeves 49ddc757c9
Make country names translatable (#164) 2023-05-12 08:55:46 -04:00
Mark Reeves 803bba7938
FEATURE: Capture cardholder address fields for Stripe customer (#161)
- Adds the following fields to the subscription payment form:
  - Cardholder Name
  - Country
  - Postal Code
  - Address Line 1
  - City
  - State or Province
- Stripe recommends Cardholder Name & Country for verification; Cardholder Name, Country, and State/Province for US/Canada selections are required fields
- All fields are passed to Stripe for verification on submit
- Fields are also captured on the customer record in Stripe, under Billing Details
2023-05-05 13:20:35 -04:00
Penar Musaraj 550e8347e3
DEV: Refactor bootbox dialogs (#137) 2022-10-17 14:42:40 -04:00
Faizaan Gagan 945af4f140
FIX: Allow user to update card details for recurring subscriptions (#123)
* add new route for card update

* create backend route

* update label

* basic functionality working

* ran rubocop

* added rspec tests for functionality

* make payment_method param compulsory

* fixed js linting

* improve client side error handling

* improve server side error handling

* improved update card page UI

* improve button UI for user subscriptions page

* give feedback to user about save status

* remove heading from last column

* fix padding on edit/delete buttons for update table

Co-authored-by: Blake Erickson <o.blakeerickson@gmail.com>
2022-07-05 19:53:27 -06:00
Jarek Radosz 21d71e09fc
DEV: Fix linting errors (#83)
Template lint errors and broken rubocop linting.
2021-07-04 21:53:55 +02:00
Jordan Vidrine beb73b58f3
FEATURE: Add fireworks + gradient animation to campaign success banner (#77) 2021-06-21 09:01:35 -05:00
Jordan Vidrine 787c5550c6
FEATURE: Add ability to use custom background image (#76)
* FEATURE: Add ability to use custom background image

* Prettier
2021-06-18 10:20:54 -05:00
Justin DiRose 8ab7a63167
FEATURE: Validate coupon codes on form submit (#74) 2021-06-16 12:54:54 -05:00
Jordan Vidrine a4f36e4966
Campaign topic footer (#72)
* UX: Restyle banner, add topic footer functionality, other updates
2021-06-10 16:02:54 -05:00
Justin DiRose f596a0f78a
FEATURE: Campaigns (#67)
Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com>

See https://github.com/discourse/discourse-subscriptions/pull/67 for the full description.
2021-06-02 13:15:03 -05:00
Justin DiRose ab9b81471b
UX: Adjust repurchase styles to look better (#53)
Suggested here: https://meta.discourse.org/t/subscriptions-suggestions-for-interface-improvements/177970

Changes order and alignment so it makes a bit more sense in the UX of the /s route. Otherwise it looks too cluttered. This specifically impacted products that can be repurchased.
2021-02-15 15:17:45 -06:00
Justin DiRose 072b558d40
FEATURE: Give option to repurchase products multiple times (#46)
Feature requested here: https://meta.discourse.org/t/subscriptions-allow-users-to-purchase-one-time-products-multiple-times/173732/

There may be cases where a site admin wants to allow the repurchasing of a product. This implements the functionality by adding a repurchaseable toggle in the admin screen when creating a product. This saves an attribute to the Stripe product metadata.

When a user has already purchased an item with this toggle enabled, they will be able to purchase it again when browsing to `/s`.
2021-01-31 14:17:44 -06:00
Justin DiRose 400313cded
FEATURE: Allow creation of coupons in admin panel (#43)
Adds full support to create coupon/promo codes in the Admin > Plugins > Subscriptions section of the plugin. The Create Coupon button opens a form on the same page, and the active checkboxes toggle the active status of the coupon code.
2021-01-13 11:47:22 -06:00
Justin DiRose da9b58398b
FEATURE: Support for coupons in checkout (#41)
This adds support for Stripe Promo Codes in the user checkout process. 

Also adds a discounted field to User > Billing > Subscriptions to show the amount or percent discounted.

This does not currently add in support for creating promo codes in the Subscriptions interface (that will come at a later point in time). Instead a coupon can be created with a promo code right from the Stripe dashboard.
2021-01-07 15:25:44 -06:00
Justin DiRose b92627677f
FEATURE: Implement refunds from dashboard (#27)
An implementation of refunds from the Admin dashboard. To refund, go to Plugins > Subscriptions > Subscriptions then click the `Cancel` button. You'll be presented with a modal. If you wish to refund only the most recent payment, check the box. 

This only implements refunds for Subscriptions, not One Time Payments. One Time Payments will still need to be handled manually at this time.
2020-10-29 10:31:12 -05:00
Justin DiRose 1ad5b17640
FEATURE: Better UX for anonymous users (#25)
Improves the subscription flow for anonymous users by making the routes available, and showing a login button. Clicking login from this page will save a `destination_url` cookie so that when logging in they're redirected back to the subscription page they were at.
2020-10-28 13:30:26 -05:00
Justin DiRose e13221279d
FIX: Loading state persists after bad card entered (#22)
* FIX: Loading state persists after bad card entered

If a bad card number was entered and the subscribe button clicked, the
subscription button still disappeared and subscribing was not possible
without refreshing the page.

* UX: Add missing tooltip

* DEV: Ignore gems directory for local rubocop runs
2020-10-19 20:54:30 -05:00
Justin DiRose d60c5b6d54
UX: fix incorrect text on cancel button 2020-09-16 09:49:45 -05:00
Justin DiRose bdcaaf9897
UX: i18ninize string 2020-09-16 09:44:44 -05:00
Justin DiRose a868e6b838
FEATURE: Cancel payments at end of subscription vs immediately
Previously, when a user canceled a subscription, the access would revoke
immediately on Discourse vs. at the end of the billing period. This
commit changes the behavior to remove membership at the end of the
billing period using Stripe's `cancel_at_period_end` attribute on the
Subscription object.

This commit now requires the setup of webhooks for subscription
processing to occur correctly.
2020-08-19 14:37:47 -05:00
Justin DiRose 83002fab3c
FEATURE: New styling of product page 2020-07-28 12:46:59 -05:00
Justin DiRose 9e66588038
FIX: Missing translation for daily subscriptions 2020-07-27 10:37:41 -05:00
Justin DiRose 587661fafb
FEATURE: Allow one-time purchases on products (#18)
Building off the foundation of using the Prices API, this PR adds the ability to create a one-time purchase plan for any product, which then can add a user to the specified plan group.

Some things to be aware of:

    One-time purchases cannot have trials.
    One-time purchases use the Invoice API instead of Subscriptions. Invoices are created then charged immediately.
    Users should receive emails for these invoices directly from Stripe just like subscriptions.
2020-07-22 11:06:34 -05:00
Justin DiRose 9c46794e80
DEV: Remove deprecations & improve error handling (#12)
- Replace deprecated methods on client
- Fix broken dropdowns due to select kit 2 upgrade
- Graceful error handling when Stripe keys are not configured but plugin enabled
2020-05-28 10:32:57 -05:00
Rimian Perkins b83da467d0 respond to incomplete payment 2020-01-14 18:46:48 +11:00
Rimian Perkins 0543b3a6a3 basic hook 2020-01-13 11:10:06 +11:00
Rimian Perkins 9176471551 toggle single payments allowed setting 2019-12-17 21:14:13 +11:00
Rimian Perkins 52db93ecd8 user payments page 2019-12-17 16:31:58 +11:00
Rimian Perkins 55f4592033 subscription and billing templates 2019-12-16 10:42:55 +11:00
Rimian Perkins 8264930e92 user activity link to payments 2019-12-13 13:44:25 +11:00
Rimian Perkins 57fb508514 buttons for selecting price and one time payment 2019-12-13 10:41:14 +11:00
Rimian Perkins 831e64317b refactor models, routes and buttons 2019-12-12 12:59:26 +11:00
Rimian Perkins 41b0667350 fix rubocop newer version 2019-12-12 09:59:38 +11:00
Rimian Perkins ff1740d035 validate plan 2019-12-10 10:55:24 +11:00
Rimian Perkins 1c31884475 show the plans in the buttons proper 2019-12-09 12:01:10 +11:00
Rimian Perkins 09bfe419d8 set new product inactive by default 2019-12-05 17:07:26 +11:00
Rimian Perkins 80b721ddd8 rename some settings 2019-12-04 11:53:05 +11:00
Rimian Perkins 21b8340f4f rename the translations 2019-12-04 09:29:13 +11:00
Rimian Perkins 08cbff0c1c change engine mount point and base path in jsapp 2019-12-03 10:29:44 +11:00
Rimian Perkins 382fd4ac41 name space the js admin 2019-12-02 18:58:14 +11:00
Rimian Perkins ca00b530aa show the product name in subscription lists 2019-11-27 10:48:30 +11:00
Rimian Perkins 3e4fd76891 show product and plan nickname in admin 2019-11-26 12:55:49 +11:00
Rimian Perkins 7340bf5bc5 fix customer id not found 2019-11-26 11:09:54 +11:00