Use reason_code instead of txn_type. - #6
Conversation
txn_type was not being returned when a refund was processed. This caused the condition to fail and the credit memo to be created. Using reason_code = 'refund' fixed the issue.
|
@andihan can you please test this and consider the different scenarios. i'm interested to know whether Paypal changed their API or what caused this issue to arise. thx. cc @aligentjim |
|
I should mention, this was for a partial refund. |
|
that's useful info, thanks @kpheasey - do you know if this changed recently? |
|
I only began using PayPal Express in November of 2014. Partial refunds were creating a credit memo and marking all items returned. Last week I finally looked for a solution and found this repository. After installing, I noticed it didn't work and found this problem. I can't say for certain when and if the PayPal callback changed, just that it was not being returned with my partial refunds. Only other piece of information that may be relevant is that the PayPal merchant is in the UK and taking orders from the US, EU, and UK. |
|
@jonpday I'll look into it. |
|
Hi @kpheasey , have you tried a full refund? Did a full refund return txn_type? |
|
I have not tried a full refund. Until I'm working for that client again, Maybe switching the conditional operand to an 'or' so that both can be
|
|
@kpheasey I placed an order via Paypal Express, and then issued a partial refund at Paypal side. (Did you do the same thing?) It is confirmed that there's no txn_type in the refund IPN, which I think is fine. However, I didn't see a credit memo created in Magento by the IPN. Instead, there was a comment added to the order (see below). IPN "Refunded". Refund issued by merchant. Registered notification about refunded amount of $16.00. Transaction ID: "6CX84106AFSD6981F". Credit Memo has not been created. Please create offline Credit Memo. I also tried full refund issued from Paypal. The IPN still didn't contain txn_type. Differently, it created a credit memo, added the following comment, and closed the order. IPN "Refunded". A reversal has occurred on this transaction because you have given the customer a refund. Registered notification about refunded amount of $184.99. Transaction ID: "9W67865ASDF36780U". |
txn_type was not being returned when a refund was processed. This caused the condition to fail and the credit memo to be created. Using reason_code = 'refund' fixed the issue.