Hello, I am using the latest version of the PHP SDK and am following the Square API guide here. I am creating a CreateCheckoutRequest class and am populating the "order" data using CreateOrderRequestOrder class with CreateOrderRequestLineItem. The checkout API has been working fine until I attempted to implement taxes. According to the guide, taxes should be a multi-demensional array passed in CreateOrderRequestOrder and/or CreateOrderRequestLineItem (in the PHP SDK these classes represent the "order" element which contains "line_items" elements). However, this data is omitted when the class is instantiated. Upon inspection of the classes I do not see any data setters for taxes or discounts. The class definition for CreateOrderRequestOrder includes:
(Note taxes and discounts are missing)
/**
* Array of attributes where the key is the local name, and the value is the original name
* @var string[]
*/
static $attributeMap = array(
'reference_id' => 'reference_id',
'line_items' => 'line_items'
);
Is this a bug or am I missing something? If the SDK does not support this functionality I will have to build HTTP requests like the V1 API uses. Please let me know.
Thanks!
Updating my PHP SDK fixed the issues. The latest version has these features.
Thanks for the update, @Tapio!
Square Community