rhyswynne / easy-digital-downloads-taxamo-integration

Integrate Taxamo into Easy Digital Downloads. Make yourself Compatible with the VATMOSS EU Legislation
2 stars 6 forks source link

Warning on Refund #24

Closed rhyswynne closed 9 years ago

rhyswynne commented 9 years ago

@NateWr reported this on #1 :-

I just tried to process a refund and got a PHP Warning:

Warning: Invalid argument supplied for foreach() in /home/themes/public_html/wp-content/plugins/taxamo-edd-integration/taxamo-edd-integration.php on line 776

Note that my copy is slightly out of date with master. It's pointing at what is now line 786.

foreach ( $taxamo_transaction_lines as $taxamo_transaction_line ) {

This refund was for a payment without any Taxamo transaction info, so probably need to check the transactions that taxamo is returning there. I'm into something else at the moment so can't look into this right away.

Sticking it on it's own ticket as it'll remind me to take a look at it :)

rhyswynne commented 9 years ago

Hi @NateWr,

Quick question regarding this, was this refunded on an order that was made before Taxamo was implemented?

I created an extra field in the payment_meta which is 'taxamo_transaction_lines', which would suggest that with your error it isn't there.

I think.....

rhyswynne commented 9 years ago

I'm unable to replicate this on a test enviroment, so am just guessing.

NateWr commented 9 years ago

Yeah, this was a purchase made before Taxamo was implemented, so wouldn't have any data associated with it. Maybe you can replicate just by deactivating the plugin and making a purchase?

rhyswynne commented 9 years ago

Replicated - take a look at https://github.com/rhyswynne/easy-digital-downloads-taxamo-integration/commit/345aa9d95734d4fda97d0d76824ebec326a3c3b3, that should fix this issue.

rhyswynne commented 9 years ago

Happy this is fine now. Closing it