Exemplo n.º 1
0
 public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     Debug.WriteLine("PayPal Future Payment Authorization Canceled");
     futurePaymentViewController?.DismissViewController(true, null);
     OnCancelled?.Invoke();
     OnCancelled = null;
 }
Exemplo n.º 2
0
 public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     Debug.WriteLine("PayPal Future Payment Authorization Canceled");
     futurePaymentViewController?.DismissViewController(true, null);
     OnCancelled?.Invoke();
     OnCancelled = null;
 }
Exemplo n.º 3
0
        void PayPalFuturePaymentViewController(PayPalFuturePaymentViewController futurePaymentViewController, NSDictionary futurePaymentAuthorization)
        {
            Debug.WriteLine("PayPal Future Payment Authorization Success!");
            futurePaymentViewController?.DismissViewController(true, () =>
            {
                NSError err     = null;
                NSData jsonData = NSJsonSerialization.Serialize(futurePaymentAuthorization, NSJsonWritingOptions.PrettyPrinted, out err);
                NSString first  = new NSString("");
                if (err == null)
                {
                    first = new NSString(jsonData, NSStringEncoding.UTF8);
                }
                else
                {
                    Debug.WriteLine(err.LocalizedDescription);
                }

                _onSuccess?.Invoke(first.ToString());
                _onSuccess = null;
                if (!_formsConfig.StoreUserData)
                {
                    ClearUserData();
                }
            });
        }
 public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     Debug.WriteLine("PayPal Future Payment Authorization Canceled");
     ResultText = "";
     //successView.hidden = true
     futurePaymentViewController?.DismissViewController(true, null);
 }
        public void FuturePayment()
        {
            var futurePaymentViewController = new PayPalFuturePaymentViewController(_payPalConfig, new CustomPayPalFuturePaymentDelegate(this));
            var top = GetTopViewController(UIApplication.SharedApplication.KeyWindow);

            top.PresentViewController(futurePaymentViewController, true, null);
        }
Exemplo n.º 6
0
            public override void DidAuthorizeFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController, NSDictionary futurePaymentAuthorization)
            {
                // The user has successfully logged into PayPal, and has consented to future payments.
                // Your code must now send the authorization response to your server.
                try
                {
                    NSError error;
                    var     contentJsonData = NSJsonSerialization.Serialize(futurePaymentAuthorization, NSJsonWritingOptions.PrettyPrinted, out error);

                    if (error != null)
                    {
                        throw new Exception(error.LocalizedDescription + " " + error.LocalizedFailureReason);
                    }

                    var authResponse = contentJsonData.ToString().FromJson <FuturePaymentAuthorization>();
                    if (authResponse != null)
                    {
                        _futurePaymentAuthorized(authResponse.Response.Code);
                    }

                    // Be sure to dismiss the PayPalLoginViewController.
                    futurePaymentViewController.DismissViewController(true, null);
                }
                catch (Exception e)
                {
                    Logger.LogError(e);
                    Mvx.Resolve <IMessageService>().ShowMessage(Mvx.Resolve <ILocalization>()["Error"], e.GetBaseException().Message);
                }
            }
Exemplo n.º 7
0
		public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController)
		{
			Debug.WriteLine("PayPal Future Payment Authorization Canceled");
			ResultText = "";
			//successView.hidden = true
			futurePaymentViewController?.DismissViewController(true, null);
		}
Exemplo n.º 8
0
        public void FuturePayment(Action onCancelled, Action <string> onSuccess)
        {
            OnCancelled = onCancelled;
            OnSuccess   = onSuccess;
            var futurePaymentViewController = new PayPalFuturePaymentViewController(_payPalConfig, new CustomPayPalFuturePaymentDelegate(this));
            var top = GetTopViewController(UIApplication.SharedApplication.KeyWindow);

            top.PresentViewController(futurePaymentViewController, true, null);
        }
 void PayPalFuturePaymentViewController(PayPalFuturePaymentViewController futurePaymentViewController, NSDictionary futurePaymentAuthorization)
 {
     Debug.WriteLine("PayPal Future Payment Authorization Success!");
     // send authorization to your server to get refresh token.
     futurePaymentViewController?.DismissViewController(true, () =>
     {
         ResultText = futurePaymentAuthorization.Description;
     });
 }
Exemplo n.º 10
0
		void PayPalFuturePaymentViewController(PayPalFuturePaymentViewController futurePaymentViewController, NSDictionary futurePaymentAuthorization)
		{
			Debug.WriteLine("PayPal Future Payment Authorization Success!");
			// send authorization to your server to get refresh token.
			futurePaymentViewController?.DismissViewController(true, () =>
			{
				ResultText = futurePaymentAuthorization.Description;
			});
		}
Exemplo n.º 11
0
 public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     Debug.WriteLine("PayPal Future Payment Authorization Canceled");
     futurePaymentViewController?.DismissViewController(true, null);
     _onCancelled?.Invoke();
     _onCancelled = null;
     if (!_formsConfig.StoreUserData)
     {
         ClearUserData();
     }
 }
Exemplo n.º 12
0
        partial void actAuthorizeFuturePayment(NSObject sender)
        {
            _samplePayPalFuturePaymentDelegate = new SamplePayPalFuturePaymentDelegate(this);
            _fpViewController = new PayPalFuturePaymentViewController(_payPalConfig, _samplePayPalFuturePaymentDelegate);

            if (_fpViewController.Handle == IntPtr.Zero)
            {
                Debug.WriteLine("Failed to create PayPalFuturePaymentViewController.");
                return;
            }

            PresentViewController(_fpViewController, true, null);
        }
Exemplo n.º 13
0
        void PayPalFuturePaymentViewController(PayPalFuturePaymentViewController futurePaymentViewController, NSDictionary futurePaymentAuthorization)
        {
            Debug.WriteLine("PayPal Future Payment Authorization Success!");
            futurePaymentViewController?.DismissViewController(true, () =>
            {
                NSError err = null;
                NSData jsonData = NSJsonSerialization.Serialize(futurePaymentAuthorization, NSJsonWritingOptions.PrettyPrinted, out err);
                NSString first = new NSString("");
                if (err == null)
                {
                    first = new NSString(jsonData, NSStringEncoding.UTF8);
                }
                else {
                    Debug.WriteLine(err.LocalizedDescription);
                }

                OnSuccess?.Invoke(first.ToString());
                OnSuccess = null;
            });
        }
Exemplo n.º 14
0
 public override void DidCancelFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     _hostViewController.PayPalPaymentDidCancelFuturePayment();
 }
Exemplo n.º 15
0
		public void FuturePayment()
		{
			var futurePaymentViewController = new PayPalFuturePaymentViewController(_payPalConfig, new CustomPayPalFuturePaymentDelegate(this));
			var top = GetTopViewController (UIApplication.SharedApplication.KeyWindow);
			top.PresentViewController(futurePaymentViewController, true, null);
		}
Exemplo n.º 16
0
 public void FuturePayment(Action onCancelled, Action<string> onSuccess)
 {
     OnCancelled = onCancelled;
     OnSuccess = onSuccess;
     var futurePaymentViewController = new PayPalFuturePaymentViewController(_payPalConfig, new CustomPayPalFuturePaymentDelegate(this));
     var top = GetTopViewController(UIApplication.SharedApplication.KeyWindow);
     top.PresentViewController(futurePaymentViewController, true, null);
 }
 public override void DidCancelFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     _hostViewController.PayPalPaymentDidCancelFuturePayment();
 }
 public override void DidAuthorizeFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController, NSDictionary futurePaymentAuthorization)
 {
     _hostViewController.PayPalAuthorizedFuturePayment(futurePaymentAuthorization);
 }
Exemplo n.º 19
0
 public override void DidCancelFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     Logger.LogMessage("PayPal LinkAccount: The user canceled the operation");
     futurePaymentViewController.DismissViewController(true, null);
 }
Exemplo n.º 20
0
 public override void DidAuthorizeFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController, NSDictionary futurePaymentAuthorization)
 {
     _hostViewController.PayPalAuthorizedFuturePayment(futurePaymentAuthorization);
 }
partial         void actAuthorizeFuturePayment(NSObject sender)
        {
            _samplePayPalFuturePaymentDelegate = new SamplePayPalFuturePaymentDelegate(this);
            _fpViewController = new PayPalFuturePaymentViewController(_payPalConfig, _samplePayPalFuturePaymentDelegate);

            if (_fpViewController.Handle == IntPtr.Zero) {
                Debug.WriteLine ("Failed to create PayPalFuturePaymentViewController.");
                return;
            }

            PresentViewController (_fpViewController, true, null);
        }