Tagged: CANNOT_BE_NEGATIVE, negative amount
-
AuthorPosts
-
Hi Team,
Has anyone experienced a UNPROCESSABLE_ENTITY CANNOT_BE_NEGATIVE error when checking out with Paypal? Our site has been using TeraWallet with WooCommerce PayPal Payments and before the latter’s update last week, all has been working as expeted.
Now it seems to us that there’s incompatibility between the two plugins. We’re in limbo because we can’t seem to figure out which author should we contact to get some help. It’s worth noting that whatever’s the balance of the wallet, is the same negative value that PayPal is complaining about.
Finally, our PayPal contact told us that the developer of the plugin should amend their code to add a new discount property to indicate the discount from the wallet (and perhaps for any discounts a coupon might apply). Here’s the sample payload – notice the discount property.
purchase_units: [ { description: "Coffee Things", amount: { currency_code: "USD", value: "13.00", breakdown: { item_total: { currency_code: "USD", value: "15.00" }, shipping: { currency_code: "USD", value: "2.00" }, tax_total: { currency_code: "USD", value: "1.00" }, discount: { currency_code: "USD", value: "5.00" } } },
Hi,
Please deactivate our plugin and check. If the issue solves then please let us know. As per your payment request arguments, there is no wallet entry. So we think this might be because of any other plugin.
Hi Subrata, thanks for your reply. Apologies for the confusion, the payload above was the pattern suggested by PayPal engineers to follow.
The payload below is the actual payload that PayPal has identified as a call that came from the merchant (our website).
“items”: [
{
“category”: “PHYSICAL_GOODS”,
“description”: “”,
“name”: “Via wallet”,
“quantity”: 1,
“sku”: “”,
“tax”: {
“currency_code”: “USD”,
“value”: “0.00”
},
“unit_amount”: {
“currency_code”: “USD”,
“value”: “-11.79”
}
}
],
The -11.79 was the value of the wallet during checkout for this specific user. Hope that helps clarify.
Meanwhile, there’s no issue with users that has no wallet balance during checkout. This can simulate to some degree the disabling of the plugin because no wallet-related amount is passed to PayPal.
Aooreciate your response, Subrata.
-
This reply was modified 2 years, 12 months ago by
johnbautista.
-
This reply was modified 2 years, 12 months ago by
johnbautista.
Please share the full order payload details.
Also please check if this error is happening with the default WooCommerce coupon or not.
Hi Subrata, can you share more information on how I can capture the full order payload details? I tried capturing the payload submitted to PayPal through my Chrome Dev Tools but the purchase_unit property seems empty.
{"nonce":"9a51a0dc5c","purchase_units":[],"bn_code":"Woo_PPCP","payer":{"email_address":"myemail@gmail.com","name":{"surname":"Super","given_name":"Super"},"address":{"country_code":"US","address_line_1":"124124 asdfasdf","address_line_2":"","admin_area_1":"ALB","admin_area_2":"asdfadfadf","postal_code":"23523"},"phone":{"phone_type":"HOME","phone_number":{"national_number":"35235"}}},"context":"cart"}
Is there a better way to catch the payload?
Re: the coupon, yes, the error shows up every time a cart is submitted through PayPal and the user has a balance greater than zero. All regardless if a default WooCommerce coupon is applied or not. On the other hand, if I don’t select PayPal as my payment method, it proceeds to the checkout page as expected.
Okay, the PayPal Payments plugin is new and we believe that the plugin is not fully compatible with WooCommerce but not sure. Could you please try with deactivate our plugin and using the WooCommerce default coupon? As we are using the default WooCommerce negative fee for partial payment.
Also, you can disable partial payment using code
add_filter('woo_wallet_disable_partial_payment', '__return_true');
I’ll try that and will get back to you. Also appreciate your candor when it comes to the new PayPal plugin’s possibly incompatibility. We’re also considering that but was truly in the fence on who we should contact: your team or theirs.
Just looking at the most recent reviews of their new plugin, I have reasons to believe that the issue resides on their end.
Still, I appreciate your time Subrata for going above and beyond. I’ll get back to you on your suggestion.
Hi team,
Having the same issue/error message for customers with a balance in TeraWallet. This started happening with the most recent update of the PayPal Payments plugin: WooCommerce PayPal Payments Version 1.6.4.
Could you please check/help?
Thanks a lot!
Best,
Tom
-
This reply was modified 2 years, 12 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.