Jump to content

Resolve Module Conflict With Paypal Europe


babyewok

Recommended Posts

I have this module:  http://addons.prestashop.com/en/pricing-promotion-prestashop-modules/20420-free-or-fixed-shipping-module.html (Free or Fixed Shipping)

 

I have worked really hard with the developer to finally get it working how I need it to and have found in the last hour that it confilcts with the PayPal module.  I have PS 1.6.1.1 and PayPal 3.10.2.

 

What happens is the order is all placed and correctly taken by PayPal (although sometimes the item decsription in PayPal is random and not even related to the same shop!) and the correct payment is taken from PayPal.  However, only one item (no matter how many were ordered) is shown in the Prestashop back office and there is a payment error saying that the amount taken by PayPal (for all items) is more than that shown in the BO (for just the one item).

 

I contacted the PayPal developer who said the issue is down the above shipping module.  Although the shipping module developer seemed helpful at first, they have gone worryingly quiet on me now and I can only contact them through the addons site. I have asked the PayPal developer if they can pinpoint the conflict to give the other module developer a nudge in the right direction, but they said only this so far:

 

"Our module uses a function that free shipping module uses too.

 

Therefore there is a conflict between the two modules.

 

We shared to PrestaShop the problem for they corrects

 

But I can not tell you when it will bring the fix.

 

Pending the only possible solution is to disable freeshipping module."

 

Not partucularly helpful. I have asked them to clarify what function, but I am still waiting on a response.  The shipping module overrides the cart.php class - don't know if that is where the conflict lies.

 

I am at a real loss as to what to do as the shipping module is really essential to the shop and was the only way I could get around a complex shipping setup! 

 

As I said, the module developer has gone worryingly quiet so I am putting my feelers out to see if anyone could give me a quote to resolve the conflict.

 

It is a paid for module so I cannot upload the files on the forum.

Link to comment
Share on other sites

  • 2 weeks later...

The situation with this has changed slightly.  The module developer resurfaced and as he has fixed one issue, at each turn another seems to arise! 

 

The current situation is that in certain instances, PayPal seems to have the correct shipping price on the PayPal payment page, but then when sent back to the site, the total is incorrect on the payment success page.  The back office shows the correct total, but shows the PayPal payment as beiing split into two payments,  In sandbox mode, the notification to the buyer shows the incorrect total.

To explain, the shipping module adds a set shipping price per item for some products e.g £15 per dress purchased.  We also use the PS carrier weight bands to deal with other products, so we might have one dress (shipping £15 as set by the module) and one other item with shipping £8.95 (as set by PS carrier weight bands).  The total shipping should be £23.95 (£15 + £8.95).

If an order consists of only items whose shipping is dealt with by the module, then everything is fine.  If it consists of only items whose shipping is dealt with by PS, everything is fine.  The problem arrises when the two shipping calculations are combined.  When returning from PayPal, the payment success page shows the order total minus the £8.95 shipping.  The order page in BO shows the full correct total, but the payment is shown as split (see attached screenshot).  Interestingly the second payment amount is £8.95 - the shipping amount set by PS.  This amount is also not included on the sandbox notification which shows the shipping total as just £15.

 

The shipping module developer seems to think this is unique to my installation as when tested on their own installation they don't get an issue.

I am getting frustrated with the very slow responses from the developer and am not confident that this will be resolved.

I seek a developer who can find the cause of this issue and resolve it.

post-23454-0-24582300-1453245120_thumb.jpg

Link to comment
Share on other sites

I have employed a devloper via peopleperhour.com to work on this for me, but I am concerned that they seem to be dragging their feet. They keep saying that they are 'researching' the issue and then not actually coming back with anything solid. There are also times when it seems I am doing their job for them!

 

I have found out a bit more info on this issue and am looking into the possibility that I may have to find a developer elsewhere who is more capable. The whole point of employing someone else was to benefit from their knowledge of prestashop so that they could target the problem quickly. At the moment this is not happening and I am sat twiddling my thumbs wondering if this issue will actually be resolved to a satifactory level.

 

So, the latest info is (that I have managed ot figure out myself - God knows what they've been doing as I think I was looking in a pretty obvious place!).....

 

All works correctly with the Express 3 step Checkout enabled under PayPal module configuration settings. However, I do not want to use this for a number of reasons I shan't go into now. I would like to get this working with standard payments. Confusingly I have seen that the info sent to PayPal with standard payments seems to mention express checkout anyway....but I digress.

 

For example purposes, the shop has a jacket for which shipping is handled via the PS Carrier weight bands. It also has a dress for which shipping is dealt with by the Shipping Module.

 

So, I placed an order for just the jacket (PS Shipping). I had cleared out the paypal api/results.txt so I could see clearly. After completing payment and getting the usual split payment mentioned before, I looked at results.txt (attached) and saw the SetExpressCheckout, GetExpressCheckoutDetails AND DoExpressCheckoutPayment all showed PAYMENTREQUEST_0_SHIPPINGAMT=8.95 which is correct.

 

When I tried to order a dress and a jacket, (PS carrier and shipping module so shipping shoud be £30+£8.95 £38.95), the SetExpressCheckout and GetExpressCheckoutDetails show PAYMENTREQUEST_0_SHIPPINGAMT=38.95 but the DoExpressCheckoutPayment shows PAYMENTREQUEST_0_SHIPPINGAMT=30.00 !!

 

This is where the problem lies - the wrong info is being sent to PayPal - for some reason in this case, the SetExpressCheckout and DoExpressCheckoutPayment are different. If we can find the cause of this then we can resolve the issue using Standard payments.

I have seen similar a similar issue: https://www.prestashop.com/forums/topic/325015-paypal-shipping-cost-problem/ where PayPal have said it is all down to the info being sent to PayPal from Prestashop.

 

In modules/paypal/express_checkout/process.php you can seehow those details are obtained:

public function setExpressCheckout($access_token = false){$this->method = 'SetExpressCheckout';$fields = array();$this->setCancelUrl($fields);// Only this call need to get the value from the $_GET / $_POST arrayif (!$this->initParameters(true) || !$fields['CANCELURL'])return false;// Set payment detail (reference)$this->_setPaymentDetails($fields);$fields['SOLUTIONTYPE'] = 'Sole';$fields['LANDINGPAGE'] = 'Login';// Seller informations$fields['USER'] = Configuration::get('PAYPAL_API_USER');$fields['PWD'] = Configuration::get('PAYPAL_API_PASSWORD');$fields['SIGNATURE'] = Configuration::get('PAYPAL_API_SIGNATURE');if ($access_token)$fields['IDENTITYACCESSTOKEN'] = $access_token;if (Country::getIsoById(Configuration::get('PAYPAL_COUNTRY_DEFAULT')) == 'de')$fields['BANKTXNPENDINGURL'] = 'payment.php?banktxnpendingurl=true';$this->callAPI($fields);$this->_storeToken();}public function getExpressCheckout(){$this->method = 'GetExpressCheckoutDetails';$fields = array();$fields['TOKEN'] = $this->token;$this->initParameters();$this->callAPI($fields);// The same token of SetExpressCheckout$this->_storeToken();}public function doExpressCheckout(){$this->method = 'DoExpressCheckoutPayment';$fields = array();$fields['TOKEN'] = $this->token;$fields['PAYERID'] = $this->payer_id;if (Configuration::get('PAYPAL_COUNTRY_DEFAULT') == 1)$fields['BANKTXNPENDINGURL'] = '';if (count($this->product_list) <= 0)$this->initParameters();// Set payment detail (reference)$this->_setPaymentDetails($fields);$this->callAPI($fields);$this->result += $fields;}
So, this issue only occurs when the shipping module is used in conjuction with the PS shipping to calculate a total shipping cost. If just a PS carrier item is purchased, or just a shipping module item all is fine - it is when they are purchased togther that we get an issue.

 

I put this to the shipping module developer who said just this:

 

"our module does not modify de paypal process. The freeshipping.php file, saves in cache the products that have a "special shipping" configured in the module. Then the Cart.php file in override, changes the shipping amount calculation, by removing this products from then shipping amount calculations, and adding the special shipping amount (if not set to be free) stored in cache. So the total amount returned by the function is the calculated for the "normal" products, and the "calculated " from out modue."

The files he is referring to are both in the shipping module. Since it is a paid module, I cannot share publicly, but I can PM anyone the module files for assessment.

 

The site uses one page guest only checkout.

 

I seem to have wasted so much time with someone who has promised they can "definitely fix it" that I really need someone who can take a look at the files and make a proper educated decision about whether they can fix it or not! There must be someon out there who can look at the files and say, I reckon it's "xyz" and we can fix it by doing "xyz".

 

Please help, I don't have much hair left to pull out!

Results.txt

Edited by babyewok (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...