public void OnPurchaseFailed(Product item, PurchaseFailureReason reason) { Debug.Log("Billing::OnPurchaseFailed:" + item.metadata.localizedTitle); PurchaseIAPResultCode resultCode = PurchaseIAPResultCode.Failed; BillerErrors error = BillerErrors.NO_ERROR; InAppPurchasableItem inApp = CreatePurchasableInAppItem(item); switch (reason) { case PurchaseFailureReason.ExistingPurchasePending: error = BillerErrors.ATTEMPTING_TO_PURCHASE_PRODUCT_WITH_SAME_RECEIPT; break; case PurchaseFailureReason.PaymentDeclined: error = BillerErrors.PAYMENT_DECLINED; break; case PurchaseFailureReason.ProductUnavailable: error = BillerErrors.PRODUCT_UNAVAILABLE; break; case PurchaseFailureReason.PurchasingUnavailable: error = BillerErrors.PURCHASING_UNAVAILABLE; break; case PurchaseFailureReason.SignatureInvalid: error = BillerErrors.REMOTE_VALIDATION_FAILED; break; case PurchaseFailureReason.Unknown: error = BillerErrors.UNKNOWN; break; case PurchaseFailureReason.UserCancelled: resultCode = PurchaseIAPResultCode.Cancelled; break; } _isPurchaseInProgress = false; PurchaseIAPResult result = new PurchaseIAPResult(inApp, resultCode, error); PsdkEventSystem.Instance.NotifyOnBillingPurchased(result); reportPurchaseCampaignResult(false); }
public PurchaseIAPResult(InAppPurchasableItem purchasedItem, PurchaseIAPResultCode result = PurchaseIAPResultCode.Success, BillerErrors error = BillerErrors.NO_ERROR) { this.purchasedItem = purchasedItem; this.result = result; this.error = error; }
private void OnBillingInit(BillerErrors errors) { InitDone(errors == BillerErrors.NO_ERROR); }