"a task was canceled" using result = await CrossPayPalManager.Current.Buy ...

Hi,
When requesting a payment to be made through PayPal with PayPal.Forms with the line

result = await CrossPayPalManager.Current.Buy(items, deliveryFee, tax);

The line does not await and exits the method. After try-catching it seems it is throwing an error "the task was canceled" so we never get the result of the payment, but the PayPal plugin goes through the process of letting the user sign-in and submitting their payment.

This appears to be an Android-only issue, has anybody else had this issue and what is the solution?

Thanks,

Richard

Posts

  • mwagdymwagdy EGMember
    edited February 19

    Just Use This in MainActitvity.cs

        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);
            PayPalManagerImplementation.Manager.OnActivityResult(requestCode, resultCode, data);
        }
    
        protected override void OnDestroy()
        {
            base.OnDestroy();
            PayPalManagerImplementation.Manager.Destroy();
        }
    
Sign In or Register to comment.