예제 #1
0
 public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     Debug.WriteLine("PayPal Future Payment Authorization Canceled");
     futurePaymentViewController?.DismissViewController(true, null);
     OnCancelled?.Invoke();
     OnCancelled = null;
 }
예제 #2
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);
 }
예제 #4
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);
                }
            }
 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;
     });
 }
예제 #6
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();
     }
 }
예제 #7
0
 public override void DidCancelFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController)
 {
     Logger.LogMessage("PayPal LinkAccount: The user canceled the operation");
     futurePaymentViewController.DismissViewController(true, null);
 }