paypal / paypal-android

One merchant integration point for all of PayPal's services
Apache License 2.0
74 stars 41 forks source link

PayPal native payment doesn't call listener about success #178

Open emartynov opened 1 year ago

emartynov commented 1 year ago

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

sshropshire commented 1 year ago

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.

emartynov commented 1 year ago

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

sshropshire commented 1 year ago

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.

emartynov commented 1 year ago

@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.

MagedEldamasy commented 12 months ago

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)
        }
    }
emartynov commented 12 months ago

Yes, there is intent back called

MagedEldamasy commented 12 months ago

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

powerzd commented 7 months ago

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