public void CycleSession() { _sessionPaymentModel = new CardPaymentModel(); _sessionTokenPaymentModel = new TokenPaymentModel(); _sessionPKPaymentModel = new PKPaymentModel(); _sessionAndroidPaymentModel = new AndroidPaymentModel(); }
public Task<IResult<ITransactionResult>> Create(AndroidPaymentModel androidPayment) { var validationError = Validate<AndroidPaymentModel, ITransactionResult>(AndroidPaymentValidator, androidPayment); return validationError ?? PostInternal<AndroidPaymentModel, ITransactionResult>(_createAddress, androidPayment); }
Task<IResult<ITransactionResult>> PerformTransaction(AndroidPaymentModel androidPayModel) { if (Intent.Extras.GetBoolean(IsPreAuthExtra)) { return _paymentService.AndroidPayPreAuth(androidPayModel); } else { return _paymentService.AndroidPayPayment(androidPayModel); } }
async void PerformJudoPayment(FullWallet fullWallet) { var androidPayModel = new AndroidPaymentModel() { JudoId = _judo.JudoId, Currency = _judo.Currency, Amount = _judo.Amount, Wallet = new AndroidWalletModel() { Environment = WalletEnvironment, PublicKey = Resources.GetString(Resource.String.public_key), GoogleTransactionId = fullWallet.GoogleTransactionId, InstrumentDetails = fullWallet.GetInstrumentInfos()[0].InstrumentDetails, InstrumentType = fullWallet.GetInstrumentInfos()[0].InstrumentType, Version = fullWallet.VersionCode, PaymentMethodToken = fullWallet.PaymentMethodToken.Token } }; var result = await PerformTransaction(androidPayModel); if (result.HasError || "Success".Equals(result.Response.Result)) { Toast.MakeText(_walletFragment.Activity, "Payment successful", ToastLength.Short).Show(); } else if ("Declined".Equals(result.Response.Result)) { Toast.MakeText(_walletFragment.Activity, "Payment declined", ToastLength.Short).Show(); } }
public async Task<IResult<ITransactionResult>> AndroidPayPreAuth(AndroidPaymentModel payment) { PopulateAndroidPayModel(payment); Task<IResult<ITransactionResult>> task = _judoAPI.PreAuths.Create(_sessionAndroidPaymentModel); return await task; }
void PopulateAndroidPayModel(AndroidPaymentModel paymentModel) { _judo.Validate(); PopulateSessionModel(_sessionAndroidPaymentModel, paymentModel); _sessionAndroidPaymentModel.Wallet = paymentModel.Wallet; }
public Task<IResult<JudoApiErrorModel>> Validate(AndroidPaymentModel androidPreAuth) { var validationError = Validate<AndroidPaymentModel, JudoApiErrorModel>(AndroidPaymentValidator, androidPreAuth); return validationError ?? PostInternal<AndroidPaymentModel, JudoApiErrorModel>(_validatePreAuthAddress, androidPreAuth); }