public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController) { Debug.WriteLine("PayPal Future Payment Authorization Canceled"); futurePaymentViewController?.DismissViewController(true, null); OnCancelled?.Invoke(); OnCancelled = null; }
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); }
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); } }
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; }); }
public void PayPalFuturePaymentDidCancel(PayPalFuturePaymentViewController futurePaymentViewController) { Debug.WriteLine("PayPal Future Payment Authorization Canceled"); futurePaymentViewController?.DismissViewController(true, null); _onCancelled?.Invoke(); _onCancelled = null; if (!_formsConfig.StoreUserData) { ClearUserData(); } }
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); }
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; }); }
public override void DidCancelFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController) { _hostViewController.PayPalPaymentDidCancelFuturePayment(); }
public void FuturePayment() { var futurePaymentViewController = new PayPalFuturePaymentViewController(_payPalConfig, new CustomPayPalFuturePaymentDelegate(this)); var top = GetTopViewController (UIApplication.SharedApplication.KeyWindow); top.PresentViewController(futurePaymentViewController, true, null); }
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 DidAuthorizeFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController, NSDictionary futurePaymentAuthorization) { _hostViewController.PayPalAuthorizedFuturePayment(futurePaymentAuthorization); }
public override void DidCancelFuturePayment(PayPalFuturePaymentViewController futurePaymentViewController) { Logger.LogMessage("PayPal LinkAccount: The user canceled the operation"); futurePaymentViewController.DismissViewController(true, null); }
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); }