91 Commits

Author SHA1 Message Date
Selase Krakani
2babb43ffb
FEATURE: Skip product listing if only one product is present (#160)
At the moment, paying for a product typically involves first clicking
the subscribe link added to the navigation bar, selecting a product and
then adding card details to to make the purchase.

This change skips the product selection step if the site has only one
product.
2023-05-04 13:52:04 +00:00
Faizaan Gagan
392b88265b
FIX: set Discourse consistent styles on Stripe card element (#124)
* FIX: set Discourse consistent styles on Stripe card element

* use correct placeholder color

* applied prettier

* mock update method for cardElement

* minor formatting
2022-06-24 21:18:38 +05:30
Jarek Radosz
044c18e904
DEV: Fix more imports (#114) 2022-03-07 14:34:05 +01:00
Jarek Radosz
98c843b8f2
DEV: Fix imports (#113) 2022-03-07 00:30:01 +01:00
Jarek Radosz
d6eaba632d
DEV: Lose the es6 suffix (#112) 2022-03-07 00:20:03 +01:00
Justin DiRose
7f84cee940
UX: Improve usability of purchase page (#54)
Commit does 3 things:

    Remove the duplicative currency abbreviation in favor of the currency symbol alone
    Reorders plans by the cost in ascending order.
    Fixes a flexbox button bug
2021-02-16 12:07:53 -06:00
Roman Rizzi
088b8d2239
REFACTOR: Use the new format for acceptance tests. (#37) 2021-01-04 16:32:33 -03: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
a1a7ca98a3
DEV: Fix tests 2020-07-28 15:40:16 -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
c9ff55b46a
REFACTOR: Use the Prices API in place of Plans (#17)
Stripe has a newer API called Prices where you can create a price for any product and it can either be recurring or one-time. The easy part is existing Plans work with the Prices API by passing a Plan ID, but objects are returned in the slightly-different Prices API object format.

This commit is a refactor to the new API to handle the data in its new form, and lays the foundation for a one time payment plan to be added to any subscriptions product.
2020-07-15 08:44:40 -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
Justin DiRose
fb4fac197b
REFACTOR: Use models to store data (#11)
* REFACTOR: Use api to add subscribe link

* FIX: I18n subscribe link

* REFACTOR: Use models to store some data

This enables the plugin to show only subscription information which was
generated on Discourse. Subscription data storage is limited to the
external identifiers Stripe generates so we can interact with the API.

* DEV: Test/linting fixes/rake task
2020-05-22 11:20:05 -05:00
Roman Rizzi
7ba08ab7da
FIX: Discourse.Model was removed. Use EmberObject instead (#10) 2020-05-06 19:06:14 -03:00
Rimian Perkins
ae36c00fc0 test buttons show 2020-01-12 09:08:00 +11:00
Rimian Perkins
9902947e99 a bit more testing 2020-01-10 16:47:28 +11:00
Rimian Perkins
7e2d4595ca test the payment and subscribe page 2020-01-10 14:41:32 +11:00
Rimian Perkins
ba43e9d977 name space tests 2020-01-10 14:24:39 +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
7d3ca0421a rm old donation form 2019-12-16 10:59:59 +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
86bc9bb3e6 rm redundant action 2019-12-10 10:15:30 +11:00
Rimian Perkins
1c31884475 show the plans in the buttons proper 2019-12-09 12:01:10 +11:00
Rimian Perkins
71d6c6dab2 display the plan in the plan buttons 2019-12-09 10:30:34 +11:00
Rimian Perkins
d3eed3546d test button click 2019-12-06 14:33:38 +11:00
Rimian Perkins
2ce314fc8d initial payment buttons component 2019-12-06 13:52:03 +11:00
Rimian Perkins
80b721ddd8 rename some settings 2019-12-04 11:53:05 +11:00
Rimian Perkins
ce600eec04 fix broken paths 2019-12-03 11:00:03 +11:00
Rimian Perkins
e5ee7143ff problematic test 2019-11-13 08:36:38 +11:00
Rimian Perkins
b2c5842aa6 only delete the right subscription 2019-11-12 12:43:23 +11:00
Rimian Perkins
1734abc1b9 product pretender 2019-11-12 11:03:04 +11:00
Rimian Perkins
bdb5883d6a enable 2019-11-07 15:14:52 +11:00
Rimian Perkins
a4c1168e4f skip another 2019-11-07 15:07:04 +11:00
Rimian Perkins
5c13266e5b skip failing test 2019-11-07 14:58:39 +11:00
Rimian Perkins
59dd4deb76 file name extention wrong 2019-11-07 14:33:08 +11:00
Rimian Perkins
b566c437c7 skip unfinished test 2019-11-07 13:17:54 +11:00
Rimian Perkins
dafa08f43e disable dashboard 2019-11-07 12:09:40 +11:00
Rimian Perkins
a7e8bf46bc add setting to test 2019-11-07 11:30:40 +11:00
Rimian Perkins
bec2d57920 pretty 2019-10-31 13:31:24 +11:00
Rimian Perkins
b0a4665bf4 set the dollar amount 2019-10-31 13:29:11 +11:00
Rimian Perkins
ced4d1c786 format the amount in admin 2019-10-31 11:41:01 +11:00
Rimian Perkins
842fac9176 format the rate in the plan model 2019-10-31 10:44:46 +11:00
Rimian Perkins
fcfb826929 create the token and make the customer request 2019-10-11 12:26:01 +11:00
Rimian Perkins
f61f756d9c fix broken subscribe page test 2019-10-10 14:18:44 +11:00
Rimian Perkins
bb31deae89 basic subscribe page 2019-10-10 13:52:55 +11:00
Rimian Perkins
91045583ad namespace subscriptions controller 2019-10-10 13:09:24 +11:00
Rimian Perkins
8cc4f880eb name space admin controller 2019-10-10 12:08:52 +11:00