Commit Graph

29 Commits

Author SHA1 Message Date
Phillip Thelen
64a3515c10 Add logic for different types of sub upgrades 2023-02-06 11:17:35 +01:00
Phillip Thelen
ddf1b4060d Better handling for cancellation when user had multiple subs 2023-02-06 11:17:35 +01:00
Phillip Thelen
967717a010 Fix logic for apple subscriptions 2023-02-06 11:17:35 +01:00
SabreCat
9b791b4ba0 fix(test): save user to avoid lock errors 2023-02-06 11:17:35 +01:00
SabreCat
5aca5b4be7 fix(test): linting 2023-02-06 11:17:35 +01:00
Phillip Thelen
0dd25b6431 fix issue where subs would be applied multiple times 2023-02-06 11:17:35 +01:00
Phillip Thelen
cf75d941fa fix test 2023-02-06 11:17:35 +01:00
Phillip Thelen
f07d0f6441 Implement correct handling for when subs are up/downgraded 2023-02-06 11:17:24 +01:00
Phillip Thelen
98ec1757f9 fix tests 2023-02-06 11:16:24 +01:00
SabreCat
ac239e32ce fix(payments): wrap up adjusted test expectations 2023-01-23 00:45:31 -06:00
SabreCat
3474cbf138 fix(payments): correct more tests 2023-01-22 23:02:18 -06:00
SabreCat
f845bbd7a0 fix(payments): address some test failures 2023-01-22 22:30:48 -06:00
SabreCat
e5bbde7e97 feat(event): 10th Birthday Bash
with @CuriousMagpie and @phillipthelen
2023-01-20 16:14:33 -06:00
SabreCat
f1fa6a8456 Revert "Allow sub upgrades/downgrades on iOS (#14303)"
This reverts commit 9e98e56e9b.
2022-11-21 16:40:56 -06:00
SabreCat
f2aaee15f3 Merge branch 'release' into develop 2022-11-18 15:29:06 -06:00
SabreCat
febffb3f07 Revert "Fix double subscriptions, second attempt (#14345)"
This reverts commit 1a5cba57b7.
2022-11-18 14:26:49 -06:00
SabreCat
fdfa2d6df4 Merge branch 'release' into develop 2022-11-15 19:29:37 -06:00
Sabe Jones
1a5cba57b7 Fix double subscriptions, second attempt (#14345)
* fix(subscriptions): reject subs that come in too fast

* fix(lint): remove unused import

* fix(groups): individual subs may come rapidly

* fix(subscriptions): bad paren, handle rapid testing

* fix(test): reset dateUpdated between subs

* fix(test): one more block for dateUpdated

Co-authored-by: SabreCat <sabe@habitica.com>
2022-11-15 19:19:37 -06:00
SabreCat
9b1a726875 Revert "feat(subs): allow upgrade/downgrade on iOS"
This reverts commit 27440772f0.
2022-11-02 09:00:29 -05:00
Phillip Thelen
9e98e56e9b Allow sub upgrades/downgrades on iOS (#14303)
* Allow sub upgrades/downgrades on iOS

* fix check

* fix(lint): line length

* fix(typo): customER

* fix tests

* Implement correct handling for when subs are up/downgraded

* fix lint errors

* fix test

Co-authored-by: SabreCat <sabe@habitica.com>
Co-authored-by: Sabe Jones <sabrecat@gmail.com>
2022-11-01 21:07:23 -05:00
SabreCat
27440772f0 feat(subs): allow upgrade/downgrade on iOS
by @phillipthelen
2022-11-01 20:53:04 -05:00
SabreCat
aea0be3245 fix(subs): establish lock to prevent race condition 2022-11-01 20:47:21 -05:00
Sabe Jones
90250d1a25 Establish lock to avoid race scenario in subscriptions (#14267)
* fix(subscription): establish lock to avoid race scenario

* fix(lint): import syntax

* fix(lint): whitespace, dependency cycle

* fix(subs): skip locking on gifts and groups

* fix(subs): correctly reset _subSignature

* fix(sub): use findOneAndUpdate for unlock

* fix(test): save newly created user for some reason

Co-authored-by: SabreCat <sabe@habitica.com>
2022-10-25 16:44:33 -05:00
Matteo Pagliazzi
6d34319455 Stripe: upgrade module and API, switch to Checkout (#12785)
* upgrade stripe module

* switch stripe api to latest version

* fix api version in tests

* start upgrading client and server

* client: switch to redirect

* implement checkout session creation for gems, start implementing webhooks

* stripe: start refactoring one time payments

* working gems and gift payments

* start adding support for subscriptions

* stripe: migrate subscriptions and fix cancelling sub

* allow upgrading group plans

* remove console.log statements

* group plans: upgrade from static page / create new one

* fix #11885, correct group plan modal title

* silence more stripe webhooks

* fix group plans redirects

* implement editing payment method

* start cleaning up code

* fix(stripe): update in-code docs, fix eslint issues

* subscriptions tests

* remove and skip old tests

* skip integration tests

* fix client build

* stripe webhooks: throw error if request fails

* subscriptions: correctly pass groupId

* remove console.log

* stripe: add unit tests for one time payments

* wip: stripe checkout tests

* stripe createCheckoutSession unit tests

* stripe createCheckoutSession unit tests

* stripe createCheckoutSession unit tests (editing card)

* fix existing webhooks tests

* add new webhooks tests

* add more webhooks tests

* fix lint

* stripe integration tests

* better error handling when retrieving customer from stripe

* client: remove unused strings and improve error handling

* payments: limit gift message length (server)

* payments: limit gift message length (client)

* fix redirects when payment is cancelled

* add back "subUpdateCard" string

* fix redirects when editing a sub card, use proper names for products, check subs when gifting
2020-12-14 15:59:17 +01:00
Matteo Pagliazzi
83aca20ce5 Fall Festival Gem Promo (#138)
* content: add gems blocks

* gemsBlocks: include ios and android identifiers

* wip: promo code

* split common constants into multiple files

* add second promo part

* geCurrentEvent, refactor promo

* fix lint

* fix exports, use world state api

* start adding world state tests

* remove console.log

* use gems block for purchases

* remove comments

* fix most unit tests

* restore comment

* fix lint

* prevent apple/google gift tests from breaking other tests when stub is not reset

* fix unit tests, clarify tests names

* iap: use gift object when gifting gems

* allow gift object with less data

* fix iap tests, remove findById stubs

* iap: require less data from the mobile apps

* apply discounts

* add missing worldState file

* fix lint

* add test event

* start removing 20 gems option for web

* start adding support for all gems packages on web

* fix unit tests for apple, stripe and google

* amazon: support all gems blocks

* paypal: support all gems blocks

* fix payments unit tests, add tests for getGemsBlock

* web: add gems plans with discounts, update stripe

* fix amazon and paypal clients, payments success modals

* amazon pay: disabled state

* update icons, start abstracting payments buttons

* begin redesign

* redesign gems modal

* fix buttons

* fix hover color for gems modal close icon

* add key to world state current event

* extend test event length

* implement gems modals designs

* early test fall2020

* fix header banner position

* add missing files

* use iso 8601 for dates, minor ui fixes

* fix time zones

* events: fix ISO8601 format

* fix css indentation

* start abstracting banners

* refactor payments buttons

* test spooky, fix group plans box

* implement gems promo banners, refactor banners, fixes

* fix lint

* fix dates

* remove unused i18n strings

* fix stripe integration test

* fix world state integration tests

* the current active event

* add missing unit tests

* add storybook story for payments buttons component

* fix typo

* fix(stripe): correct label when gifting subscriptions
2020-09-21 16:22:13 +02:00
Matteo Pagliazzi
85fb5f33aa fix test lint 2019-10-08 20:45:38 +02:00
Phillip Thelen
cfbfec34aa Allow gems and subs to be gifted through in-app-purchases (#10892)
* Allow gems to be gifted through IAPs

* implement non recurring IAP subscriptions

* fix localization issue in error

* fix non renewing subscription handling

* Fix lint error

* fix tests

* move findbyId mock to helper file

* undo package-lock changes

* Fix lint error
2018-12-23 19:20:14 +01:00
Matteo Pagliazzi
56d1b77215 Upgrade sinon (#10773)
* upgrade sinon

* sinon changes

* fix unit tests
2018-10-26 18:15:28 +02:00
Matteo Pagliazzi
8be9964483 API v4 (WIP) (#10453)
API v4
2018-06-18 14:40:25 +02:00