Jump to content

Shipping cost deleted from PayPal module on DoExpressCheckout call


andrea71

Recommended Posts

Hi all, I have an issue related to PayPal standard module ver. 3.8.1with Prestashop 1.6.09.

The shipping cost is deleted during DoExpressCheckout call.

Following the techincal dept. PayPal answer on issue with an transaction example.

in call SetExpressCheckout, the shipping cost are showed:
paymentrequest_0_amt "14.66"
paymentrequest_0_itemamt "4.9"
paymentrequest_0_shippingamt "9.76"

The same for GetExpressCheckout (in PayPal page)
paymentrequest_0_amt "14.66"
paymentrequest_0_itemamt "4.9"
paymentrequest_0_shippingamt "9.76"

At complition of transaction in prestashop web site the call to DoExpressCheckout don't send the shipping cost to PayPal:
paymentrequest_0_amt "4.90"
paymentrequest_0_itemamt "4.9"
paymentrequest_0_shippingamt "0.00"

 

Somebody have sole this issue?

Link to comment
Share on other sites

Why are the amounts different in your sample data?  Why did 14.66 change to 4.90?

 

GetExpressCheckout

paymentrequest_0_amt "14.66"
paymentrequest_0_itemamt "4.9"
paymentrequest_0_shippingamt "9.76"

 

 

DoExpressCheckout

paymentrequest_0_amt "4.90"
paymentrequest_0_itemamt "4.9"
paymentrequest_0_shippingamt "0.00"

 

 

I would need to better understand what you are doing to test this

Link to comment
Share on other sites

Hi Bellini,

I have installed the paypal 3.8.1 standard module on presthashop 1.6.09 standard installation. The problem is that the prestashop paypal module, when redirect to paypal site send the right values, when the transaction are done the value transacted are only for products cost.

In first istance I had supposed that was a PayPal account configuration problem but after a lot of mail exchanged with PayPal Customer Support team they have check the transactions done by my site, and send me following example data exchanged:

 

Value sent to PayPal at first data send from SetExpressCheckout of PayPal Prestashop module:

paymentrequest_0_itemamt "4.9": is the products cost
paymentrequest_0_shippingamt "9.76": is the shipping cost

paymentrequest_0_amt "14.66": is the total cost, products + shipping (4,9 + 9,76 = 14,66)

 

 

 

Value received from PayPal from standard GetExpressCheckout function of PayPal Prestashop module:

paymentrequest_0_itemamt "4.9": is the products cost
paymentrequest_0_shippingamt "9.76": is the shipping cost

paymentrequest_0_amt "14.66": is the total cost, products + shipping (4,9 + 9,76 = 14,66)

 

 

Value sent to PayPal from standard DoExpressCheckout function of PayPal Prestashop module to confirm value received from PayPal:

 

paymentrequest_0_amt "4.90": is the products cost
paymentrequest_0_shippingamt "0.00": is the shipping cost that is deleted from paypal module (I suppose bu DoExpressCheckout)

paymentrequest_0_itemamt "4.9": is the total cost, products + shipping (4,9 + 0 = 4,9)

 

Mentioned Functions are managed in /modules/paypal/express_checkout/process.php file.

 

See the printscreen on attached pdf file

 

P.S. The value above are provided by PayPal customer support after check on transaction done.
 

paypal_forum.pdf

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

In your PDF attachment, between steps 3 and 4 you do not show what your checkout page looks like.

 

In step 3 when the customer clicks on Continue, aren't they redirected back to your website checkout page and the cart summary is displayed?  have you confirmed that shipping is still present at this point?

 

For some reason your Prestashop is dropping shipping at this point.

Link to comment
Share on other sites

Between step 3 and step 4 the customer is not redirect from paypal to my website to confirm. When customer click on confirmation button in step 3 paypal transact the import without shipping cost and then is redirected to my web site as step 4. There aren't other step between step 3 and step 4.

Link to comment
Share on other sites

I've got the same problem with the same prestashop(1.6.0.9) and paypal(3.8.1) versions. Sometimes works correctly(1% of the cases) but most time go wrong..... the strange thing is that if i enable the sandbox test environment it works perfectly....

 

This is very embarrassing for me because my client is losing money

Link to comment
Share on other sites

Hi done,

you're lucky mine never works. I hae tried to modify the code but is very tricky since I don't know the complete code of this module. If this module will not patched I think that the only solution is use another way (module or bank channel)

Link to comment
Share on other sites

In my case the problem was caused before the call of the doexpresscheckout because the paypal module overrides the customer address and loose the field "State".

 

I resolved in the file modules/paypal/express_checkout/payment.php

 

i commented

 

$address->add();

$address->save();

 

like this:

/* Create address */
        if (is_array($address) && isset($address['id_address']))
            $address = new Address($address['id_address']);

        if ((!$address || !$address->id) && $customer->id)
        {//If address does not exists, we create it
            $address = setCustomerAddress($ppec, $customer);
            //$address->add(); // Comment out HERE
        }
        else if($customer->id)
        {//If address exists, we update it with new informations
            $address = setCustomerAddress($ppec, $customer, $address->id);
            //$address->save(); // Comment out HERE
        }

In my case this solution has resolved the problem.

 

Hope can help

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...