build: update to standard 14 (#24479)

This commit is contained in:
Samuel Attard 2020-07-09 10:18:49 -07:00 committed by GitHub
parent 9bd0fc5348
commit eb6616e4e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 495 additions and 665 deletions

View file

@ -37,18 +37,18 @@ inAppPurchase.on('transactions-updated', (event, transactions) => {
// Check each transaction.
transactions.forEach(function (transaction) {
let payment = transaction.payment
const payment = transaction.payment
switch (transaction.transactionState) {
case 'purchasing':
console.log(`Purchasing ${payment.productIdentifier}...`)
break
case 'purchased':
case 'purchased': {
console.log(`${payment.productIdentifier} purchased.`)
// Get the receipt url.
let receiptURL = inAppPurchase.getReceiptURL()
const receiptURL = inAppPurchase.getReceiptURL()
console.log(`Receipt URL: ${receiptURL}`)
@ -62,6 +62,8 @@ inAppPurchase.on('transactions-updated', (event, transactions) => {
inAppPurchase.finishTransactionByDate(transaction.transactionDate)
break
}
case 'failed':
console.log(`Failed to purchase ${payment.productIdentifier}.`)
@ -105,8 +107,8 @@ inAppPurchase.getProducts(PRODUCT_IDS).then(products => {
})
// Ask the user which product he/she wants to purchase.
let selectedProduct = products[0]
let selectedQuantity = 1
const selectedProduct = products[0]
const selectedQuantity = 1
// Purchase the selected product.
inAppPurchase.purchaseProduct(selectedProduct.productIdentifier, selectedQuantity).then(isProductValid => {