Improve in-app purchase for MacOS (#12464)

* Add methods to finish transactions

* Add a method to get the product descriptions from the App Store

* Improve the documentation of a transaction structure

* Add a tutorial for In App Purchase

* Fix typo in In-App Purchase tutorial

* Fix style of In-App Purchase files

* Fix In-App-Purchase product structure conversion in amr64

* Fix code style in In-App Purchase tutorial documentation

* Fix typos in In-App Purchase documentation

* Fix typo in In-App Purchase spec

* Slight style fixes
This commit is contained in:
Adrien Fery 2018-04-05 08:33:13 +02:00 committed by Cheng Zhao
parent 52b1065b3b
commit 5486a65702
13 changed files with 481 additions and 22 deletions

View file

@ -15,6 +15,14 @@ describe('inAppPurchase module', function () {
inAppPurchase.canMakePayments()
})
it('finishAllTransactions() does not throw', () => {
inAppPurchase.finishAllTransactions()
})
it('finishTransactionByDate() does not throw', () => {
inAppPurchase.finishTransactionByDate(new Date().toISOString())
})
it('getReceiptURL() returns receipt URL', () => {
assert.ok(inAppPurchase.getReceiptURL().endsWith('_MASReceipt/receipt'))
})
@ -32,4 +40,11 @@ describe('inAppPurchase module', function () {
done()
})
})
it('getProducts() returns an empty list when getting invalid product', (done) => {
inAppPurchase.getProducts(['non-exist'], (products) => {
assert.ok(products.length === 0)
done()
})
})
})