0

We‘re using sagepay - omnipay plugin for laravel and facing an issue regarding sending order data into sagepay basket. All data is going well except the VAT amount/ tax code.

We’re adding data into the basket using ItemBag Class and setting below fields:-

setProductCode => E8 (sage 50 isn’t reading this field as well, unfortunately we need to put it in the name field like this name => "[E8] storage pod")

name => XXXX

description => XXXX (sage 50 isn’t reading this field as well, we also need to send description in the name field)

quantity => 1

price => 1343

vat => 45 (this isn’t showing in Sagepay and it shows like 00, screenshot attached)

all fields going out into basket except VAT field.

$basket = new ItemBag();

$item = new Item(['setProductCode' => 'E8','name' => 'abc',               'description' => 'testestestststs','quantity' => 1 ,'price' => 235,vat => 32]);   



$basket->add($item);



$requestMessage->setItems($basket);



$responseMessage = $requestMessage->send();

I expect the output including vat amount or tax code into the basket.

1 Answers1

0

In the Omnipay documentation, you will find the following that worked for me.

VAT If you want to include VAT amount in the item array you must use \Omnipay\SagePay\Extend\Item as follows.

$items = array(
    array(new \Omnipay\SagePay\Extend\Item(array(
        'name' => 'My Product Name',
        'description' => 'My Product Description',
        'quantity' => 1,
        'price' => 9.99,
        'vat' => 1.665, // VAT amount, not percentage
    ))
);
Paul Wright
  • 384
  • 3
  • 9