Skip to content

Instantly share code, notes, and snippets.

@stephendonner
Last active February 14, 2023 19:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephendonner/3467b60247506bdd8936116ce712b6c1 to your computer and use it in GitHub Desktop.
Save stephendonner/3467b60247506bdd8936116ce712b6c1 to your computer and use it in GitHub Desktop.

Credentials Testing (desktop)

Purchase Brave VPN

  1. install Brave
  2. launch Brave
  3. load chrome://flags/#brave-vpn
  4. set it to Enabled
  5. click on Relaunch
  6. load account.bravesoftware.com
  7. enter basic-auth credentials from 1Password
  8. enter a new, throwaway @mailinator.com email address
  9. click Get login link
  10. click on the button or link in the resulting email to Log in to Brave
  11. click Browse plans
  12. scroll down and click on Buy now under Brave VPN Subscription
  13. complete purchase using https://stripe.com/docs/testing#use-test-cards
  14. you should see both a Success! banner at the top, and a box below saying You have active credentials loaded! (both are green)
  15. click on the VPN button in the browser toolbar
  16. accept the BraveVPN config (on macOS)

Expected:

  • confirm you're connected to the VPN, with a new IP address

via Local State

  • verify the unblinded_creds entries are populated
  • verify last_paid_at is within a couple minutes
  • verify expires_at is about 30 days in the future
  • verify status is paid
unblinded_creds last_paid_at expires_at status
\"valid_from\":\"2023-03-12T15:37:12\",\"valid_to\":\"2023-03-13T15:37:12\" "last_paid_at\":\"2023-02-12T18:49:08.557801\" "expires_at\":\"2023-03-12T18:49:08.557786\" \"status\":\"paid\"

Cancel plan

Prerequisite: Run Purchase Brave VPN case

  1. load account.bravesoftware.com
  2. enter the @mailinator.com email address used to purchase Brave VPN
  3. click Get login link
  4. click on Cancel plan
  5. confirm the interstitial Cancel subscription page
  6. click on Cancel subscription
  7. confirm Your plan has been canceled. page
  8. click Return to account
  9. examine the subscription-canceled banner

Expected:

  • confirm, e.g., Your subscription has been canceled. Access until Mar 12, 2023. (will show 30 days, but we're forgiving and hence the +2 grace period)

via Local State

  • verify order_status is canceled
  • verify expires_at is set to be valid until the canceled subscription window's date
status expires_at
\"status\":\"canceled\" \"expires_at\":\"2023-03-12T18:49:08.557786\

Expiration (via Stripe.com cancellation)

Prerequisite: run Purchase Brave VPN case

  1. log in to account.bravesoftware.com using your just-created account
  2. confirm (but don't click on) the Refresh Brave VPN button
  3. from Stripe.com, find and set the order for the email address to be Canceled by clicking the x to the right of Subscriptions

Expected:

via Local State

  • verify status is canceled

Expiration + grace period, days 30 through 33

Prerequisite: run Expiration case

  1. shut down Brave
  2. set expires_at in Local State to be yesterday's UTC-stamped date
  3. re-launch Brave
  4. log back in to account.bravesoftware.com
  5. confirm account.bravesoftware.com lists your expired date correctly

Expected:

via Local State

  • ?

Expiration, day 34 (past grace period)

Prerequisite: run Expiration case

  1. shut down Brave
  2. set expires_at in Local State to be yesterday's UTC-stamped date
  3. re-launch Brave
  4. log back in to account.bravesoftware.com

Expected:

  • confirm account.bravesoftware.com lists the accurate expired date
  • confirm clicking on VPN button opens Buy/Already purchased? modal
account.bravesoftware.com Buy/Purchased? card

Renew plan

Prerequisite: run Cancel plan

  1. log in to account.bravesoftware.com using your just-canceled account's email address (@mailinator.com)
  2. confirm and click on sole Renew plan link
  3. ensure test credit-card details are prefilled
  4. click on Subscribe
  5. confirm Success! and You have active credentials loaded! banner + box (both green)
  6. confirm Edit payment and Cancel plan links
  7. click on Edit payment
  8. confirm that the appropriate Stripe page is opened
  9. go back to /account
  10. click Cancel subscription
  11. confirm that the interstitial page opens
  12. click on the VPN button in the browser toolbar

Expected:

  • confirm you're connected to BraveVPN, with a new IP address

via Local State

  • verify status is paid
  • verify last_paid_at is "within a couple minutes"
  • verify expires_at is set to 30 days from its original-purchase/auto-renewal date
status last_paid_at expires_at
"status\":\"paid\" "last_paid_at\":\"2023-02-12T19:21:29.582568\" ......

Auto-renew plan

  1. create a new profile
  2. log in to account.bravesoftware.com using an email address from an already-purchased (last month) subscription
  3. under Your plan subscriptions, click on the Refresh Brave VPN button
  4. confirm you see the You have active credentials loaded! message
  5. click on the VPN button in the browser toolbar

Expected:

  • confirm you're connected to the VPN, with a new IP address

via Local State

  • verify status is paid
  • verify last_paid_at is ......
  • verify expires_at is set to 30 days from its original-purchase/auto-renewal date
status last_paid_at expires_at
\"status\":\"paid\" \"last_paid_at\":\"2023-02-01T12:42:10.737452\" \"expires_at\":\"2023-03-04T12:42:10.737441\"

Stripe.com references

Active status

Screenshot 2023-02-02 at 11 18 57 PM

Cases:

  • Purchase Brave VPN
  • Renew plan (after Cancel Brave VPN case)
  • Auto-Renewal

Canceled status

Screenshot 2023-02-02 at 11 20 31 PM

Cases:

  • Cancel Brave VPN (manually)
  • Expiration (direct via Stripe.com Cancel subscription link)

Webhook attempts

Screenshot 2023-02-03 at 12 38 29 AM
@AlanBreck
Copy link

AlanBreck commented Feb 3, 2023

Recommended revision for steps 7-9 below. Reason being that it's not clear from the plan that Cancel subscription isn't going to be a button on the page resulting from the Edit payment click.

7. click on `Edit payment`
8. confirm that the appropriate Stripe page is opened
9. go back to `/account`
10. click `Cancel subscription`
11. confirm that interstitial page opens

@stephendonner
Copy link
Author

stephendonner commented Feb 9, 2023

Recommended revision for steps 7-9 below. Reason being that it's not clear from the plan that Cancel subscription isn't going to be a button on the page resulting from the Edit payment click.

Thanks @AlanBreck ! Fixed in the Renew plan case:

Screen Shot 2023-02-08 at 11 33 52 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment