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

SagePay Payment Issues #699

Open
XBS-Nathan opened this issue Sep 9, 2019 · 8 comments
Open

SagePay Payment Issues #699

XBS-Nathan opened this issue Sep 9, 2019 · 8 comments

Comments

@XBS-Nathan
Copy link

Currently we have an issue with people that are placing orders with Sagepay, when the user clicks the submit order button, the payment is taken from their account however the user is then redirected to a empty cart page. All paypal orders however seem to be fine and redirecting to the finishorder.php page.

We just updated to the latest SDK version however seem to be having this issue still, we only just gone live we the website about 2 weeks ago and been happening since we have gone live. Our checkout page that we created was based on the react sample.

Anyone else having this issue?

@lpschz
Copy link
Contributor

lpschz commented Sep 11, 2019

Our current Optimized One-Page Checkout uses Checkout SDK internally. We support SagePay and we haven't experienced this issue.

What we have done for SagePay is, we have added a beforeunload handler. A redirection happens automatically after submitting the order by the SDK and the shopper should not leave the page and wait until this redirection happens.

Might help if you can export a HAR file of your network activity for this scenario.

@XBS-Nathan
Copy link
Author

After looking into it further it does appear to be when we started to use 3D secure on all our transactions, during testing we didn't have this enabled.

So we believe it something to do with that functionality. We raised a ticket with BigCommerce to take a look at this for us, as the orders are being created and they are passing the 3D secure check, just for some reason after they input their 3D secure password it redirecting them to that empty cart page.

@XBS-Nathan
Copy link
Author

@capsula4 So quick update on this, Bigcommerce took a look at the API logs for us and mentioned that we didn't set a redirect URL, however I don't believe we do set one ourselves do we? thought all that was handled by the SDK. Also he mentioned that the store ID is not associated to the return URL. I've attached his screenshot here.

image

@lpschz
Copy link
Contributor

lpschz commented Sep 16, 2019

Once the customer pays using SagePay, we expect the customer to get redirected back to the checkout page. From the screenshots that you attached, it seems the flow behaves as expected. Customers access checkout.php.

However, checkout page should call the method CheckoutService#finalizeOrderIfNeeded().

One way to implement this is by, after loadingCheckout, just add something like

await CheckoutService.loadCheckout();
try {
    await CheckoutService.finalizeOrderIfNeeded()
} catch (error) {
    if (error.type !== 'order_finalization_not_required') {
        throw error;
    }
}

@XBS-Nathan
Copy link
Author

Thanks @capsula4 i will take a look at that, but not to sure if that going to work. I got HAR file together afterwards and it shows us that once 3D secure has been processed a POST request is made to the checkout.php file however in the response headers of that POST there is a redirect back to the cart.php page.

@lpschz
Copy link
Contributor

lpschz commented Sep 23, 2019

@XBS-Nathan any updates on how it went?

@XBS-Nathan
Copy link
Author

@capsula4 Nothing yet, been escalated further up the chain but it been a week since we heard anything.

We did try it on another store which was new and we had the same issue even with the react sample but i'm sure it just a implementation issue with the custom checkout and not with the sdk.

When trying the Optimized Onepage checkout, the user is redirected to /checkout and the custom implementation is redirected to /checkout.php so I'm not to sure if there a difference between the two but i'm sure the way it being handled is differently.

@lpschz
Copy link
Contributor

lpschz commented Sep 24, 2019

We might be adding examples using different payment providers to our SDK example checkout. Different payment methods require different flows so we understand the current example is insufficient. However, SagePay works good in our production checkout UCO, which is built on top of the Checkout SDK.

Feel free to reach out if you have got new findings.

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

No branches or pull requests

2 participants