paypal-android icon indicating copy to clipboard operation
paypal-android copied to clipboard

PayPal native payment doesn't call listener about success

Open emartynov opened this issue 2 years ago • 8 comments

PayPal Android SDK Version

0.0.11

Environment

Sandbox

Android Version & Device

Android 14

PayPal dependencies

implementation "com.paypal.android:paypal-native-payments:0.0.11"

Describe the bug

BTW, I see the same with 0.0.10 version.

The native Paypal client doesn't call the listener with the successful payment. In addition, the Paypal card payment client does inform the listener about successful payment.

To reproduce

  1. Integrate the PayPal native client
  2. Launch native payment
  3. Finish PayPal login and approve payment
  4. Get redirected to the app and see the waiting spinner in the app

Expected behavior

  1. The listener is notified of the successful payment

Screenshots

No response

emartynov avatar Aug 15 '23 12:08 emartynov

Hi @emartynov I'm unable to reproduce on a Pixel 6 Pro running Android 13. What kind of device (or emulator) are you using, along with OS version? I can try to replicate by aligning my environment with your setup.

sshropshire avatar Aug 15 '23 15:08 sshropshire

It is an API 34 emulator. Not sure if it matters.

emartynov avatar Aug 15 '23 15:08 emartynov

I was able to complete the PayPal native flow successfully on an API 34 emulator. Can you share how you're instantiating the PayPalNativeCheckoutClient and setting the listener? Also I wonder if there may be some misalignment between the return URL registered in the AndroidManifest.xml and the return url passed to the PayPalNativeCheckoutClient constructor.

sshropshire avatar Aug 15 '23 16:08 sshropshire

@sshropshire just to confirm your flow completely replies to the callback from the client and doesn't do anything with deep link except it is mentioned in the manifest to get relaunched after the flow if needed.

emartynov avatar Aug 15 '23 20:08 emartynov

same problem , any solution for this problem @emartynov

the instantiating of PayPalNativeCheckoutClient

var coreConfig = CoreConfig( AppConstants.clientIDPaypal, environment = Environment.SANDBOX ) var payPalNativeClient = PayPalNativeCheckoutClient( application = this.application, coreConfig = coreConfig, returnUrl = AppConstants.returnUrl,

        )

payPalNativeClient.listener = object : PayPalNativeCheckoutListener { override fun onPayPalCheckoutCanceled() { println("hhhh cancel") }

        override fun onPayPalCheckoutFailure(error: PayPalSDKError) {
            println("hhhh " + error.message)
        }

        override fun onPayPalCheckoutStart() {
            // the PayPal paysheet is about to show up
            println("hhhh Start")
        }

        override fun onPayPalCheckoutSuccess(result: PayPalNativeCheckoutResult) {
            println("hhhh Success" + result)
        }
    }

MagedEldamasy avatar Oct 28 '23 08:10 MagedEldamasy

Yes, there is intent back called

emartynov avatar Oct 28 '23 19:10 emartynov

thanks for reply to me ,please can you share with me the solution , with me not return to Success call back ,it keep loading with no response and when cancel it return to cancel callback , not open PayPal sheet @emartynov @sshropshire

MagedEldamasy avatar Oct 28 '23 21:10 MagedEldamasy

I have the same problem and I haven't found a solution yet

powerzd avatar Mar 11 '24 07:03 powerzd