cordova-plugin-purchase
Advanced tools
Comparing version 13.2.0 to 13.2.1
@@ -156,3 +156,3 @@ # Namespace: CdvPurchase | ||
• `Const` **PLUGIN\_VERSION**: ``"13.2.0"`` | ||
• `Const` **PLUGIN\_VERSION**: ``"13.2.1"`` | ||
@@ -159,0 +159,0 @@ Current release number of the plugin. |
{ | ||
"name": "cordova-plugin-purchase", | ||
"version": "13.2.0", | ||
"version": "13.2.1", | ||
"description": "Cordova Purchase plugin for iOS, Android, Windows (AppStore, Play, UWP)", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -543,4 +543,4 @@ /// <reference path="../../types.ts" /> | ||
if (response.ok) { | ||
const vTransaction = response.data.transaction; | ||
if (vTransaction.type === 'ios-appstore' && 'original_application_version' in vTransaction) { | ||
const vTransaction = response.data?.transaction; | ||
if (vTransaction?.type === 'ios-appstore' && 'original_application_version' in vTransaction) { | ||
this._receipt?.transactions.forEach(t => { | ||
@@ -547,0 +547,0 @@ if (t.transactionId === APPLICATION_VIRTUAL_TRANSACTION_ID) { |
@@ -27,3 +27,3 @@ /// <reference path="validator/validator.ts" /> | ||
*/ | ||
export const PLUGIN_VERSION = '13.2.0'; | ||
export const PLUGIN_VERSION = '13.2.1'; | ||
@@ -30,0 +30,0 @@ /** |
@@ -99,11 +99,16 @@ namespace CdvPurchase { | ||
const { receipt, payload } = r; | ||
const adapter = this.controller.adapters.find(receipt.platform); | ||
await adapter?.handleReceiptValidationResponse(receipt, payload); | ||
if (payload.ok) { | ||
const vr = this.addVerifiedReceipt(receipt, payload.data); | ||
this.controller.verifiedCallbacks.trigger(vr); | ||
// this.verifiedCallbacks.trigger(data.receipt); | ||
try { | ||
const adapter = this.controller.adapters.find(receipt.platform); | ||
await adapter?.handleReceiptValidationResponse(receipt, payload); | ||
if (payload.ok) { | ||
const vr = this.addVerifiedReceipt(receipt, payload.data); | ||
this.controller.verifiedCallbacks.trigger(vr); | ||
// this.verifiedCallbacks.trigger(data.receipt); | ||
} | ||
else { | ||
this.controller.unverifiedCallbacks.trigger({receipt, payload}); | ||
} | ||
} | ||
else { | ||
this.controller.unverifiedCallbacks.trigger({receipt, payload}); | ||
catch (err) { | ||
this.log.error('Exception probably caused by an invalid response from the validator.' + (err as Error).message); | ||
} | ||
@@ -110,0 +115,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1873026
24115