Support subscription payment through Google Play Store (#8437)

* Support subscription payment through Google Play Store

* minor fixes to iap subscriptions

* Support subscription payment through Google Play Store

* minor fixes to iap subscriptions

* revert change to test

* add unit tests for google payments

* add integration tests for google payments

* change config formatting for play api

* fix typo in file name

* fix typo in example config

* Improve google payment tests

* fix linter errors
This commit is contained in:
Phillip Thelen
2017-02-02 01:39:37 +01:00
committed by Sabe Jones
parent a002bc5e20
commit 4d0295a60d
10 changed files with 630 additions and 54 deletions

View File

@@ -106,6 +106,9 @@ api.createSubscription = async function createSubscription (data) {
// Specify a lastBillingDate just for Amazon Payments
// Resetted every time the subscription restarts
lastBillingDate: data.paymentMethod === 'Amazon Payments' ? today : undefined,
nextPaymentProcessing: data.nextPaymentProcessing,
nextBillingDate: data.nextBillingDate,
additionalData: data.additionalData,
owner: data.user._id,
}).defaults({ // allow non-override if a plan was previously used
gemsBought: 0,