• Resolved chrismask

    (@chrismask)


    Hi,

    I use the plugin only for Revolut Pay method, which works well, but there is a missing thing which may create incompatibilities with other plugins and code. Almost all wc payment methods, add _payment_method and _payment_method_title in their order data, but this Plugin seems not to. I have checked all my revolut orders in the db and neither of these two seem to be added. Looking at your code, the place i found responsible for adding payment method title only looks for Apple and Google pay method (?) and thus doesnt add it for Revolut Pay. Here is the function:

    protected function update_payment_method_title( $revolut_order_id, $wc_order ) {
    try {
    if ( ‘revolut_payment_request’ !== $this->id ) {
    return;
    }
    $revolut_order = $this->api_client->get( ‘/orders/’ . $revolut_order_id );
    $revolut_order_total = $this->get_revolut_order_amount( $revolut_order );
    $revolut_order_currency = $this->get_revolut_order_currency( $revolut_order );

            if ( empty( $revolut_order_total ) || empty( $revolut_order_currency ) ) {
                /* translators: %s: Revolut order id. */
                $wc_order->add_order_note( sprintf( __( 'Can\'t retrieve payment amount for this order. Please check your Revolut Business account (Order ID: %s)', 'revolut-gateway-for-woocommerce' ), $revolut_order_id ) );
                return;
            }
    
            if ( ! isset( $revolut_order['payments'][0]['payment_method']['type'] ) || empty( $revolut_order['payments'][0]['payment_method']['type'] ) ) {
                return;
            }
    
            $payment_method = $revolut_order['payments'][0]['payment_method']['type'];
    
            if ( 'APPLE_PAY' === $payment_method ) {
                $payment_method_title = 'Apple Pay (via Revolut)';
            } elseif ( 'GOOGLE_PAY' === $payment_method ) {
                $payment_method_title = 'Google Pay (via Revolut)';
            } else {
                $payment_method_title = $this->title;
            }
    
            $wc_order->set_payment_method_title( $payment_method_title );
            $wc_order->save();
        } catch ( Exception $e ) {
            $this->log_error( $e->getMessage() );
        }
    }

    This may lead to problems with other plugins code since woocommerce expects the payment method to be set on orders.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support businessrevolutsupport_cornel

    (@businessrevolutsupportcornel)

    Hello,

    Thank you for pointing this out. I will bring this up with our developers so they can assess your proposal.

    Kind regards,

    Thread Starter chrismask

    (@chrismask)

    As it seems, i found a big problem due to the absence of _payment_method and _payment_method_title. I cannot refund the order. When trying to programmatically refund the order, it fails saing no payment method found for the order (woocommerce doesnt know which payment method to refund with), and when trying to refund it from woocommerce dashboard, no Refund via Revolut button is displayed, as the revolut documentation says that should happen for wc: https://developer.revolut.com/docs/guides/accept-payments/plugins/woocommerce/features Probably due to the same reason. So this needs to be fixed ASAP.

    Plugin Support businessrevolutsupport_cornel

    (@businessrevolutsupportcornel)

    Hello,

    Refunds are working from the WooCommerce -> orders dashboard. Not sure how you are handling it. We just tested.

    Please reach out to our in App Help section,?as to further assist you, we would need some sensitive information which should not be shared on a public forum.

    Follow these steps to reach out to our help section:

    – Open the Revolut Business App

    – Click on your account name on the top left of your screen.
    – Open “Help” section.
    – Scroll down until you see “Chat” option.
    – Click on “Start new chat” (chat bubble icon)

    Kind regards,

    Thread Starter chrismask

    (@chrismask)

    Just to note, I only use Revolut Pay. It doesnt work on this, neither programmatically, woocommerce implying that it the order hasnt got any payment_method attached to it so it doesnt know which one to refund with, and on wordpress dashboard, there is no button Refund via Revolut or something at all (probably due to the same reason). Can you test with Revolut Pay and attach a screenshot?

    Thread Starter chrismask

    (@chrismask)

    Note that neither this nor the HPOS compatibility issues i have opened are resolved on code. These have to be fixed by the engineering team on next updates. Refunds on Revolut Pay and Woocommerce HPOS compatibility dont work!

    Plugin Support businessrevolutsupport_cornel

    (@businessrevolutsupportcornel)

    Hello,

    The HPOS compatibility is currently being scoped and prioritised. We do not have an ETA yet but it is surely coming.

    Regarding refunds, when opening the order details, in the bottom left corner, you will see a refund button. Once you click it, you will be able to choose the item you wish to refund. Finally, click on refund via Revolut Gateway – Revolut Pay.

    After refund is successful, you will see a note added to the order on the panel to your right.

    Kind regards,

    Thread Starter chrismask

    (@chrismask)

    Thank you for your answer, as it seems, the problem shall be because of order-pay checkout template and not the default checkout with cart, because it doesnt add the revolut-pay payment method meta on order and thus woocommerce doesnt understand which payment method the order was from in order to refund it with the same. It doesnt even have the “Payment via Revolut Pay” label on top of the order page. As i told you, i have no refund with revolut pay button on order refund dashboard, for the reason i told you. Can you test it on your end, on the order-pay (form-pay.php template) checkout apart from the regular checkout?

    • This reply was modified 1 year, 2 months ago by chrismask.
    • This reply was modified 1 year, 2 months ago by chrismask.
    Plugin Support businessrevolutsupport_cornel

    (@businessrevolutsupportcornel)

    Hello,

    I am afraid we only test for the standard checkout. When customising your website or choosing templates/themes that alter the standard checkout flow or other standard processes, please take into consideration, this might disrupt some functionalities.

    Kind regards,

    Thread Starter chrismask

    (@chrismask)

    Ι haven’t altered anything, the pay for order part of checkout is a woocommerce default template and many stores use it, the payment methods are the same and must be also compatible with it. It’s the form-pay.php template of /checkout/ folder in woocommerce. What’s missing on your end is that it doesn’t add the payment method and payment method title on order meta data as it should.

    Thread Starter chrismask

    (@chrismask)

    Hi, can you fix it for the also woocommerce default: Pay for order checkout? It doesnt add the payment methods on order metadata thus the refunds dont work since order doesnt have any payment method attached.

    Plugin Support businessrevolutsupport_cornel

    (@businessrevolutsupportcornel)

    Hi @chrismask ,

    Our developer checked what you reported but did not spot any issue on our side. In order to understand what is happening with your shop we would require you to share sensitive information that should not be shared on a public forum.

    Please reach out to our support channel and ask for your case to be escalated.

    Follow these steps to reach out to our help section:

    – Open the Revolut Business App

    – Click on your account name on the top left of your screen.
    – Open “Help” section.
    – Scroll down until you see “Chat” option.
    – Click on “Start new chat” (chat bubble icon)

    Kind regards,

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Not _payment_method added on order meta’ is closed to new replies.