CyberSource / cybersource-rest-client-php

PHP client library for the CyberSource REST API
30 stars 66 forks source link

Having : invalid length for $code when calling PtsV2PaymentsPost201ResponseProcessorInformationAvs., must be smaller than or equal to 1. #34

Closed gharbi-mohamed closed 8 months ago

gharbi-mohamed commented 5 years ago

When using getTransaction API, i got an issue with AVS result code which is received from cybersource as "2 " and in the setCode method we have a check on code lenght > 1 which is the case for the non trimmed string.

I guess the fix should be like : vendor/cybersource/rest-client-php/lib/Model/PtsV2PaymentsPost201ResponseProcessorInformationAvs.php:199

public function setCode($code) { $code = trim($code); // remove eventual spaces if (!is_null($code) && (strlen($code) > 1)) { throw new \InvalidArgumentException('invalid length for $code when calling PtsV2PaymentsPost201ResponseProcessorInformationAvs., must be smaller than or equal to 1.'); }

gnongsie commented 5 years ago

Hi,

Thank you for reporting this issue. I will communicate the same to the relevant team and we will get this sorted. Kindly be patient and we will get back to you.

itslit-tech commented 4 years ago

@gharbi-mohamed Hi, there. I am facing a similar issue. May I know how did you fix it ? Did you fork the repo and add your own fix ?

mohdhafeezjohari commented 4 years ago

yeah, im having same problems.

itslit-tech commented 4 years ago

@gharbi-mohamed @mohdhafeezjohari I ended up forking the repo and fixing that case for myself. Please check https://github.com/itslit-tech/cybersource-rest-client-php if that helps you.

monu-kumar-visa commented 8 months ago

Length check has been removed from the models starting from version 0.0.14.