Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tried to retrieve OrderContext before it was created. #223

Open
moisesaq opened this issue Mar 21, 2023 · 1 comment
Open

Tried to retrieve OrderContext before it was created. #223

moisesaq opened this issue Mar 21, 2023 · 1 comment

Comments

@moisesaq
Copy link

moisesaq commented Mar 21, 2023

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? 🙏🏽

@Suboforme
Copy link

i have the same problem,did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants