redsmartie Posted May 24, 2011 Share Posted May 24, 2011 I am trying to refund a payment via Paypal using the Refund Total Transaction button. I have used this successfully before to the account I am trying to refund to but I am now getting an error:Error from PayPal: The partial refund must be the same currency as the original transaction (#10009)The full message is:At 2011-05-17 08:59:46 from Private:Refund operation result:TIMESTAMP: 2011-05-17T07:59:46ZCORRELATIONID: 884e643979fcfACK: FailureVERSION: 60.0BUILD: 1882144L_ERRORCODE0: 10009L_SHORTMESSAGE0: Transaction refusedL_LONGMESSAGE0: The partial refund must be the same currency as the original transactionL_SEVERITYCODE0: ErrorTransaction error!The payment and refund are in pounds sterling.Thanks, Martin Link to comment Share on other sites More sharing options...
larsodius Posted May 25, 2011 Share Posted May 25, 2011 same error as above for meusing 1.4.1 prestashop and included paypal modulecredit payments, paypal account balance and prestashop in GBP. Also tried to refund euro payment with same error.Am going to check the code to see what is supposed to be happening. Link to comment Share on other sites More sharing options...
november Posted June 25, 2011 Share Posted June 25, 2011 I've just had the same problem. Did anyone find a solution? Link to comment Share on other sites More sharing options...
guitar Posted June 28, 2011 Share Posted June 28, 2011 anyone made any progress on this? I've got the same issue. Link to comment Share on other sites More sharing options...
findsolution Posted July 2, 2011 Share Posted July 2, 2011 Got the same issue with 1.4.3 on US Dollars. Any solutions? Link to comment Share on other sites More sharing options...
moony1234 Posted July 24, 2011 Share Posted July 24, 2011 Bump... Link to comment Share on other sites More sharing options...
FireHawk Posted August 5, 2011 Share Posted August 5, 2011 I have the same error. Using PS 1.4.3 Paypal module 2.6 All currencies in GBP so it should work but it doesn't. Link to comment Share on other sites More sharing options...
James Lawrence Posted August 13, 2011 Share Posted August 13, 2011 I've had this bug for a while now, the fix for the currency bug is to change the SQL query in _makeRefund (the one included with Prestashop doesn't actually work, it always selects EURO). However to apply this fix you'll need experience in PHP as you'll also have to change the parameter of _makeRefund to $id_order instead of $id_transaction and then change all invocations of _makeRefund. There's even more problems with regards to calculating the total refund amount. As it is configured at the moment it can skip some products, it skips discounts (meaning it can try to refund too much!) and it also misses wrapping if enabled (this particular bug can be spotted in _doTotalRefund, near line 1029). This module is so buggy I think the prestashop dev. team need to take a better look at it! Enough rambling, here is my modified line from _makeRefund in /modules/paypal/paypal.php (near the bottom): $isoCurrency = Db::getInstance()->getValue(' SELECT `iso_code` FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'currency` c ON (o.`id_currency` = c.`id_currency`) WHERE o.`id_order` = '.$id_order); you'll also need to insert $id_transaction = $this->_getTransactionId($id_order); somewhere near the top of this function. Then to change the invocations, two invocations are a little bit futher down in _doTotalRefund (with the incorrect total refund calculation code) and the other invocation is within hookCancelProduct (line 357). My (semi-)fixed refund calculation code is as below: // Amount for refund $amt = 0.00; foreach ($products AS $product) $amt += ($product['product_quantity'] - $product['product_quantity_refunded'])*(float)($product['product_price']); $amt += (float)($order->total_shipping); $amt -= (float) $order->total_discounts; $amt -= (float) $order->total_wrapping; // check if total or partial if (round($order->total_paid_real,2) == round($amt,2)) $response = $this->_makeRefund($id_order, $id_transaction); else $response = $this->_makeRefund($id_order, $id_transaction, (float)($amt)); I really hoped these bugs would have been fixed in 1.4.4, but no such luck I'm afraid, they both got through! I hope this code helps Link to comment Share on other sites More sharing options...
Mephivio Posted August 15, 2011 Share Posted August 15, 2011 Dear Prestashop Team, Could please check this Paypal 2.6 module and correct the refund fucntion witch doesn't work ! Thanks Regards Link to comment Share on other sites More sharing options...
colorsofwind Posted September 5, 2011 Share Posted September 5, 2011 I did what you said and got error : 'Fatal Error: id_transaction is null' I took a look, in line 364, the parameter for _makeRefund() should be $order->id instead of $id_order then your solution is perfect for the problem of non-Euro transaction refund! I tested it, it works now! Thank you! I am trying to customize more like partial refund, I think that is what a lot of shopper owner needs. I did not find any solutions now so I will make a try myself. I've had this bug for a while now, the fix for the currency bug is to change the SQL query in _makeRefund (the one included with Prestashop doesn't actually work, it always selects EURO). However to apply this fix you'll need experience in PHP as you'll also have to change the parameter of _makeRefund to $id_order instead of $id_transaction and then change all invocations of _makeRefund. There's even more problems with regards to calculating the total refund amount. As it is configured at the moment it can skip some products, it skips discounts (meaning it can try to refund too much!) and it also misses wrapping if enabled (this particular bug can be spotted in _doTotalRefund, near line 1029). This module is so buggy I think the prestashop dev. team need to take a better look at it! Enough rambling, here is my modified line from _makeRefund in /modules/paypal/paypal.php (near the bottom): $isoCurrency = Db::getInstance()->getValue(' SELECT `iso_code` FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'currency` c ON (o.`id_currency` = c.`id_currency`) WHERE o.`id_order` = '.$id_order); you'll also need to insert $id_transaction = $this->_getTransactionId($id_order); somewhere near the top of this function. Then to change the invocations, two invocations are a little bit futher down in _doTotalRefund (with the incorrect total refund calculation code) and the other invocation is within hookCancelProduct (line 357). My (semi-)fixed refund calculation code is as below: // Amount for refund $amt = 0.00; foreach ($products AS $product) $amt += ($product['product_quantity'] - $product['product_quantity_refunded'])*(float)($product['product_price']); $amt += (float)($order->total_shipping); $amt -= (float) $order->total_discounts; $amt -= (float) $order->total_wrapping; // check if total or partial if (round($order->total_paid_real,2) == round($amt,2)) $response = $this->_makeRefund($id_order, $id_transaction); else $response = $this->_makeRefund($id_order, $id_transaction, (float)($amt)); I really hoped these bugs would have been fixed in 1.4.4, but no such luck I'm afraid, they both got through! I hope this code helps Link to comment Share on other sites More sharing options...
mojpoj Posted September 12, 2011 Share Posted September 12, 2011 Also getting this error from paypal. Not sure why. US Dollars. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now