• Resolved lcsweden

    (@lcsweden)


    When I cancel from the Swish app, I’d expected the order to be cancelled, or just be taken back to the checkout page. Instead, I get a message saying “Payment declined” and the order is stuck as “Pending payment”.

    Is it possible to just send the user back to the checkout, so that they can retry? As it is, those orders would have to be manually deleted, and the customer would have to start over with an empty cart.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author bjorntech

    (@bjorntech)

    Hello,

    I agree that this would be the natural way for the plugin to work. This is unfortunately very difficult to achieve due to current functionality in WooCommerce and Swish. If the technical situation changes we will implement it this way.

    /tobbe

    Thread Starter lcsweden

    (@lcsweden)

    That’s a shame, but I really appreciate the quick answer!

    Has anyone looked at workarounds?

    I’m new to Woocommerce, but am from a developer/systems background. My thoughts are that the order could be picked up from the database, and details emailed to the customer, maybe with a link that lets them resume?

    Maybe there’s even cart abandonment plugins that handle exactly this kind of issue?

    Thread Starter lcsweden

    (@lcsweden)

    BTW, feels weird to writing in English when there’s probably only swedes looking at this, but all other threads were in English so I just went with the flow… 😀

    Plugin Author bjorntech

    (@bjorntech)

    Hej,

    Jo, det blir ju lätt så att man skriver på Engelska här.

    Det går så klart att få till, det är ju bara programmering 🙂 men det det finns också andra parametrar att ta hänsyn till.

    Min bedömning har varit att det skulle göra väldigt mycket våld på WooCommerce om man gör detta, det blir då mycket underhåll och testande för att hålla lösningen vid liv när WooCommerce allteftersom förändras.

    I grunden handlar det om att Swish har ett helt annat processflöde än en kortbetalning. De närmar sig däremot varandra i och med att kort numera många gånger också kräver en användar-interaktion i form av att godkännas med bankid eller liknande innan själva betalningen genomförs.

    Men som sagt, håller med dig i sak och har frågan på radar.

    /tobbe

    • This reply was modified 5 years, 9 months ago by bjorntech.
    Thread Starter lcsweden

    (@lcsweden)

    Min tanke är att hålla koll på vad som ligger i korgen, vilket ju är enkeltmed hjälp av WC()->cart. Detta skulle kunna sparas i en egen cookie, som inte rörs av WC.

    Denna information kan sedan stoppas tillbaka för att återfylla korgen vid behov. Verkar funka att göra med WC()->cart->add_to_cart(produktid, antal, variationsid).

    Detta borde säkert göras som en plugin, och blir kanske inte korrekt enligt WP/WC standard, men jag tänker mig att det blir lätt att peta in relevant kod med hjälp av pluginet “Theme Customisations” som redan används för andra småfix.

    Jag har lite annat som skall fixas på siten först, men kommer nog ta tag i detta ordentligt under veckan.

    • This reply was modified 5 years, 9 months ago by lcsweden.
    Thread Starter lcsweden

    (@lcsweden)

    @bjorntech Finns det något javascript event jag kan lyssna efter för att se när betalningen är färdig eller avbruten?

    Thread Starter lcsweden

    (@lcsweden)

    I was able to solve this is a fairly simple plugin.

    In short, I store a copy of the cart contents in LocalStorage in the browser, and then restore it if detecting a failed Swish payment. This is done via javascript that looks at the server status, and makes an ajax request back to WP to add items back to cart.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Status after cancelled payment’ is closed to new replies.