I’m trying to make a purchase request to a Simulator end point (https://test.sagepay.com/Simulator/VSPDirectGateway.asp), with the following data:
array(35) { ["VPSProtocol"]=> string(4) "2.23" ["TxType"]=> string(7) "PAYMENT" ["Vendor"]=> string(9) "MY VENDOR NAME" ["AccountType"]=> string(1) "E" ["Description"]=> string(13) "My Test Order" ["Amount"]=> string(4) "1.50" ["Currency"]=> string(3) "GBP" ["VendorTxCode"]=> string(1) "3" ["ClientIPAddress"]=> NULL ["ApplyAVSCV2"]=> int(0) ["Apply3DSecure"]=> int(0) ["BillingFirstnames"]=> string(3) "Sam" ["BillingSurname"]=> string(4) "King" ["BillingAddress1"]=> string(1) "1" ["BillingAddress2"]=> string(1) "2" ["BillingCity"]=> string(8) "Brighton" ["BillingPostCode"]=> string(3) "BN1" ["BillingState"]=> string(0) "" ["BillingCountry"]=> string(2) "GB" ["BillingPhone"]=> NULL ["DeliveryFirstnames"]=> NULL ["DeliverySurname"]=> NULL ["DeliveryAddress1"]=> NULL ["DeliveryAddress2"]=> NULL ["DeliveryCity"]=> NULL ["DeliveryPostCode"]=> NULL ["DeliveryState"]=> string(0) "" ["DeliveryCountry"]=> NULL ["DeliveryPhone"]=> NULL ["CustomerEMail"]=> NULL ["CardHolder"]=> string(8) "Sam King" ["CardNumber"]=> string(16) "4012888888881881" ["CV2"]=> string(3) "123" ["ExpiryDate"]=> string(4) "0215" ["CardType"]=> string(4) "visa" }
However, all I repeatedly keep getting back from Sagepay is a validation error:
"The CardHolder field should be between 1 and 50 characters long.”
However, as you can see in the above data array, I’m sending a CardHolder value of ‘Sam King’, which is clearly between 1 and 50 characters long.
For reference, I'm using the Omnipay (https://github.com/thephpleague/omnipay) library to make requests.
Any idea what I could be doing wrong here?