mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Implement iOS subscriptions (#8493)
* implement iOS subscriptions * add additional tests to request body * Improve subscription cancelling * change string to constant
This commit is contained in:
committed by
Matteo Pagliazzi
parent
8550ca4d29
commit
374d528647
@@ -190,6 +190,7 @@ describe('Google Payments', () => {
|
||||
user = new User();
|
||||
user.profile.name = 'sender';
|
||||
user.purchased.plan.customerId = customerId;
|
||||
user.purchased.plan.paymentMethod = googlePayments.constants.PAYMENT_METHOD_GOOGLE;
|
||||
user.purchased.plan.planId = subKey;
|
||||
user.purchased.plan.additionalData = {data: receipt, signature};
|
||||
|
||||
@@ -205,7 +206,7 @@ describe('Google Payments', () => {
|
||||
});
|
||||
|
||||
it('should throw an error if we are missing a subscription', async () => {
|
||||
user.purchased.plan.additionalData = undefined;
|
||||
user.purchased.plan.paymentMethod = undefined;
|
||||
|
||||
await expect(googlePayments.cancelSubscribe(user, headers))
|
||||
.to.eventually.be.rejected.and.to.eql({
|
||||
|
||||
Reference in New Issue
Block a user