2

I am creating a site where they only want to use paypal express checkout (using drupal 7 /Ubercart 3.1). The problem is that it doesn't display the taxes when processing the order. I know it doesn't have the address info when it goes to the express checkout but when it comes back, it adds the shipping price but no taxes. Is there a way to add the taxes in?

I have been through all the options and don't see anything related to this.

I have also tried modifying inside the paypal module itself:

In the function uc_paypal_ec_review_form_submit I see that they add the shipping info if it is not there but when I try to add taxes the same way, the tax functions don't work.

I do see the line "subtotal excluding taxes" which I believe is being generated by the taxes module but no tax is actually applied.

If I use the paypal standard checkout, the tax is applied once the address info is filled in.

Any help would be appreciated.

0

It seems that Ubercart doesn't set the billing address properly after making the API call. See uc_paypal.pages.inc around line 240.

The original snippet looked like this:

$order->delivery_street1 = check_plain($nvp_response['SHIPTOSTREET']);
$order->delivery_street2 = isset($nvp_response['SHIPTOSTREET2']) ? check_plain($nvp_response['SHIPTOSTREET2']) : '';
$order->delivery_city = check_plain($nvp_response['SHIPTOCITY']);
$order->delivery_zone = !empty($zone_id) ? $zone_id : 0;
$order->delivery_postal_code = check_plain($nvp_response['SHIPTOZIP']);
$order->delivery_country = !empty($country_id) ? $country_id : 840;

$order->billing_first_name = check_plain($nvp_response['FIRSTNAME']);
$order->billing_last_name = check_plain($nvp_response['LASTNAME']);
$order->billing_street1 = check_plain($nvp_response['EMAIL']);

You can see that the billing address is never added. I would assume that most people who experience this issue have the tax calculating by the user's state. Since there's no state, no tax is added. Since the billing address and delivery address will be the same on Paypal, simply add the delivery info into the billing info like so:

$order->billing_street1 = check_plain($nvp_response['SHIPTOSTREET']);
$order->billing_street2 = isset($nvp_response['SHIPTOSTREET2']) ? check_plain($nvp_response['SHIPTOSTREET2']) : '';
$order->billing_city = check_plain($nvp_response['SHIPTOCITY']);
$order->billing_zone = !empty($zone_id) ? $zone_id : 0;
$order->billing_postal_code = check_plain($nvp_response['SHIPTOZIP']);
$order->billing_country = !empty($country_id) ? $country_id : 840;

Hacking core/contrib modules like this sucks and I don't recommend it, but sometimes, you gotta do what you gotta do.

Enjoy your taxes!

  • Maybe you should submit a patch for the issue – Ismail Cherri Oct 30 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.