arulraj
arulraj

Reputation: 115

getting warning Value of Order Description element has been truncated. in paypal

I am getting below the warring message some time in paypal. But same time it is working fine. I am passing $200 means working good but $30 means below the warning message was displayed

Array ( [TOKEN] => EC-8JN325950R8891611 [TIMESTAMP] => 2015-12-28T07:30:02Z [CORRELATIONID] => ef1922a5aa68a [ACK] => SuccessWithWarning [VERSION] => 65 [BUILD] => 18308778 [L_ERRORCODE0] => 10433 [L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details. [L_LONGMESSAGE0] => Value of OrderDescription element has been truncated. [L_SEVERITYCODE0] => Warning )

can you help me to solved this?

Upvotes: 1

Views: 1281

Answers (2)

timk
timk

Reputation: 105

PayPal's PAYMENTREQUEST_n_DESC field, although it says it has a limit of 127 characters in the PayPal documentation, ACTUALLY seems to have a limit of 127 bytes. There is an incorrect assumption by PayPal that 127 characters = 127 bytes. We found when descriptions contained <= 127 unicode characters, we still ran into this validation issue.

Our solution was to add a function that truncated the provided string based on byte length. C# examples: Best way to shorten UTF8 string based on byte length

Upvotes: 1

Drew Angell
Drew Angell

Reputation: 26056

PayPal's PAYMENTREQUEST_n_DESC parameter only accepts 127 characters.

If you pass more than that it will still accept the payment and process the transaction, but it will return the warning that your data was truncated like you're getting.

If you look at your raw request you'll see that you must have a value longer than 127 characters in that parameter.

Upvotes: 0

Related Questions