The Auto-Create Support Campaign button was just showing an infinite "is
loading" spinner so you couldn't even click on it.
This fix allows the button to work again and only show the loading
spinner when it is actually loading.
See: https://meta.discourse.org/t/discourse-subscriptions/140818/653?u=blake
Likely there was an API change at some point now that we are using the
latest version of the stripe API. When the
`customer.subscription.updated` webhook is called we should also accept
the status of "active".
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>
* 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.