Glench / ExtPay

The JavaScript library for ExtensionPay.com — payments for your browser extensions, no server needed.
https://extensionpay.com
Other
506 stars 64 forks source link

User subscription status update not updating in test mode #110

Closed FlashInThePan closed 1 year ago

FlashInThePan commented 1 year ago

Describe the bug I start off with an Paid subscription status in test, then I go to the payment page and change my status to "Unpaid". I then click on my extension icon, and my popup.js, which uses the extpay.getUser() function retrieves my user details my paid status is true:

image

However, I then go to the payment page I can see that my payment status is "Unpaid".

To Reproduce

  1. Open payment form in test mode.
  2. Change status from active to unpaid.
  3. Reopen extension by clicking on extension icon.
  4. View console output of user output from extpay.getUser() executed un popup.js. This shows that the paid=true (which is not correct).
  5. Re-open payment page from extension. You will see user status is correctly set to Unpaid.

Desktop (please complete the following information): OS: Windows 10 Pro Chrome browser version: 111.0.5563.65 (Official Build) (64-bit)

Glench commented 1 year ago

If you look in the docs you’ll see that “unpaid” refers to their stripe subscription status (meaning that they’ve paid before but in this billing cycle have not). Look at the stripe docs for more info about Subscription.status.

FlashInThePan commented 1 year ago

Hi Glen. Thanks for getting back to me so quickly.

In that case, how do I know whether or not to show premium features if paid=true doesn't tell me this? Even when I make myself active, I don't see any additional info from the user object to say whether or not show premium features if paid=true doesn't say whether they are active in the current billing cycle. I launch in 7 days, so I would super appreciate your help with this.

Thanks in advance.

Glench commented 1 year ago

There should be a subscriptionStatus field on the user object.

FlashInThePan commented 1 year ago

Think this was my fault.. I reduced the trial period in my logic to zero to test the trial period process and it sent my code down the wrong code path. Thanks for your time today.