Skip to content

Magento 2.4 only “Refund Offline” on credit memo using custom payment method

I’ve created a module to integrate clover payments via fiserv api, and everything works except the refund on credit memo, it only shows me the “Refund Offline” button, but the payment was made online!

The config for the method states it’s a gateway and is available for refunds, yet here we are.

It seems to be something to do with the magento RefundAdapter it passes $isOnline as false:

enter image description here

So in the payment model refund() method

if ($creditmemo->getDoTransaction()) {

Is null because of this $isOnline = false

Here is the config.xml:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <payment>
            <pillbox_fiserv_clover>
                <active>0</active>
                <model>PillboxFiservCloverPaymentsPaymentFiservCloverCard</model>
                <order_status>pending</order_status>
                <title>Clover Card Payment</title>
                <group>pillbox_group</group>
                <payment_action>authorize</payment_action>
                <fiserv_api_key></fiserv_api_key>
                <fiserv_api_secret></fiserv_api_secret>
                <fiserv_term_url></fiserv_term_url>
                <fiserv_method_url></fiserv_method_url>
                <challenge_window_size>04</challenge_window_size>
                <can_authorize_vault>1</can_authorize_vault>
                <can_capture_vault>1</can_capture_vault>
                <can_use_vault>1</can_use_vault>
                <can_use_checkout>1</can_use_checkout>
                <can_capture_partial>1</can_capture_partial>
                <can_authorize>1</can_authorize>
                <can_capture>1</can_capture>
                <can_use_internal>1</can_use_internal>
                <can_refund_partial_per_invoice>1</can_refund_partial_per_invoice>
                <can_refund>1</can_refund>
                <can_void>1</can_void>
                <can_cancel>1</can_cancel>
                <can_edit>1</can_edit>
                <can_review_payment>1</can_review_payment>
                <can_deny_payment>1</can_deny_payment>
                <environment>sandbox</environment>
                <is_gateway>1</is_gateway>
                <rest_key></rest_key>
                <active_3ds>1</active_3ds>
            </pillbox_fiserv_clover>
            <pillbox_fiserv_clover_vault>
                <active>0</active>
                <model>PillboxFiservCloverPaymentsPaymentFiservCloverCardVault</model>
                <title>Clover Saved Cards</title>
                <group>pillbox_group</group>
                <require_cvv>1</require_cvv>
                <active_3ds>1</active_3ds>
            </pillbox_fiserv_clover_vault>
        </payment>
    </default>
</config>