public void OnPurchaseCallback(PayResult payResult) { bool flag = false; if (Singleton <AccountManager> .Instance.accountConfig.paymentBranch == ConfigAccount.PaymentBranch.APPSTORE_CN) { MonoStoreKitEventListener.IAP_PURCHASE_CALLBACK = null; ApplePayResult result = (ApplePayResult)payResult; if (result.payRetCode == PayResult.PayRetcode.CANCELED) { flag = true; } else if (result.payRetCode == PayResult.PayRetcode.FAILED) { flag = true; Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("IAPTransitionFailed", new object[0]), 2f), UIType.Any); } else if (result.payRetCode == PayResult.PayRetcode.CONFIRMING) { flag = true; } else if (result.payRetCode != PayResult.PayRetcode.SUCCESS) { flag = true; } } else if ((payResult.payRetCode != PayResult.PayRetcode.SUCCESS) && (payResult.payRetCode != PayResult.PayRetcode.CONFIRMING)) { if (payResult.payRetCode == PayResult.PayRetcode.CANCELED) { flag = true; } else if (payResult.payRetCode == PayResult.PayRetcode.FAILED) { flag = true; Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(payResult.GetResultShowText(), 2f), UIType.Any); } else { flag = true; } } if (flag && (this._loadingWheelDialogContext != null)) { this._loadingWheelDialogContext.Finish(); this._loadingWheelDialogContext = null; } }
public override void PayFinishedCallBack(string param) { if (Singleton <AccountManager> .Instance.accountConfig.paymentBranch == ConfigAccount.PaymentBranch.ORIGINAL_ANDROID_PAY) { PayResult payResult = null; switch (Singleton <ChannelPayModule> .Instance.GetPayMethodId()) { case ChannelPayModule.PayMethod.ALIPAY: payResult = new AliPayResult(param); break; case ChannelPayModule.PayMethod.WEIXIN_PAY: payResult = new WeixinPayResult(param); break; } if (payResult != null) { Singleton <ChannelPayModule> .Instance.OnPurchaseCallback(payResult); } } }