INVALID_STRING_LENGTH on description
-
when I try to pay with paypal, I get this error.
I think because I have unicode characters my my description.
The plugin takes the unicode characters and truncate it to 127 characters. But then, when you convert to json, the unicode characters are expanded into their respective codes and the full string becomes longer than 127 characters.Please check:
Request Body: {"intent":"CAPTURE","purchase_units":[{"reference_id":"default","amount":{"currency_code":"EUR","value":"37.00","breakdown":{"item_total":{"currency_code":"EUR","value":"37.00"},"shipping":{"currency_code":"EUR","value":"0.00"},"tax_total":{"currency_code":"EUR","value":"0.00"}}},"description":"","items":[{"name":"Myproduct\u2122\ufe0f - The Product Product Product","unit_amount":{"currency_code":"EUR","value":"37.00"},"quantity":1,"description":"\ud83e\udd14Hey! Are you aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm nnn ooo ppp qqq rrr sss ttt uuu vvv www zzz?\r\n\r\n\ud83e\udd14 Do","sku":"GGG","category":"PHYSICAL_GOODS","tax":{"currency_code":"EUR","value":"0.00"}}],"payee":{"merchant_id":"9G5XY123123213"},"shipping":{"name":{"full_name":" "},"address":{"country_code":"ES","address_line_1":"my address","address_line_2":"","admin_area_1":"AL","admin_area_2":"pescara","postal_code":"65111"}}}],"application_context":{"user_action":"CONTINUE","shipping_preference":"SET_PROVIDED_ADDRESS","landing_page":"LOGIN","locale":"en-US","brand_name":"Brand","return_url":"https:\/\/omitted.com\/?wc-ajax=ppc-return-url","cancel_url":"https:\/\/omitted.com\/checkout\/"},"payment_method":{"payee_preferred":"IMMEDIATE_PAYMENT_REQUIRED","payer_selected":"PAYPAL"}} Response Debug ID: d417fffffff Response: Array ( [code] => 400 [message] => Bad Request ) Response Body: {"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"d417d11sssss","details":[{"field":"/purchase_units/@reference_id=='default'/items/0/description","value":"\ud83e\udd14Hey! Are you aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm nnn ooo ppp qqq rrr sss ttt uuu vvv www zzz?\r\n\r\n\ud83e\udd14 Do","location":"body","issue":"INVALID_STRING_LENGTH","description":"The value of a field is either too short or too long."}],"links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_STRING_LENGTH","rel":"information_link","encType":"application/json"}]}
I think this should be fixed or a lot of payments will fail. Thank you
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘INVALID_STRING_LENGTH on description’ is closed to new replies.