qenta-cee / woocommerce-qcp

QENTA Checkout Page plugin for WooCommerce
https://www.qenta.com
GNU General Public License v2.0
9 stars 7 forks source link

Redirect at end of successful payment fails #51

Closed RosemariesBaby closed 3 years ago

RosemariesBaby commented 3 years ago

Prerequisites

Versions

WooCommerce version: 5.0 PHP version: 7.4.14

Issue

Problem description: Redirect at the end of the payment process does not work (confirm)

Steps to reproduce: Do a payment ;)

In fact I found out that in dispatch_callback() the check if ( isset( WC()->session->chosen_payment_method ) ) { does not work since the session does not contain this info (removing the data) (see below). So the code goes twice into the part where it deals with the response from the quenta-service (finding the order paid) and doesn't redirect.

Changing this to if ( isset( WC()->session->qenta_checkout_page_type ) ) {

works. So the issue is that the code doesn't match the session content. Whatever is the culprit ;) What's the best way to resolve this?

[_cookie:protected] => wp_woocommerce_session_f41695879b4eef32d5a1abb08aa40fda
...
    [_data:protected] => Array
        (
            [cart] => 
            [cart_totals] => 
            [applied_coupons] => a:0:{}
            [coupon_discount_totals] => a:0:{}
            [coupon_discount_tax_totals] => a:0:{}
            [removed_cart_contents] => a:0:{}
            [wc_notices] => a:0:{}
            [customer] =>             [wcpconsumerdeviceid] => 
            [qenta_checkout_page_idl] => 
            [qenta_checkout_page_eps] => 
            [qenta_checkout_page_type] => ccard
            [qenta_checkout_page_redirect_url] => 
        )

    [_dirty:protected] => 
jakubpolomsky commented 3 years ago

Hi!

This seems to be a relic from the past. Please do continue using your change, feel free to open a pull-request or please kindly wait for a new release. It will happen this week.

Thank you!

HMKnapp commented 3 years ago

Identical to internal issue No. QMP-49, will be handled in that branch.