x
Developer

Bug - PHP SDK CreateCheckoutRequest does not capture the "taxes" and "discounts" data

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!

718 Views
Message 1 of 3
Report
2 REPLIES 2
Developer

Updating my PHP SDK fixed the issues. The latest version has these features.

682 Views
Message 2 of 3
Report
Alumni

Thanks for the update, @Tapio

680 Views
Message 3 of 3
Report