public void UserDidCancelPayPalProfileSharingViewController(PayPalProfileSharingViewController profileSharingViewController)
 {
     Debug.WriteLine("PayPal Profile Sharing Authorization Canceled");
     profileSharingViewController?.DismissViewController(true, null);
     OnCancelled?.Invoke();
     OnCancelled = null;
 }
 public void UserDidCancelPayPalProfileSharingViewController(PayPalProfileSharingViewController profileSharingViewController)
 {
     Debug.WriteLine("PayPal Profile Sharing Authorization Canceled");
     profileSharingViewController?.DismissViewController(true, null);
     OnCancelled?.Invoke();
     OnCancelled = null;
 }
Exemple #3
0
 public void UserDidCancelPayPalProfileSharingViewController(PayPalProfileSharingViewController profileSharingViewController)
 {
     Debug.WriteLine("PayPal Profile Sharing Authorization Canceled");
     profileSharingViewController?.DismissViewController(true, null);
     _onCancelled?.Invoke();
     _onCancelled = null;
     if (!_formsConfig.StoreUserData)
     {
         ClearUserData();
     }
 }
        public void AuthorizeProfileSharing(Action onCancelled, Action <string> onSuccess)
        {
            OnCancelled = onCancelled;
            OnSuccess   = onSuccess;
            var infoSet = new NSSet(
                Constants.kPayPalOAuth2ScopeOpenId.ToString(),
                Constants.kPayPalOAuth2ScopeEmail.ToString(),
                Constants.kPayPalOAuth2ScopeAddress.ToString(),
                Constants.kPayPalOAuth2ScopePhone.ToString()
                );
            var profileSharingViewController = new PayPalProfileSharingViewController(infoSet, _payPalConfig, new CustomAuthorizeProfileSharingDelegate(this));
            var top = GetTopViewController(UIApplication.SharedApplication.KeyWindow);

            top.PresentViewController(profileSharingViewController, true, null);
        }
 public void PayPalProfileSharingViewController(PayPalProfileSharingViewController profileSharingViewController, NSDictionary profileSharingAuthorization)
 {
     Debug.WriteLine("PayPal Profile Sharing Authorization Success!");
     profileSharingViewController.DismissViewController(true, () =>
     {
         NSError err = null;
         NSData jsonData = NSJsonSerialization.Serialize(profileSharingAuthorization, 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 void PayPalProfileSharingViewController(PayPalProfileSharingViewController profileSharingViewController, NSDictionary profileSharingAuthorization)
 {
     Debug.WriteLine("PayPal Profile Sharing Authorization Success!");
     profileSharingViewController.DismissViewController(true, () =>
     {
         NSError err     = null;
         NSData jsonData = NSJsonSerialization.Serialize(profileSharingAuthorization, 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 void PayPalProfileSharingViewController (PayPalProfileSharingViewController profileSharingViewController, NSDictionary profileSharingAuthorization)
		{
			throw new NotImplementedException ();
		}
		public void UserDidCancelPayPalProfileSharingViewController (PayPalProfileSharingViewController profileSharingViewController)
		{
			throw new NotImplementedException ();
		}
 public void PayPalProfileSharingViewController(PayPalProfileSharingViewController profileSharingViewController, NSDictionary profileSharingAuthorization)
 {
     throw new NotImplementedException();
 }
 public void UserDidCancelPayPalProfileSharingViewController(PayPalProfileSharingViewController profileSharingViewController)
 {
     throw new NotImplementedException();
 }
 public void AuthorizeProfileSharing(Action onCancelled, Action<string> onSuccess)
 {
     OnCancelled = onCancelled;
     OnSuccess = onSuccess;
     var infoSet = new NSSet(
         Constants.kPayPalOAuth2ScopeOpenId.ToString(),
         Constants.kPayPalOAuth2ScopeEmail.ToString(),
         Constants.kPayPalOAuth2ScopeAddress.ToString(),
         Constants.kPayPalOAuth2ScopePhone.ToString()
     );
     var profileSharingViewController = new PayPalProfileSharingViewController(infoSet, _payPalConfig, new CustomAuthorizeProfileSharingDelegate(this));
     var top = GetTopViewController(UIApplication.SharedApplication.KeyWindow);
     top.PresentViewController(profileSharingViewController, true, null);
 }