thephpleague / omnipay-sagepay

Sage Pay driver for the Omnipay PHP payment processing library
MIT License
54 stars 78 forks source link

Sagepay\Server #182

Closed dathwa closed 2 years ago

dathwa commented 2 years ago

Hello. Protocol 4 enabled for sagepay - "omnipay/sagepay": "^4.0",

Getting this error back after posting to Server... 3120 : The DeliveryFirstnames field is required.

But my card object is initialised like so below... Anyone see what the problem might be? I can't see any reference to 'DeliveryFirstnames 'in the omnipay code.

$card = new CreditCard([
    // 'firstName' => $customer->firstname,
    // 'lastName' => $customer->lastname,
    'billingFirstName' => $customer->firstname,
    'billingLastName' => $customer->lastname,
    'billingAddress1' => isset($billingData[0]) ? $billingData[0]: '',
    'billingAddress2' => isset($billingData[1]) ? $billingData[1]: '',
    'billingAddress3' => isset($billingData[2]) ? $billingData[2]: '',
    'billingCity' => $billing->city,
    'billingPostcode' => $billing->zip,
    'billingCountry' => $billing->country->code, // 'GB',
    // 'billingPhone' => '01234 567 890',
    'email' =>  $customer->user->email,
    // 'shippingFirstnames' => $customer->firstname,
    // 'shippingFirstNames' => $customer->firstname,
    // 'ShippingFirstnames' => $customer->firstname,
    // 'ShippingFirstNames' => $customer->firstname,
    // 'deliveryFirstnames' => $customer->firstname,
    'DeliveryFirstnames' => $customer->firstname,
    // 'deliveryfirstnames' => $customer->firstname,
    // 'deliveryFirstNames' => $customer->firstname,
    // 'DeliveryFirstNames' => $customer->firstname,

    // 'DeliveryAddress1' => $shippingData[0],
    // 'DeliveryAddress2' => $shippingData[1],
    // 'DeliveryAddress3' => $shippingData[2],
    // 'DeliveryCity' => $shipping->city,
    // 'DeliveryPostCode' => $shipping->zip,
    // 'DeliveryCountry' => $shipping->country->code,

    // 'shippingFirstnames' => $customer->firstname,
    'shippingAddress1' => isset($shippingData[0])? $shippingData[0]: '',
    'shippingAddress2' => isset($shippingData[1])? $shippingData[1]: '',
    'shippingAddress3' => isset($shippingData[2])? $shippingData[2]: '',
    'shippingCity' => $shipping->city,
    'shippingPostcode' => $shipping->zip,
    'shippingCountry' => $shipping->country->code,
    // 'shippingCountry' => 'GB', // this passes!!!!!!!!!!!!!!
    // 'deliveryAddress1' => $shippingData[0],
    // 'deliveryAddress2' => $shippingData[1],
    // 'deliveryAddress3' => $shippingData[2],
    // 'deliveryCity' => $shipping->city,
    // 'deliveryPostCode' => $shipping->zip,
    // // 'deliveryCountry' => $shipping->country->code,
    // 'deliveryCountry' => 'GB',
    // 'DeliveryCountry' => 'GB',
    // 'billingForShipping' => true,
    // 'billingForDelivery' => true,
    // 'shippingPhone' => '01234 567 890 SS',
    // 'number' => $sagepayCardNumber,
    // 'expiryMonth' => $sagepayExpirationMonth, // 2 digits
    // 'expiryYear' => $sagepayExpirationYear, // 4 digits
    // 'CVV' => $sagepayCVC, // 3 digits
    // 'iframe' => true,
    'clientIp' => request()->ip(), // this worked for protocol 3
]);
dathwa commented 2 years ago

This was just a case of confusing error message. "shippingFirstName" works.