Applying a discount on the shipping option leads to a Paypal error

  • Posts: 31
  • Thank you received: 0
3 years 10 months ago #320272

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.19
-- PHP version -- : 7.3.18
-- Browser(s) name and version -- : Firefox lastest
-- Error-message(debug-mod must be tuned on) -- : www.paypal.com/webapps/shoppingcart/erro...861947_20a327941b4cf

Hi! I offer several shipping method to my customer including one where the customer can pick up the merchandise at our store. This option offer a rebate of 10% on his order. The mecanism works on the website but as soon as the user click to go to Paypal, there is an error in the url :
www.paypal.com/webapps/shoppingcart/erro...861947_20a327941b4cf
I tried with two different plugins for manual shipping but both failed (including the manual shipping plugin provided by Hikashop). As soon as I remove the discount, everything works fine. Is there a better way to offer discount on shipping method ? thank you

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 4519
  • Thank you received: 611
  • MODERATOR
3 years 10 months ago #320285

Hello,

Just a guess, but maybe there is something you can try, try to proceed your checkout step by step, I mean by example :
1. Checkout page login,Cart, Address AND Shipping method
2. Cart AND payment
3. Final page & cart agreement and confirm button

My guess is that currently all is proceed at the same time and leads to have a wrong amount, but difficult to say more without more test.
Hope this will help us to progress on your subject
Regards

Last edit: 3 years 10 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 0
3 years 10 months ago #320315

This is exacly how I proceed. For checking out, there is several steps actually.
1. add item to cart (product page)
2. access to checkout (icon in the top page presenting a dropdown with checkout info)
3. add personal info including address (checkout - page 1)
4. confirm if everything is ok so far (checkout - page 2)
5. present shipping options (default is the cheaper but not the pick up one) including pick up (checkout (page 3)
6. suppose I changed the shipping for pickup, the shopping cart is recalculated (same page)
7. chose payment (same page)
8. agree condition (same page)
9. go to payment (same page)

Is it what you said?

Please Log in or Create an account to join the conversation.

  • Posts: 4519
  • Thank you received: 611
  • MODERATOR
3 years 10 months ago #320322

Hello,

Yes, what we have in mind, the most important point is to select shipping method on a separate page from payment selection, and the best is to have the payment method at the end with a non-editable cart just before the finish button.

If you have done this, can you provide these following elements :
- An Url link with all required to be able to reach the checkout process
- Relative screenshot configuration (payment method & shipping method.
- Any elements that can help us to better understand the context.

Note : You can use our Contact us form to provide secret references, don't forget to add to your message an Url to this topic.
Regards

Last edit: 3 years 10 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
3 years 9 months ago #322213

Encountering similar situation with the PayPal shipping plugin.

Multiple shipping methods mix of fixed price or percentage of product price.

All work fine except for one which offers a 10% discount on the product price.
So total product price of order, say, $25.90 then shipping price in checkout shows as $-2.59, great.
Tax also appears to be adjusted correctly, so all set to go.

In paypal payment method have the Send details of the order option set to NO.
At end of checkout redirect to PayPal correctly.

In paypal payment method change the Send details of the order option to YES.
At end of checkout redirect to PayPal and get this error.

Paypal Error - Found description of that error here Paypal Error Description

Looks to me like PayPal does not like negative prices for order items - the shipping price is passed to PayPal as an order item.

Solution looks easy enough - if the shipping price is negative don't pass it to PayPal but add to the discount_amount_cart value which is passed to PayPal. Know of any reason why that would not work?

Could this change be made to paypal.php - or would it be better to create our own branch?
Other issues to consider - in theory a discount could even apply to selected payment methods!
What happens after all discounts applied the total order value is negative :evil: ?

Please Log in or Create an account to join the conversation.

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
3 years 9 months ago #322245

Hi,

Well, yes, PayPal doesn't support negative prices.
Usually, in such cases, I would recommend to just turn off the "send order details" setting of the PayPal payment method.

Using the discount_amount_cart field for the shipping fee when the shipping fee is negative is something that could be implemented.
But then, the customer would see "discount" instead of "shipping" for the shipping fee, and if he has a coupon, the amount of the coupon would be summed together with the amount of the shipping fee.
And then, you would have the same query for payment fees, product prices (which can also be negative).
It looks like a hack of the API of PayPal. Ideally, it would be better that PayPal accept negative items as long as the total amount is positive. As that's not supported by PayPal I would recommend to just turn off the "send order details" option.

When the total order value is negative, HikaShop forces it to 0 when the cart is being loaded.
And when the total cart/order amount is 0, the payment method selector is removed from the checkout automatically and no call to the payment methods is done. At the end of the checkout the order will be created and if the "validate free order" plugin is activated, the order will be directly confirmed.
Most payment gateways don't accept transactions with a value of 0 or negative, so that's why we've done it like that as it wouldn't work otherwise.

Please Log in or Create an account to join the conversation.

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
3 years 9 months ago #322276

I have passed this onto PayPal support.

Hikashop's response to my suggested solution is reasonable - when using discount voouchers would cause more confusion!

Instead of the shop owner having to disable sending order details it would be more sensible if PayPal just accepted negative item prices ... the final total of the payment is the most important bit. Hiding the order details to get round the problem just reduces the customer's ability to check how the total arrived at (although they will have an email with that information). Negative item prices should not matter as long as the total is positive.

Please Log in or Create an account to join the conversation.

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
3 years 9 months ago #322300

Hi,

Thanks.
That's actually how Authorize.net works. You can give any price and quantities to the products in the order details to authorize.net. It will display them, but it will only take into account the main total amount you're giving it, even if the total of the items don't match. That way, it is a lot easier to handle such edge cases since the payment will always work with the correct amount.

Please Log in or Create an account to join the conversation.

Time to create page: 0.077 seconds
Powered by Kunena Forum