paypal / paypal-android

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

onPayPalWebSuccess never called #271

Open Jean-PhilippeDESCAMPS opened 1 month ago

Jean-PhilippeDESCAMPS commented 1 month ago

PayPal Android SDK Version

1.5.0

Environment

Sandbox

Android Version & Device

No response

PayPal dependencies

implementation("com.paypal.android:paypal-web-payments:1.5.0")
implementation("com.braintreepayments.api:browser-switch:2.3.1")

Describe the bug

I have added your SDK in my framework. Here some code where I init your sdk.

CheckoutFragment:

val coreConfig = CoreConfig(it.pluginResult.logs.clientId.orEmpty(), com.paypal.android.corepayments.Environment.SANDBOX)
                            payPalWebCheckoutClient = PayPalWebCheckoutClient(
                                requireActivity(),
                                coreConfig,
                                "eu.purse.sdk"
                            )
                            payPalWebCheckoutClient?.listener = this
                            payPalWebCheckoutRequest = PayPalWebCheckoutRequest(
                                it.pluginResult.logs.orderId.orEmpty(),
                                PayPalWebCheckoutFundingSource.PAYPAL
                            )

In the PayPal Button On Click Action :

if (payPalWebCheckoutClient != null && payPalWebCheckoutRequest != null) {
                        payPalWebCheckoutClient!!.start(payPalWebCheckoutRequest!!)
                    }

AndroidManifest File:

<activity
            android:name=".activity.PaypalActivity"
            android:exported="true">

            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
                <data android:scheme="eu.purse.sdk"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
            </intent-filter>

        </activity>

When PayPalWebCheckoutClient is starting. I can proceed to the payment. It coming back in my android app throught the PaypalActivity, and never come back in my Checkout Fragment.

To reproduce

It always waiting on the thanks to use Paypal screen.

Expected behavior

How Can I use the PayPal Listener and close automatically the web page ?

Screenshots

No response

warmkesselj commented 3 weeks ago

@Jean-PhilippeDESCAMPS have you had a chance to checkout our demo app? I've just run the PayPal Web feature and I'm getting a successful callback there.

Jean-PhilippeDESCAMPS commented 3 weeks ago

I will give it a try. Come back to you soon. Thanks