• 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 4 years, 2 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 4 years, 2 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.