Go to file
Dmitry S a19f19b503 (core) Changes to Billing to better handle error scenarios.
Summary:
- Bad status of a subscription is now reported, along with the last payment error, if any.
- Error caused when getting valueRemaining of a subscription in a bad state is now ignored.
- Certain kinds of errors from Stripe are now reported to the user in a
  friendlier way (avoiding statusCode of 500 when there is a better one)
- A wide range of Stripe errors are logged with metadata.
- Show a link to the Stripe-hosted last invoice, which seems useful generally,
  and also gives the user more options to pay after a payment failure.
- Get default_source along with customer to save a roundtrip to Stripe.
- Use a simpler (single) Stripe call for updating a customer’s card.
- Retry paying an invoice when updating a card when there is an unpaid invoice
  with a payment error.

Some refactoring included:
- Simplified ISubscriptionModel by extending IBillingSubscription.
- Factor out common portions from several Billing tests.

Add a test case for how some card errors are reported
Add bits to the new billing test, still WIP.

Test Plan:
Added a test suite for incomplete and past_due subscriptions, and a
test case one for better error reporting.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2553
2020-07-22 14:40:54 -04:00
app (core) Changes to Billing to better handle error scenarios. 2020-07-22 14:40:54 -04:00
buildtools freshen app/client/ui2018/cssVars.ts 2020-06-23 16:16:38 -04:00
static (core) move home server into core 2020-07-21 20:39:10 -04:00
stubs/app (core) move home server into core 2020-07-21 20:39:10 -04:00
.gitignore Update tsconfig files and switch to _build for outputs, for consistency with main grist repo 2020-05-22 02:14:28 -04:00
bin Initial config with a few files that build on client and server side. 2020-05-20 00:50:46 -04:00
ormconfig.js (core) move home server into core 2020-07-21 20:39:10 -04:00
package.json (core) move home server into core 2020-07-21 20:39:10 -04:00
tsconfig.json freshen app/client/ui2018/cssVars.ts 2020-06-23 16:16:38 -04:00
yarn.lock Initial config with a few files that build on client and server side. 2020-05-20 00:50:46 -04:00