New to the community? Welcome! Please read our Community Rules and Guidelines
If you want to report illegal content under the EU Digital Services Act, please do so here
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
I 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 :