コード例 #1
0
		public void CycleSession()
		{
			_sessionPaymentModel = new CardPaymentModel();
			_sessionTokenPaymentModel = new TokenPaymentModel();
			_sessionPKPaymentModel = new PKPaymentModel();
			_sessionAndroidPaymentModel = new AndroidPaymentModel();
		}
コード例 #2
0
ファイル: BasePayments.cs プロジェクト: JudoPay/DotNetSDK
 public Task<IResult<ITransactionResult>> Create(AndroidPaymentModel androidPayment)
 {
     var validationError = Validate<AndroidPaymentModel, ITransactionResult>(AndroidPaymentValidator, androidPayment);
     return validationError ?? PostInternal<AndroidPaymentModel, ITransactionResult>(_createAddress, androidPayment);
 }
コード例 #3
0
		Task<IResult<ITransactionResult>> PerformTransaction(AndroidPaymentModel androidPayModel)
		{
			if (Intent.Extras.GetBoolean(IsPreAuthExtra))
			{
				return _paymentService.AndroidPayPreAuth(androidPayModel);
			}
			else
			{
				return _paymentService.AndroidPayPayment(androidPayModel);
			}
		}
コード例 #4
0
		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();
			}
		}
コード例 #5
0
		public async Task<IResult<ITransactionResult>> AndroidPayPreAuth(AndroidPaymentModel payment)
		{
			PopulateAndroidPayModel(payment);

			Task<IResult<ITransactionResult>> task = _judoAPI.PreAuths.Create(_sessionAndroidPaymentModel);
			return await task;
		}
コード例 #6
0
		void PopulateAndroidPayModel(AndroidPaymentModel paymentModel)
		{
			_judo.Validate();
			PopulateSessionModel(_sessionAndroidPaymentModel, paymentModel);
			_sessionAndroidPaymentModel.Wallet = paymentModel.Wallet;
		}
コード例 #7
0
ファイル: PreAuth.cs プロジェクト: JudoPay/DotNetSDK
        public Task<IResult<JudoApiErrorModel>> Validate(AndroidPaymentModel androidPreAuth)
        {
            var validationError = Validate<AndroidPaymentModel, JudoApiErrorModel>(AndroidPaymentValidator, androidPreAuth);

            return validationError ?? PostInternal<AndroidPaymentModel, JudoApiErrorModel>(_validatePreAuthAddress, androidPreAuth);
        }