Example #1
0
		public PaymentService(JudoPayApi judoAPI, Judo judo)
		{
			_judoAPI = judoAPI;
			_judo = judo;
			clientService = DependencyService.Get<IClientService>();
			CycleSession();
		}
		public JudoPKPaymentAuthorizationViewControllerDelegate(Judo judo, ApplePayModel applePayModel, JudoSuccessCallback success, JudoFailureCallback failure, IApplePayRequest applePayRequest)
		{
			_successCallBack = success;
			_failureCallback = failure;
			_applePayModel = applePayModel;
			_judo = judo;
			_applePayRequest = applePayRequest;
		}
Example #3
0
		public TokenPaymentPage(Judo judo, TokenPaymentDefaultsViewModel model) : base(judo, model)
		{
			tokenViewModel.Amount = Judo.Amount;
			tokenViewModel.JudoID = Judo.JudoId;
			tokenViewModel.Currency = Judo.Currency;
			tokenViewModel.ConsumerReference = Judo.ConsumerReference;
			tokenViewModel.Token = model.CardToken;
			tokenViewModel.ConsumerToken = model.ConsumerToken;
		}
		public void payment(Judo judo)
		{
			Intent intent = new Intent(Xamarin.Forms.Forms.Context, typeof(AndroidPayActivity));
			var json = JsonConvert.SerializeObject(judo);

			intent.PutExtra(AndroidPayActivity.JudoExtra, json);

			Xamarin.Forms.Forms.Context.StartActivity(intent);
		}
Example #5
0
		protected static Judo GetJudo()
		{
			var config = new Judo();
			config.ApiToken = Credentials.Token;
			config.ApiSecret = Credentials.Secret;
			config.JudoId = Credentials.JudoId;
			config.Environment = JudoEnvironment.Sandbox;
			return config;
		}
		public CardEntryPage(Judo judo)
		{
			PaymentService = new ServiceFactory().GetPaymentService(judo);
			Judo = judo;
			_acceptedCardNetworks = _cardNetworkDiscoverer.GetAvailableCardNetworks();
			Presenter = new TransactionPresenter(this);
			InitializeComponent();
			InitializeView();
		}
Example #7
0
		public PaymentPage(Judo judo, PaymentDefaultsViewModel defaults) : base(judo, defaults)
		{
			if (!Judo.AmexAccepted)
			{
				SetAmexAsUnaccepted();
			}

			if (!Judo.MaestroAccepted)
			{
				SetMaestroAsUnaccepted();
			}
		}
Example #8
0
		public bool IsApplePayAvailable(Judo judo)
		{
			var paymentNetworks = new List<NSString>();
			paymentNetworks.Add(PKPaymentNetwork.Visa);
			paymentNetworks.Add(PKPaymentNetwork.MasterCard);

			if (judo.AmexAccepted)
			{
				paymentNetworks.Add(PKPaymentNetwork.Amex);
			}

			return PKPaymentAuthorizationViewController.CanMakePayments && PKPaymentAuthorizationViewController.CanMakePaymentsUsingNetworks(paymentNetworks.ToArray());
		}
Example #9
0
		void PerformApplePayAction(Judo judo, ApplePayModel model, JudoSuccessCallback success, JudoFailureCallback failure, IApplePayRequest applePayRequest)
		{
			try
			{
				PKPaymentRequest request = GetPKPaymentRequest(model);
				var rootView = GetCurrentViewController();
				var pkDelegate = new JudoPKPaymentAuthorizationViewControllerDelegate(judo, model, success, failure, applePayRequest);

				PKPaymentAuthorizationViewController pkController = new PKPaymentAuthorizationViewController(request) { Delegate = pkDelegate };
				rootView.PresentViewController(pkController, true, null);

			}
			catch (Exception e)
			{
				var judoError = new JudoError { Exception = e.InnerException };
				failure(judoError);
			}
		}
		protected override void OnCreate(Bundle savedInstanceState)
		{
			base.OnCreate(savedInstanceState);
			SetContentView(Resource.Layout.AndroidPay);

			_judo = JsonConvert.DeserializeObject<Judo>(Intent.GetStringExtra(JudoExtra));

			_paymentService = new ServiceFactory().GetPaymentService(_judo);

			if (savedInstanceState == null)
			{
				_googleApiClient = new GoogleApiClient.Builder(this)
					 .AddApi(WalletClass.API, new WalletClass.WalletOptions.Builder()
					 .SetEnvironment(WalletEnvironment)
					 .Build())
					.EnableAutoManage(this, this)
					.Build();

				CreateWalletFragment();
				CheckAndroidPayAvailable();
			}
		}
Example #11
0
		public RegisterCardPage(Judo judo) : this(judo, new PaymentDefaultsViewModel()) { }
		public CardEntryPage(Judo judo, TokenPaymentDefaultsViewModel defaults) : this(judo)
		{
			_isTokenPayment = true;
			SetUpDefaults(defaults);
		}
		public CardEntryPage(Judo judo, PaymentDefaultsViewModel defaults) : this(judo)
		{
			SetUpDefaults(defaults);
		}
Example #14
0
 internal IPaymentService GetPaymentService(Judo judo)
 {
     var factory = new ServiceFactory();
     return factory.GetPaymentService(judo);
 }
Example #15
0
 public IPaymentService GetPaymentService (Judo judo)
 {
     var judoApi = JudoPaymentsFactory.Create (judo.Environment, judo.ApiToken, judo.ApiSecret);
     return  new PaymentService (judoApi, judo);
 }
Example #16
0
		IPaymentService GetPaymentService(Judo judo)
		{
			return new ServiceFactory().GetPaymentService(judo);
		}
Example #17
0
		public void PreAuth(Judo judo, ApplePayModel model, JudoSuccessCallback success, JudoFailureCallback failure)
		{
			var paymentService = GetPaymentService(judo);
			PerformApplePayAction(judo, model, success, failure, new ApplePayPreAuthRequest(paymentService));
		}
Example #18
0
		public PaymentPage(Judo judo) : this(judo, new PaymentDefaultsViewModel()) { }