Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Tried to refund the shipping, but the entire amount got cancelled on the Credit Card #99

Open
jonathonbyrdziak opened this issue Oct 16, 2016 · 2 comments

Comments

@jonathonbyrdziak
Copy link

Found another issue. The last few credit memos we're issued for partial amounts have been refunding the entire order. Here are some examples to check out:

  • Tried to refund the shipping, but the entire amount got cancelled on the Credit Card
  • Same thing. Refund shipping = whole order got credited back
@jonathonbyrdziak
Copy link
Author

StackTrace

  1. In Hps_Securesubmit_Model_Paypal on line 241 you have $payment->getBaseTotalDue() == $amount, which will send a TRUE boolean to
  2. HpsAltPaymentService on line 80.

The receiving parameter on line 80 public function refund($transactionId, $isPartial = false, $partialAmount = null) is $isPartial, but $payment->getBaseTotalDue() == $amount, will only send TRUE if it is NOT partial.

I am just looking at the code and haven't tested this yet, but if I'm correct, it could be leading to the problem of refunding 100% of the order when I only wanted to partially refund the order.

I realize that this is related to the HPS Paypal and my original issue did not deal with paypal. I'm going to go look to see if this is the same with standard HPS payments.

@jonathonbyrdziak
Copy link
Author

XML

I've tested the standard payment direct post to Heartland. The xml that I'm sending over is correct according to your documentation.

<?xml version="1.0"?>
<hps:Transaction>
    <hps:CreditReversal>
        <hps:Block1>
            <hps:Amt>29.50</hps:Amt>
            <hps:AuthAmt>12.51</hps:AuthAmt>
            <hps:GatewayTxnId>1014062970</hps:GatewayTxnId>
            <hps:AdditionalTxnFields>
                <hps:Description>Customer IP Address: 127.0.0.1, User Agent:
                    Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:44.0) Gecko/20100101
                    Firefox/44.0</hps:Description>
                <hps:InvoiceNbr>100002793</hps:InvoiceNbr>
                <hps:CustomerID>[email protected]</hps:CustomerID>
            </hps:AdditionalTxnFields>
        </hps:Block1>
    </hps:CreditReversal>
</hps:Transaction>

Can you look into this and find out if your system is handling the refunds properly?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant