android-checkout-sdk
android-checkout-sdk copied to clipboard
Tried to retrieve OrderContext before it was created.
I'm integrating the SDK PayPal in my project but I'm having an issue 😞.
I start the checkout with orderId, but when I register the callbacks and call the approval.orderActions.authorize(in onApprove) I always get an error with this message
Error(message=Authorize order failed., reason=Authorize order response was not successful. Tried to retrieve OrderContext before it was created)
StartCheckout
PayPalCheckout.startCheckout(createOrder = CreateOrder { actions ->
actions.set("orderId")
})
Callbacks
PayPalCheckout.registerCallbacks(
onApprove = OnApprove { approval ->
approval.orderActions.authorize { result ->
Timber.e(":-> Authorize order result: $result")
}
},
onCancel = OnCancel {},
onError = OnError {}
)
I've been debugging, I found that SDK is not creating the OrderContext and that is why it's always throwing the exception OrderContextNotAvailableException.
Note: When I start the checkout with an order, it works fine.
Could someone help me with this issue please? 🙏🏽
i have the same problem,did you solve it?