2

I am using Omnipay in a custom app. It works fine, but we need to add tax (VAT). Paypal's API paramaters for tax seem to have no effect.

I searched through the Omnipay Paypal code, and I cannot see any reference to tax.

Does Omnipay support adding tax for Paypal payments?

Leith
  • 3,139
  • 1
  • 27
  • 38
Laurence Cope
  • 403
  • 7
  • 20
  • What code are you using? What do you mean by "Paypal's API parameters for tax seem to have no effect" (which parameters, how are you using them)? – Adrian Macneil Apr 05 '14 at 01:58
  • I have come to the conclusion Omnipay does NOT support passing TAX to Paypal. There is NO reference to TAX in Omnipay's code. There is no reference to PAYMENTREQUEST_n_TAXAMT or TAXAMT or just the word "TAX" in its code. There are no values representing any of Paypal's API TAX variables. I have had to add this in myself in the code, although there is one issue not working I need to fix. – Laurence Cope Apr 05 '14 at 13:06
  • I am using code such as this on Github https://github.com/omnipay/omnipay. The Paypal code has no reference to tax in its code https://github.com/omnipay/paypal/search?q=tax&ref=cmdform. I find it quite unbelievable this software could have been created with no reference to something as important as tax (only needs a few more lines of code to pass these variables). If I get it working I'll post a solution on here. I am copying every reference of AMT to create a TAXAMT and ITEMAMT which are required to show the sub-total and tax, in addition to AMT (the total). – Laurence Cope Apr 05 '14 at 13:10
  • Paypal's tax handling is quite annoying so I don't personally use it (it's sometimes easier to create an extra line item to display the tax). You have to be absolutely sure the tax amounts in each line item add up to the tax total you supply, otherwise it won't work. That said, I'm happy to accept a pull request to add these parameters. – Adrian Macneil Apr 06 '14 at 01:59
  • @LaurenceCope did you manage to get your code working? I'm having same issue but don't know how to proceed. – Ant100 May 24 '15 at 18:28
  • I think I did but I did not document it at the time and was so long ago I can't remember. I think I had to modify the Omnipay core files to fix it. I can see I had to add a line to ExpressAuthorizeResponse.php, ExpressCompleteAuthorizeRequest.php, CaptureRequest.php and ProAuthorizeRequest.php $data['PAYMENTREQUEST_0_TAXAMT'] = $this->getTaxAmount(); Maybe if you email me www.amitywebsolutions.co.uk I can send you the Omnipay files and you can compare to the original ones on Github. – Laurence Cope May 26 '15 at 08:51

1 Answers1

1

At the time this question was posted, Omnipay/Paypal did not support tax amount parameters. It now does!

You can use setTaxAmount() if you need to adjust manually, or just pass taxAmount in with your parameters.

Leith
  • 3,139
  • 1
  • 27
  • 38