* DEV: Fix SCSS deprecations
Followup to https://github.com/discourse/discourse-subscriptions/pull/171
Also fixes:
```
╷
581 │ hsl(random(360), 100, 50);
│ ^^^^^^^^^^^^^^^^^^^^^^^^^
╵
/Users/pmusaraj/Projects/discourse/discourse-subscriptions.scss 581:7 root stylesheet
Deprecation Warning: $lightness: Passing a number without unit % (50) is deprecated.
```
* More cleanup
Sample warning was:
```
Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
Recommendation: math.div($sidebar-height, 1.2) or calc($sidebar-height / 1.2)
More info and automated migrator: https://sass-lang.com/d/slash-div
```
- 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
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.
* 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>
* FIX: set Discourse consistent styles on Stripe card element
* use correct placeholder color
* applied prettier
* mock update method for cardElement
* minor formatting
We need to use the `html-safe` helper here so to that the html tags in
the translation template are rendered correctly.
See: https://meta.discourse.org/t/211376
1. Improve mobile checkout styling
These are pretty simple changes. The buttons were crammed together and not wrapping properly on mobile if there were more than a few. Also the padding was weird and causing text to overflow out of the #main-outlet on phone viewports.
2. Renders the top campaign banner on mobile even if sidebar is selected
In the original PR, we refactored using the connector JS out since we now have more Ember operators; however, we needed some more complex logic that couldn't be done in the template. Basically, we choose which outlet to render the component in based on two criteria:
If the setting is set to sidebar or top
If we're on a mobile device
Previously, if the site showed the banner on the sidebar and the user browsed to mobile, they wouldn't see a banner at all. This PR changes the logic to use the top outlet on mobile, even if the sidebar is selected.
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
Meta topic: https://meta.discourse.org/t/subscriptions-add-pagination-to-admin-subscriptions-view/172500
This adds support for pagination using our `{{load-more}}` component in core. Implementation on the backend was a bit tricky because we don't return all results from Stripe, only those that match local subscriptions stored in the `DiscourseSubscriptions::Subscription` model.
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`.