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:
Phillip Thelen
2017-02-21 19:22:13 +01:00
committed by Matteo Pagliazzi
parent 8550ca4d29
commit 374d528647
12 changed files with 621 additions and 90 deletions

View File

@@ -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({