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

Refreshing/reloading the order confirmation page voids order #84

Open
moorena opened this issue Nov 14, 2024 · 2 comments
Open

Refreshing/reloading the order confirmation page voids order #84

moorena opened this issue Nov 14, 2024 · 2 comments

Comments

@moorena
Copy link

moorena commented Nov 14, 2024

server.use('Confirmation', function (req, res, next) {
var checkoutToken = request.httpParameterMap.checkout_token.stringValue;
try {
var basket = BasketMgr.getCurrentOrNewBasket();
if (affirm.data.getAffirmVCNStatus() != 'on') {

If your customer completes checkout and gets the order confirmation page, and then refreshes it, we re-enter this controller.

The basket will be empty (since the code calls getCurrentOrNewBasket) but the checkout token is still valid, and eventually, the checkCart → syncBasket → checkTotalPrice call chain will fail because the basket total is $0 but the authorized amount was whatever the posted order is.

That leads the code to call the Affirm void service to void the Affirm transaction. (and does not do any updates to the SFCC order)

Since we're only doing AUTH (capture is done later during fulfillment), when we go to capture payment, it fails (404/not found) because the transaction was voided on Affirm's side.

@moorena
Copy link
Author

moorena commented Nov 14, 2024

Unsure of the way to fix: should it call getCurrentBasket instead and fail is there is none ?

@justin-cateron-kreg
Copy link

We are having the same issue. If someone refreshes the page or if they visit a different page and then click the back button, it will "Void" the order.

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