cancel
Showing results for 
Search instead for 
Did you mean: 

Paypal android checkout sdk gives invalid scope in live mode

Options
Posted on

Hi community, I am developing an android application which includes in-app Paypal payments for buying coins.

I am using the official sdk https://github.com/paypal/android-checkout-sdk  with latest version 0.3.0.

I am facing the following error when clicking Paypal Button in LIVE mode

Screenshot_2021-07-06-12-51-15.pngI have the following configuration in my code

 

 

 

 

val environment: Environment = if (resources.getBoolean(R.bool.production)) Environment.LIVE else Environment.SANDBOX
        val config = CheckoutConfig(
                this,
                getString(R.string.paypal_client_id), environment,
                "by.the.way://paypalpay", CurrencyCode.USD, UserAction.PAY_NOW,
                SettingsConfig(
                        true,
                        false
                )
        )
        setConfig(config)

 

 

 

 

 

This is the code for buying coins:

 

 

 

 

btnPaymentPayPal.setup(object : CreateOrder {
            override fun create(createOrderActions: CreateOrderActions) {
                val purchaseUnits = ArrayList<PurchaseUnit>()
                purchaseUnits.add(
                        PurchaseUnit.Builder()
                                .amount(
                                        Amount.Builder()
                                                .currencyCode(CurrencyCode.USD)
                                                .value(coinsPakageModel.price.toString())
                                                .build()
                                )
                                .description(coinsPakageModel.name)
                                .build()
                )
                val order: Order = Order.Builder().appContext(
                        AppContext.Builder()
                                .userAction(UserAction.PAY_NOW)
                                .build()
                ).intent(OrderIntent.CAPTURE)
                        .purchaseUnitList(purchaseUnits).build()
                createOrderActions.create(order)
            }
        },
                object : OnApprove {
                    override fun onApprove(approval: Approval) {
                        approval.orderActions.capture(object : OnCaptureComplete {
                            override fun onCaptureComplete(result: captureOrderResult) {
                              //...
                            }
                        })
                    }
                },
                object : OnCancel {
                    override fun onCancel() {
                        //...
                    }
                },
                object : OnError {
                    override fun onError(errorInfo: ErrorInfo) {
                        //...
                    }
                }
        )

 

 

 

 

 

And this is my Paypal Configuration in developers dashboard. My account is a business account :

javierfiguerasm_0-1626812684530.png

 

javierfiguerasm_1-1626812818709.pngjavierfiguerasm_2-1626812842945.pngHere I can only check Full name information.Here I can only check Full name information.

 

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.