예제 #1
0
 public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     Debug.WriteLine("PayPal Future Payment Authorization Canceled");
     futurePaymentViewController?.DismissViewController(true, null);
     OnCancelled?.Invoke();
     OnCancelled = null;
 }
예제 #2
0
 public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     Debug.WriteLine("PayPal Future Payment Authorization Canceled");
     futurePaymentViewController?.DismissViewController(true, null);
     OnCancelled?.Invoke();
     OnCancelled = null;
 }
예제 #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);
        }
예제 #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);
                }
            }
예제 #7
0
		public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController)
		{
			Debug.WriteLine("PayPal Future Payment Authorization Canceled");
			ResultText = "";
			//successView.hidden = true
			futurePaymentViewController?.DismissViewController(true, null);
		}
예제 #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;
     });
 }
예제 #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;
			});
		}
예제 #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();
     }
 }
예제 #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);
        }
예제 #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;
            });
        }
예제 #14
0
 public override void DidCancelFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     _hostViewController.PayPalPaymentDidCancelFuturePayment();
 }
예제 #15
0
		public void FuturePayment()
		{
			var futurePaymentViewController = new PayPalFuturePaymentViewController(_payPalConfig, new CustomPayPalFuturePaymentDelegate(this));
			var top = GetTopViewController (UIApplication.SharedApplication.KeyWindow);
			top.PresentViewController(futurePaymentViewController, true, null);
		}
예제 #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);
 }
예제 #19
0
 public override void DidCancelFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     Logger.LogMessage("PayPal LinkAccount: The user canceled the operation");
     futurePaymentViewController.DismissViewController(true, null);
 }
예제 #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);
        }