• Resolved solidce

    (@solidce)


    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)
  • Plugin Support Syde Joost

    (@joostvandevijver)

    Hello @solidce

    thank you for reaching out to us, we are here to help.
    Some time ago we ran into the same issue when using emoticons in the description and have been working on this for some time. However, we do not yet have a solution in place for it and can currently only advise you to use a short product description (and no emoji within the first 127 characters) so that you don’t run into this issue.

    I have linked your ticket to our bug so that you will be updated once any workaround or solution is available for you. I hope that is a workable situation for you, for the time being.

    Kind regards,
    Joost

    • This reply was modified 3 years, 3 months ago by Syde Joost.
    • This reply was modified 3 years, 3 months ago by Syde Joost.
    Thread Starter solidce

    (@solidce)

    Thank you for your response.
    Can you link me to the github bug please? I will try to help from there. Thank you ??

    Plugin Support Syde Joost

    (@joostvandevijver)

    Hello @solidce

    at this moment the GH entry is not open yet, but I expect we will get this item included in a January release. Once opened it should show up here: https://github.com/woocommerce/woocommerce-paypal-payments/issues

    Hope that helps you further. I have added your name (and the link here) to the jira bug, so they can reach out to you if needed any support from merchants or when they have the GH bug opened.

    Kind regards,
    Joost

    I also keep getting this error

    INVALID_REQUEST – The value of a field is either too short or too long.

    The plugin was working for a short time and then it stopped

    Plugin Support Syde Joost

    (@joostvandevijver)

    Hello Andrea,
    ?
    ?Yesterday we released version 1.8.1 which should allow you to add an emoji to the product (description) details. This should resolve this issue; if you are still encountering this or a similar issue, please open a new thread, since this one is aged and will be marked are resolved.
    ?
    ?Kind regards,
    Joost

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘INVALID_STRING_LENGTH on description’ is closed to new replies.