WooCommerce Square - Version 2.0.4

Version Description

  • 2019.09.03 =
  • Fix - Add adjustments to Square order in the event of discrepancy with WooCommerce total
Download this release

Release Info

Developer automattic
Plugin Icon 128x128 WooCommerce Square
Version 2.0.4
Comparing to
See all releases

Code changes from version 2.0.3 to 2.0.4

Files changed (328) hide show
  1. i18n/languages/woocommerce-square.pot +1 -1
  2. includes/Gateway.php +19 -1
  3. includes/Gateway/API.php +29 -0
  4. includes/Gateway/API/Requests/Orders.php +110 -4
  5. includes/Lifecycle.php +4 -4
  6. includes/Plugin.php +1 -1
  7. readme.txt +4 -1
  8. vendor/autoload.php +1 -1
  9. vendor/composer/ClassLoader.php +1 -1
  10. vendor/composer/autoload_real.php +4 -4
  11. vendor/composer/autoload_static.php +3 -3
  12. vendor/composer/installed.json +6 -6
  13. vendor/square/connect/CHANGES.md +43 -3
  14. vendor/square/connect/README.md +120 -23
  15. vendor/square/connect/composer.json +1 -1
  16. vendor/square/connect/docs/Api/ApplePayApi.md +3 -3
  17. vendor/square/connect/docs/Api/CatalogApi.md +25 -25
  18. vendor/square/connect/docs/Api/CheckoutApi.md +2 -2
  19. vendor/square/connect/docs/Api/CustomersApi.md +18 -18
  20. vendor/square/connect/docs/Api/EmployeesApi.md +4 -4
  21. vendor/square/connect/docs/Api/InventoryApi.md +14 -14
  22. vendor/square/connect/docs/Api/LaborApi.md +28 -28
  23. vendor/square/connect/docs/Api/LocationsApi.md +2 -2
  24. vendor/square/connect/docs/Api/MobileAuthorizationApi.md +2 -2
  25. vendor/square/connect/docs/Api/OAuthApi.md +13 -12
  26. vendor/square/connect/docs/Api/OrdersApi.md +112 -8
  27. vendor/square/connect/docs/Api/PaymentsApi.md +316 -0
  28. vendor/square/connect/docs/Api/RefundsApi.md +167 -0
  29. vendor/square/connect/docs/Api/ReportingApi.md +6 -4
  30. vendor/square/connect/docs/Api/TransactionsApi.md +28 -21
  31. vendor/square/connect/docs/Api/V1EmployeesApi.md +32 -32
  32. vendor/square/connect/docs/Api/V1ItemsApi.md +80 -80
  33. vendor/square/connect/docs/Api/V1LocationsApi.md +4 -4
  34. vendor/square/connect/docs/Api/V1TransactionsApi.md +22 -22
  35. vendor/square/connect/docs/Model/BalancePaymentDetails.md +16 -0
  36. vendor/square/connect/docs/Model/BatchRetrieveCatalogObjectsRequest.md +1 -1
  37. vendor/square/connect/docs/Model/BatchRetrieveOrdersResponse.md +1 -2
  38. vendor/square/connect/docs/Model/CancelPaymentByIdempotencyKeyRequest.md +15 -0
  39. vendor/square/connect/docs/Model/CancelPaymentByIdempotencyKeyResponse.md +15 -0
  40. vendor/square/connect/docs/Model/CancelPaymentRequest.md +14 -0
  41. vendor/square/connect/docs/Model/CancelPaymentResponse.md +16 -0
  42. vendor/square/connect/docs/Model/CaptureTransactionResponse.md +1 -1
  43. vendor/square/connect/docs/Model/Card.md +1 -1
  44. vendor/square/connect/docs/Model/CardPaymentDetails.md +24 -0
  45. vendor/square/connect/docs/Model/CatalogInfoResponse.md +1 -0
  46. vendor/square/connect/docs/Model/CatalogItem.md +3 -3
  47. vendor/square/connect/docs/Model/CatalogItemOption.md +20 -0
  48. vendor/square/connect/docs/Model/CatalogItemOptionForItem.md +15 -0
  49. vendor/square/connect/docs/Model/CatalogItemOptionValue.md +20 -0
  50. vendor/square/connect/docs/Model/CatalogItemOptionValueForItemVariation.md +16 -0
  51. vendor/square/connect/docs/Model/CatalogItemProductType.md +1 -1
  52. vendor/square/connect/docs/Model/CatalogItemVariation.md +3 -1
  53. vendor/square/connect/docs/Model/CatalogMeasurementUnit.md +16 -0
  54. vendor/square/connect/docs/Model/CatalogObject.md +7 -1
  55. vendor/square/connect/docs/Model/CatalogObjectType.md +6 -0
  56. vendor/square/connect/docs/Model/CatalogPricingRule.md +24 -0
  57. vendor/square/connect/docs/Model/CatalogProductSet.md +21 -0
  58. vendor/square/connect/docs/Model/CatalogQuery.md +2 -0
  59. vendor/square/connect/docs/Model/CatalogQueryItemVariationsForItemOptionValues.md +15 -0
  60. vendor/square/connect/docs/Model/CatalogQueryItemsForItemOptions.md +15 -0
  61. vendor/square/connect/docs/Model/CatalogTimePeriod.md +15 -0
  62. vendor/square/connect/docs/Model/ChargeRequest.md +2 -1
  63. vendor/square/connect/docs/Model/ChargeResponse.md +1 -1
  64. vendor/square/connect/docs/Model/CompletePaymentRequest.md +14 -0
  65. vendor/square/connect/docs/Model/CompletePaymentResponse.md +16 -0
  66. vendor/square/connect/docs/Model/Coordinates.md +16 -0
  67. vendor/square/connect/docs/Model/CreateCustomerCardRequest.md +3 -2
  68. vendor/square/connect/docs/Model/CreateOrderRequest.md +1 -1
  69. vendor/square/connect/docs/Model/CreatePaymentRequest.md +30 -0
  70. vendor/square/connect/docs/Model/CreatePaymentResponse.md +16 -0
  71. vendor/square/connect/docs/Model/CreateRefundRequest.md +1 -1
  72. vendor/square/connect/docs/Model/CreateRefundResponse.md +1 -1
  73. vendor/square/connect/docs/Model/Error.md +3 -3
  74. vendor/square/connect/docs/Model/ErrorCode.md +29 -2
  75. vendor/square/connect/docs/Model/GetPaymentRefundRequest.md +14 -0
  76. vendor/square/connect/docs/Model/GetPaymentRefundResponse.md +16 -0
  77. vendor/square/connect/docs/Model/GetPaymentRequest.md +14 -0
  78. vendor/square/connect/docs/Model/GetPaymentResponse.md +16 -0
  79. vendor/square/connect/docs/Model/InventoryAdjustment.md +1 -1
  80. vendor/square/connect/docs/Model/InventoryCount.md +1 -1
  81. vendor/square/connect/docs/Model/InventoryPhysicalCount.md +1 -1
  82. vendor/square/connect/docs/Model/InventoryTransfer.md +1 -1
  83. vendor/square/connect/docs/Model/ListPaymentRefundsRequest.md +21 -0
  84. vendor/square/connect/docs/Model/ListPaymentRefundsResponse.md +17 -0
  85. vendor/square/connect/docs/Model/ListPaymentsRequest.md +22 -0
  86. vendor/square/connect/docs/Model/ListPaymentsResponse.md +17 -0
  87. vendor/square/connect/docs/Model/ListRefundsRequest.md +1 -1
  88. vendor/square/connect/docs/Model/ListRefundsResponse.md +1 -1
  89. vendor/square/connect/docs/Model/ListTransactionsRequest.md +1 -1
  90. vendor/square/connect/docs/Model/ListTransactionsResponse.md +1 -1
  91. vendor/square/connect/docs/Model/Location.md +8 -0
  92. vendor/square/connect/docs/Model/MeasurementUnit.md +2 -0
  93. vendor/square/connect/docs/Model/MeasurementUnitGeneric.md +15 -0
  94. vendor/square/connect/docs/Model/MeasurementUnitUnitType.md +20 -0
  95. vendor/square/connect/docs/Model/Money.md +3 -3
  96. vendor/square/connect/docs/Model/ObtainTokenRequest.md +3 -3
  97. vendor/square/connect/docs/Model/ObtainTokenResponse.md +2 -2
  98. vendor/square/connect/docs/Model/Order.md +8 -5
  99. vendor/square/connect/docs/Model/OrderEntry.md +1 -0
  100. vendor/square/connect/docs/Model/OrderFulfillment.md +3 -1
  101. vendor/square/connect/docs/Model/OrderFulfillmentPickupDetails.md +15 -15
  102. vendor/square/connect/docs/Model/OrderFulfillmentRecipient.md +6 -5
  103. vendor/square/connect/docs/Model/OrderFulfillmentShipmentDetails.md +29 -0
  104. vendor/square/connect/docs/Model/OrderFulfillmentState.md +1 -1
  105. vendor/square/connect/docs/Model/OrderFulfillmentType.md +1 -0
  106. vendor/square/connect/docs/Model/OrderLineItem.md +6 -4
  107. vendor/square/connect/docs/Model/OrderLineItemAppliedDiscount.md +17 -0
  108. vendor/square/connect/docs/Model/OrderLineItemAppliedTax.md +17 -0
  109. vendor/square/connect/docs/Model/OrderLineItemDiscount.md +5 -5
  110. vendor/square/connect/docs/Model/OrderLineItemModifier.md +1 -1
  111. vendor/square/connect/docs/Model/OrderLineItemTax.md +5 -5
  112. vendor/square/connect/docs/Model/OrderQuantityUnit.md +1 -1
  113. vendor/square/connect/docs/Model/OrderReturn.md +4 -3
  114. vendor/square/connect/docs/Model/OrderReturnDiscount.md +4 -4
  115. vendor/square/connect/docs/Model/OrderReturnLineItem.md +5 -3
  116. vendor/square/connect/docs/Model/OrderReturnLineItemModifier.md +1 -1
  117. vendor/square/connect/docs/Model/OrderReturnServiceCharge.md +27 -0
  118. vendor/square/connect/docs/Model/OrderReturnTax.md +4 -4
  119. vendor/square/connect/docs/Model/OrderRoundingAdjustment.md +1 -1
  120. vendor/square/connect/docs/Model/OrderServiceCharge.md +26 -0
  121. vendor/square/connect/docs/Model/OrderServiceChargeCalculationPhase.md +16 -0
  122. vendor/square/connect/docs/Model/PayOrderRequest.md +17 -0
  123. vendor/square/connect/docs/Model/PayOrderResponse.md +16 -0
  124. vendor/square/connect/docs/Model/Payment.md +35 -0
  125. vendor/square/connect/docs/Model/PaymentRefund.md +25 -0
  126. vendor/square/connect/docs/Model/ProcessingFee.md +17 -0
  127. vendor/square/connect/docs/Model/RefundPaymentRequest.md +19 -0
  128. vendor/square/connect/docs/Model/RefundPaymentResponse.md +16 -0
  129. vendor/square/connect/docs/Model/RenewTokenResponse.md +2 -2
  130. vendor/square/connect/docs/Model/RetrieveCatalogObjectRequest.md +1 -1
  131. vendor/square/connect/docs/Model/RetrieveLocationRequest.md +14 -0
  132. vendor/square/connect/docs/Model/RetrieveLocationResponse.md +16 -0
  133. vendor/square/connect/docs/Model/RetrieveTransactionResponse.md +1 -1
  134. vendor/square/connect/docs/Model/SearchCatalogObjectsRequest.md +1 -1
  135. vendor/square/connect/docs/Model/SearchOrdersCustomerFilter.md +1 -1
  136. vendor/square/connect/docs/Model/SearchOrdersDateTimeFilter.md +4 -4
  137. vendor/square/connect/docs/Model/SearchOrdersFilter.md +2 -2
  138. vendor/square/connect/docs/Model/SearchOrdersRequest.md +4 -4
  139. vendor/square/connect/docs/Model/SearchOrdersResponse.md +2 -3
  140. vendor/square/connect/docs/Model/SearchOrdersSort.md +3 -3
  141. vendor/square/connect/docs/Model/SearchOrdersSourceFilter.md +2 -2
  142. vendor/square/connect/docs/Model/StandardUnitDescription.md +17 -0
  143. vendor/square/connect/docs/Model/StandardUnitDescriptionGroup.md +16 -0
  144. vendor/square/connect/docs/Model/Tender.md +2 -1
  145. vendor/square/connect/docs/Model/UpdateOrderRequest.md +17 -0
  146. vendor/square/connect/docs/Model/UpdateOrderResponse.md +16 -0
  147. vendor/square/connect/docs/Model/V1CashDrawerShift.md +2 -2
  148. vendor/square/connect/docs/Model/V1Item.md +1 -1
  149. vendor/square/connect/docs/Model/VoidTransactionResponse.md +1 -1
  150. vendor/square/connect/docs/Model/WebhookEvents.md +15 -0
  151. vendor/square/connect/lib/Api/ApplePayApi.php +1 -1
  152. vendor/square/connect/lib/Api/CatalogApi.php +13 -13
  153. vendor/square/connect/lib/Api/CheckoutApi.php +1 -1
  154. vendor/square/connect/lib/Api/CustomersApi.php +10 -10
  155. vendor/square/connect/lib/Api/EmployeesApi.php +2 -2
  156. vendor/square/connect/lib/Api/InventoryApi.php +7 -7
  157. vendor/square/connect/lib/Api/LaborApi.php +14 -14
  158. vendor/square/connect/lib/Api/LocationsApi.php +1 -1
  159. vendor/square/connect/lib/Api/MobileAuthorizationApi.php +1 -1
  160. vendor/square/connect/lib/Api/OAuthApi.php +5 -3
  161. vendor/square/connect/lib/Api/OrdersApi.php +228 -3
  162. vendor/square/connect/lib/Api/PaymentsApi.php +664 -0
  163. vendor/square/connect/lib/Api/RefundsApi.php +374 -0
  164. vendor/square/connect/lib/Api/ReportingApi.php +6 -2
  165. vendor/square/connect/lib/Api/TransactionsApi.php +21 -7
  166. vendor/square/connect/lib/Api/V1EmployeesApi.php +16 -16
  167. vendor/square/connect/lib/Api/V1ItemsApi.php +40 -40
  168. vendor/square/connect/lib/Api/V1LocationsApi.php +2 -2
  169. vendor/square/connect/lib/Api/V1TransactionsApi.php +11 -11
  170. vendor/square/connect/lib/Configuration.php +2 -2
  171. vendor/square/connect/lib/Model/BalancePaymentDetails.php +179 -0
  172. vendor/square/connect/lib/Model/BatchRetrieveCatalogObjectsRequest.php +2 -2
  173. vendor/square/connect/lib/Model/BatchRetrieveOrdersResponse.php +6 -39
  174. vendor/square/connect/lib/Model/CancelPaymentByIdempotencyKeyRequest.php +146 -0
  175. vendor/square/connect/lib/Model/CancelPaymentByIdempotencyKeyResponse.php +146 -0
  176. vendor/square/connect/lib/Model/CancelPaymentRequest.php +117 -0
  177. vendor/square/connect/lib/Model/CancelPaymentResponse.php +179 -0
  178. vendor/square/connect/lib/Model/Card.php +2 -2
  179. vendor/square/connect/lib/Model/CardPaymentDetails.php +443 -0
  180. vendor/square/connect/lib/Model/CatalogInfoResponse.php +37 -4
  181. vendor/square/connect/lib/Model/CatalogItem.php +41 -41
  182. vendor/square/connect/lib/Model/CatalogItemOption.php +311 -0
  183. vendor/square/connect/lib/Model/CatalogItemOptionForItem.php +146 -0
  184. vendor/square/connect/lib/Model/CatalogItemOptionValue.php +311 -0
  185. vendor/square/connect/lib/Model/CatalogItemOptionValueForItemVariation.php +179 -0
  186. vendor/square/connect/lib/Model/CatalogItemVariation.php +70 -4
  187. vendor/square/connect/lib/Model/CatalogMeasurementUnit.php +179 -0
  188. vendor/square/connect/lib/Model/CatalogObject.php +202 -4
  189. vendor/square/connect/lib/Model/CatalogPricingRule.php +443 -0
  190. vendor/square/connect/lib/Model/CatalogProductSet.php +344 -0
  191. vendor/square/connect/lib/Model/CatalogQuery.php +70 -4
  192. vendor/square/connect/lib/Model/CatalogQueryItemVariationsForItemOptionValues.php +146 -0
  193. vendor/square/connect/lib/Model/CatalogQueryItemsForItemOptions.php +146 -0
  194. vendor/square/connect/lib/Model/CatalogTimePeriod.php +146 -0
  195. vendor/square/connect/lib/Model/ChargeRequest.php +37 -4
  196. vendor/square/connect/lib/Model/CompletePaymentRequest.php +117 -0
  197. vendor/square/connect/lib/Model/CompletePaymentResponse.php +179 -0
  198. vendor/square/connect/lib/Model/Coordinates.php +179 -0
  199. vendor/square/connect/lib/Model/CreateCustomerCardRequest.php +41 -8
  200. vendor/square/connect/lib/Model/CreateOrderRequest.php +2 -2
  201. vendor/square/connect/lib/Model/CreatePaymentRequest.php +641 -0
  202. vendor/square/connect/lib/Model/CreatePaymentResponse.php +179 -0
  203. vendor/square/connect/lib/Model/Error.php +6 -6
  204. vendor/square/connect/lib/Model/GetPaymentRefundRequest.php +117 -0
  205. vendor/square/connect/lib/Model/GetPaymentRefundResponse.php +179 -0
  206. vendor/square/connect/lib/Model/GetPaymentRequest.php +117 -0
  207. vendor/square/connect/lib/Model/GetPaymentResponse.php +179 -0
  208. vendor/square/connect/lib/Model/InventoryAdjustment.php +2 -2
  209. vendor/square/connect/lib/Model/InventoryCount.php +2 -2
  210. vendor/square/connect/lib/Model/InventoryPhysicalCount.php +2 -2
  211. vendor/square/connect/lib/Model/InventoryTransfer.php +2 -2
  212. vendor/square/connect/lib/Model/ListPaymentRefundsRequest.php +344 -0
  213. vendor/square/connect/lib/Model/ListPaymentRefundsResponse.php +212 -0
  214. vendor/square/connect/lib/Model/ListPaymentsRequest.php +377 -0
  215. vendor/square/connect/lib/Model/ListPaymentsResponse.php +212 -0
  216. vendor/square/connect/lib/Model/Location.php +268 -4
  217. vendor/square/connect/lib/Model/MeasurementUnit.php +70 -4
  218. vendor/square/connect/lib/Model/MeasurementUnitGeneric.php +117 -0
  219. vendor/square/connect/lib/Model/MeasurementUnitUnitType.php +117 -0
  220. vendor/square/connect/lib/Model/Money.php +4 -4
  221. vendor/square/connect/lib/Model/ObtainTokenResponse.php +4 -4
  222. vendor/square/connect/lib/Model/Order.php +113 -14
  223. vendor/square/connect/lib/Model/OrderEntry.php +33 -0
  224. vendor/square/connect/lib/Model/OrderFulfillment.php +72 -6
  225. vendor/square/connect/lib/Model/OrderFulfillmentPickupDetails.php +30 -30
  226. vendor/square/connect/lib/Model/OrderFulfillmentRecipient.php +45 -12
  227. vendor/square/connect/lib/Model/OrderFulfillmentShipmentDetails.php +608 -0
  228. vendor/square/connect/lib/Model/OrderLineItem.php +74 -8
  229. vendor/square/connect/lib/Model/OrderLineItemAppliedDiscount.php +212 -0
  230. vendor/square/connect/lib/Model/OrderLineItemAppliedTax.php +212 -0
  231. vendor/square/connect/lib/Model/OrderLineItemDiscount.php +8 -8
  232. vendor/square/connect/lib/Model/OrderLineItemModifier.php +2 -2
  233. vendor/square/connect/lib/Model/OrderLineItemTax.php +8 -8
  234. vendor/square/connect/lib/Model/OrderQuantityUnit.php +2 -2
  235. vendor/square/connect/lib/Model/OrderReturn.php +39 -6
  236. vendor/square/connect/lib/Model/OrderReturnDiscount.php +6 -6
  237. vendor/square/connect/lib/Model/OrderReturnLineItem.php +72 -6
  238. vendor/square/connect/lib/Model/OrderReturnLineItemModifier.php +2 -2
  239. vendor/square/connect/lib/Model/OrderReturnServiceCharge.php +542 -0
  240. vendor/square/connect/lib/Model/OrderReturnTax.php +6 -6
  241. vendor/square/connect/lib/Model/OrderRoundingAdjustment.php +2 -2
  242. vendor/square/connect/lib/Model/OrderServiceCharge.php +509 -0
  243. vendor/square/connect/lib/Model/OrderServiceChargeCalculationPhase.php +117 -0
  244. vendor/square/connect/lib/Model/PayOrderRequest.php +212 -0
  245. vendor/square/connect/lib/Model/PayOrderResponse.php +179 -0
  246. vendor/square/connect/lib/Model/Payment.php +806 -0
  247. vendor/square/connect/lib/Model/PaymentRefund.php +476 -0
  248. vendor/square/connect/lib/Model/ProcessingFee.php +212 -0
  249. vendor/square/connect/lib/Model/RefundPaymentRequest.php +278 -0
  250. vendor/square/connect/lib/Model/RefundPaymentResponse.php +179 -0
  251. vendor/square/connect/lib/Model/RenewTokenResponse.php +4 -4
  252. vendor/square/connect/lib/Model/RetrieveCatalogObjectRequest.php +2 -2
  253. vendor/square/connect/lib/Model/RetrieveLocationRequest.php +117 -0
  254. vendor/square/connect/lib/Model/RetrieveLocationResponse.php +179 -0
  255. vendor/square/connect/lib/Model/SearchCatalogObjectsRequest.php +2 -2
  256. vendor/square/connect/lib/Model/SearchOrdersCustomerFilter.php +2 -2
  257. vendor/square/connect/lib/Model/SearchOrdersDateTimeFilter.php +6 -6
  258. vendor/square/connect/lib/Model/SearchOrdersFilter.php +2 -2
  259. vendor/square/connect/lib/Model/SearchOrdersRequest.php +8 -8
  260. vendor/square/connect/lib/Model/SearchOrdersResponse.php +8 -41
  261. vendor/square/connect/lib/Model/SearchOrdersSort.php +4 -4
  262. vendor/square/connect/lib/Model/SearchOrdersSourceFilter.php +2 -2
  263. vendor/square/connect/lib/Model/StandardUnitDescription.php +212 -0
  264. vendor/square/connect/lib/Model/StandardUnitDescriptionGroup.php +179 -0
  265. vendor/square/connect/lib/Model/Tender.php +39 -6
  266. vendor/square/connect/lib/Model/UpdateOrderRequest.php +212 -0
  267. vendor/square/connect/lib/Model/UpdateOrderResponse.php +179 -0
  268. vendor/square/connect/lib/Model/V1CashDrawerShift.php +2 -2
  269. vendor/square/connect/lib/Model/V1Item.php +4 -4
  270. vendor/square/connect/lib/Model/WebhookEvents.php +117 -0
  271. vendor/square/connect/test/Api/CatalogApiTest.php +0 -1
  272. vendor/square/connect/test/Api/PaymentsApiTest.php +95 -0
  273. vendor/square/connect/test/Api/RefundsApiTest.php +68 -0
  274. vendor/square/connect/test/Api/ReportingApiTest.php +0 -18
  275. vendor/square/connect/test/Model/AggregationStrategyTest.php +43 -0
  276. vendor/square/connect/test/Model/BalancePaymentDetailsTest.php +43 -0
  277. vendor/square/connect/test/Model/CancelPaymentByIdempotencyKeyRequestTest.php +43 -0
  278. vendor/square/connect/test/Model/CancelPaymentByIdempotencyKeyResponseTest.php +43 -0
  279. vendor/square/connect/test/Model/CancelPaymentRequestTest.php +43 -0
  280. vendor/square/connect/test/Model/CancelPaymentResponseTest.php +43 -0
  281. vendor/square/connect/test/Model/CardPaymentDetailsTest.php +43 -0
  282. vendor/square/connect/test/Model/CatalogItemOptionForItemTest.php +43 -0
  283. vendor/square/connect/test/Model/CatalogItemOptionTest.php +43 -0
  284. vendor/square/connect/test/Model/CatalogItemOptionValueForItemVariationTest.php +43 -0
  285. vendor/square/connect/test/Model/CatalogItemOptionValueTest.php +43 -0
  286. vendor/square/connect/test/Model/CatalogMeasurementUnitTest.php +43 -0
  287. vendor/square/connect/test/Model/CatalogPricingRuleTest.php +43 -0
  288. vendor/square/connect/test/Model/CatalogProductSetTest.php +43 -0
  289. vendor/square/connect/test/Model/CatalogQueryItemVariationsForItemOptionValuesTest.php +43 -0
  290. vendor/square/connect/test/Model/CatalogQueryItemsForItemOptionsTest.php +43 -0
  291. vendor/square/connect/test/Model/CatalogTimePeriodTest.php +43 -0
  292. vendor/square/connect/test/Model/CompletePaymentRequestTest.php +43 -0
  293. vendor/square/connect/test/Model/CompletePaymentResponseTest.php +43 -0
  294. vendor/square/connect/test/Model/CoordinatesTest.php +43 -0
  295. vendor/square/connect/test/Model/CreatePaymentRequestTest.php +43 -0
  296. vendor/square/connect/test/Model/CreatePaymentResponseTest.php +43 -0
  297. vendor/square/connect/test/Model/GetPaymentRefundRequestTest.php +43 -0
  298. vendor/square/connect/test/Model/GetPaymentRefundResponseTest.php +43 -0
  299. vendor/square/connect/test/Model/GetPaymentRequestTest.php +43 -0
  300. vendor/square/connect/test/Model/GetPaymentResponseTest.php +43 -0
  301. vendor/square/connect/test/Model/ListPaymentRefundsRequestTest.php +43 -0
  302. vendor/square/connect/test/Model/ListPaymentRefundsResponseTest.php +43 -0
  303. vendor/square/connect/test/Model/ListPaymentsRequestTest.php +43 -0
  304. vendor/square/connect/test/Model/ListPaymentsResponseTest.php +43 -0
  305. vendor/square/connect/test/Model/MeasurementUnitGenericTest.php +43 -0
  306. vendor/square/connect/test/Model/MeasurementUnitTimeTest.php +43 -0
  307. vendor/square/connect/test/Model/MeasurementUnitUnitTypeTest.php +43 -0
  308. vendor/square/connect/test/Model/OrderFulfillmentShipmentDetailsTest.php +43 -0
  309. vendor/square/connect/test/Model/OrderLineItemAppliedDiscountTest.php +43 -0
  310. vendor/square/connect/test/Model/OrderLineItemAppliedTaxTest.php +43 -0
  311. vendor/square/connect/test/Model/OrderReturnServiceChargeTest.php +43 -0
  312. vendor/square/connect/test/Model/OrderServiceChargeCalculationPhaseTest.php +43 -0
  313. vendor/square/connect/test/Model/OrderServiceChargeTest.php +43 -0
  314. vendor/square/connect/test/Model/PayOrderRequestTest.php +43 -0
  315. vendor/square/connect/test/Model/PayOrderResponseTest.php +43 -0
  316. vendor/square/connect/test/Model/PaymentRefundTest.php +43 -0
  317. vendor/square/connect/test/Model/PaymentTest.php +43 -0
  318. vendor/square/connect/test/Model/ProcessingFeeTest.php +43 -0
  319. vendor/square/connect/test/Model/RefundPaymentRequestTest.php +43 -0
  320. vendor/square/connect/test/Model/RefundPaymentResponseTest.php +43 -0
  321. vendor/square/connect/test/Model/RetrieveLocationRequestTest.php +43 -0
  322. vendor/square/connect/test/Model/RetrieveLocationResponseTest.php +43 -0
  323. vendor/square/connect/test/Model/StandardUnitDescriptionGroupTest.php +43 -0
  324. vendor/square/connect/test/Model/StandardUnitDescriptionTest.php +43 -0
  325. vendor/square/connect/test/Model/UpdateOrderRequestTest.php +43 -0
  326. vendor/square/connect/test/Model/UpdateOrderResponseTest.php +43 -0
  327. vendor/square/connect/test/Model/WebhookEventsTest.php +43 -0
  328. woocommerce-square.php +1 -1
i18n/languages/woocommerce-square.pot CHANGED
@@ -2,7 +2,7 @@
2
# This file is distributed under the GNU General Public License v3.0.
3
msgid ""
4
msgstr ""
5
- "Project-Id-Version: WooCommerce Square 2.0.3\n"
6
"Report-Msgid-Bugs-To: "
7
"https://github.com/woocommerce/woocommerce-square/issues\n"
8
"POT-Creation-Date: 2019-08-19 13:09:58+00:00\n"
2
# This file is distributed under the GNU General Public License v3.0.
3
msgid ""
4
msgstr ""
5
+ "Project-Id-Version: WooCommerce Square 2.0.4\n"
6
"Report-Msgid-Bugs-To: "
7
"https://github.com/woocommerce/woocommerce-square/issues\n"
8
"POT-Creation-Date: 2019-08-19 13:09:58+00:00\n"
includes/Gateway.php CHANGED
@@ -273,10 +273,28 @@ class Gateway extends Framework\SV_WC_Payment_Gateway_Direct {
273
274
try {
275
276
- $response = $this->get_api()->create_order( $this->get_plugin()->get_settings_handler()->get_location_id(), $order );
277
278
$order->square_order_id = $response->getId();
279
280
// reset the payment total to the total calculated by Square to prevent errors
281
$order->payment_total = Framework\SV_WC_Helper::number_format( Money_Utility::cents_to_float( $response->getTotalMoney()->getAmount() ) );
282
273
274
try {
275
276
+ $location_id = $this->get_plugin()->get_settings_handler()->get_location_id();
277
+ $response = $this->get_api()->create_order( $location_id, $order );
278
279
$order->square_order_id = $response->getId();
280
281
+ // adjust order by difference between WooCommerce and Square order totals
282
+ $wc_total = Money_Utility::amount_to_cents( $order->get_total() );
283
+ $square_total = $response->getTotalMoney()->getAmount();
284
+ $delta_total = $wc_total - $square_total;
285
+
286
+ if ( abs( $delta_total ) > 0 ) {
287
+ $response = $this->get_api()->adjust_order( $location_id, $order, $response->getVersion(), $delta_total );
288
+
289
+ // since a downward adjustment causes (downward) tax recomputation, perform an additional (untaxed) upward adjustment if necessary
290
+ $square_total = $response->getTotalMoney()->getAmount();
291
+ $delta_total = $wc_total - $square_total;
292
+
293
+ if ( $delta_total > 0 ) {
294
+ $response = $this->get_api()->adjust_order( $location_id, $order, $response->getVersion(), $delta_total );
295
+ }
296
+ }
297
+
298
// reset the payment total to the total calculated by Square to prevent errors
299
$order->payment_total = Framework\SV_WC_Helper::number_format( Money_Utility::cents_to_float( $response->getTotalMoney()->getAmount() ) );
300
includes/Gateway/API.php CHANGED
@@ -309,6 +309,35 @@ class API extends \WooCommerce\Square\API {
309
}
310
311
312
/**
313
* Gets an existing transaction.
314
*
309
}
310
311
312
+ /**
313
+ * Adjusts an existing Square order by amount.
314
+ *
315
+ * @since 2.0.4
316
+ *
317
+ * @param string $location_id location ID
318
+ * @param \WC_Order $order
319
+ * @param int $version Current 'version' value of Square order
320
+ * @param int $amount Amount of adjustment in smallest unit
321
+ * @return Order
322
+ * @throws Framework\SV_WC_API_Exception
323
+ */
324
+ public function adjust_order( $location_id, \WC_Order $order, $version, $amount ) {
325
+
326
+ $request = new API\Requests\Orders( $this->client );
327
+
328
+ if ( $amount > 0 ) {
329
+ $request->add_line_item_order_data( $location_id, $order, $version, $amount );
330
+ } else {
331
+ $request->add_discount_order_data( $location_id, $order, $version, -1 * $amount );
332
+ }
333
+ $this->set_response_handler( \WooCommerce\Square\API\Response::class );
334
+
335
+ $response = $this->perform_request( $request );
336
+
337
+ return $response->get_data()->getOrder();
338
+ }
339
+
340
+
341
/**
342
* Gets an existing transaction.
343
*
includes/Gateway/API/Requests/Orders.php CHANGED
@@ -70,10 +70,11 @@ class Orders extends API\Request {
70
$order_model->setReferenceId( $order->get_order_number() );
71
72
$line_items = array_merge( $this->get_product_line_items( $order ), $this->get_fee_line_items( $order ), $this->get_shipping_line_items( $order ) );
73
74
$order_model->setLineItems( $line_items );
75
-
76
- $order_model->setTaxes( $this->get_order_taxes( $order ) );
77
78
if ( $order->get_discount_total() ) {
79
@@ -81,6 +82,7 @@ class Orders extends API\Request {
81
'name' => __( 'Discount', 'woocommerce-square' ),
82
'type' => 'FIXED_AMOUNT',
83
'amount_money' => Money_Utility::amount_to_money( $order->get_discount_total(), $order->get_currency() ),
84
] ) ] );
85
}
86
@@ -214,8 +216,10 @@ class Orders extends API\Request {
214
foreach ( $order->get_taxes() as $tax ) {
215
216
$tax_item = new SquareModel\OrderLineItemTax( [
217
- 'name' => $tax->get_name(),
218
- 'type' => 'ADDITIVE',
219
] );
220
221
$pre_tax_total = (float) $order->get_total() - (float) $order->get_total_tax();
@@ -232,4 +236,106 @@ class Orders extends API\Request {
232
}
233
234
235
}
70
$order_model->setReferenceId( $order->get_order_number() );
71
72
$line_items = array_merge( $this->get_product_line_items( $order ), $this->get_fee_line_items( $order ), $this->get_shipping_line_items( $order ) );
73
+ $taxes = $this->get_order_taxes( $order );
74
75
+ $this->apply_taxes( $taxes, $line_items );
76
$order_model->setLineItems( $line_items );
77
+ $order_model->setTaxes( $taxes );
78
79
if ( $order->get_discount_total() ) {
80
82
'name' => __( 'Discount', 'woocommerce-square' ),
83
'type' => 'FIXED_AMOUNT',
84
'amount_money' => Money_Utility::amount_to_money( $order->get_discount_total(), $order->get_currency() ),
85
+ 'scope' => 'ORDER',
86
] ) ] );
87
}
88
216
foreach ( $order->get_taxes() as $tax ) {
217
218
$tax_item = new SquareModel\OrderLineItemTax( [
219
+ 'uid' => uniqid(),
220
+ 'name' => $tax->get_name(),
221
+ 'type' => 'ADDITIVE',
222
+ 'scope' => 'LINE_ITEM',
223
] );
224
225
$pre_tax_total = (float) $order->get_total() - (float) $order->get_total_tax();
236
}
237
238
239
+ /**
240
+ * Applies taxes on each Square line item.
241
+ *
242
+ * @since 2.0.4
243
+ *
244
+ * @param SquareModel\OrderLineItemTax[] $taxes
245
+ * @param SquareModel\OrderLineItem[] $line_items
246
+ */
247
+ protected function apply_taxes( $taxes, $line_items ) {
248
+
249
+ foreach ( $line_items as $line_item ) {
250
+
251
+ $applied_taxes = [];
252
+
253
+ foreach ( $taxes as $tax ) {
254
+
255
+ $applied_taxes[] = new SquareModel\OrderLineItemAppliedTax( [
256
+ 'tax_uid' => $tax->getUid(),
257
+ ] );
258
+ }
259
+
260
+ $line_item->setAppliedTaxes( $applied_taxes );
261
+ }
262
+ }
263
+
264
+
265
+ /**
266
+ * Sets the data for updating an order with a line item adjustment.
267
+ *
268
+ * @since 2.0.4
269
+ *
270
+ * @param string $location_id location ID
271
+ * @param \WC_Order $order order object
272
+ * @param int $version Current 'version' value of Square order
273
+ * @param int $amount Amount of line item in smallest unit
274
+ */
275
+ public function add_line_item_order_data( $location_id, \WC_Order $order, $version, $amount ) {
276
+
277
+ $this->square_api_method = 'updateOrder';
278
+ $this->square_request = new SquareModel\UpdateOrderRequest();
279
+
280
+ $order_model = new SquareModel\Order();
281
+ $order_model->setVersion( $version );
282
+
283
+ $order_model->setLineItems( [ new SquareModel\OrderLineItem( [
284
+ 'name' => __( 'Adjustment', 'woocommerce-square' ),
285
+ 'quantity' => (string) 1,
286
+ 'base_price_money' => new SquareModel\Money( [
287
+ 'amount' => $amount,
288
+ 'currency' => $order->get_currency(),
289
+ ] ),
290
+ ] ) ] );
291
+
292
+ $this->square_request->setIdempotencyKey( wc_square()->get_idempotency_key( $order->unique_transaction_ref ) . $version );
293
+ $this->square_request->setOrder( $order_model );
294
+
295
+ $this->square_api_args = [
296
+ $location_id,
297
+ $order->square_order_id,
298
+ $this->square_request,
299
+ ];
300
+ }
301
+
302
+
303
+ /**
304
+ * Sets the data for updating an order with a discount adjustment.
305
+ *
306
+ * @since 2.0.4
307
+ *
308
+ * @param string $location_id location ID
309
+ * @param \WC_Order $order order object
310
+ * @param int $version Current 'version' value of Square order
311
+ * @param int $amount Amount of discount in smallest unit
312
+ */
313
+ public function add_discount_order_data( $location_id, \WC_Order $order, $version, $amount ) {
314
+
315
+ $this->square_api_method = 'updateOrder';
316
+ $this->square_request = new SquareModel\UpdateOrderRequest();
317
+
318
+ $order_model = new SquareModel\Order();
319
+ $order_model->setVersion( $version );
320
+
321
+ $order_model->setDiscounts( [ new SquareModel\OrderLineItemDiscount( [
322
+ 'name' => __( 'Adjustment', 'woocommerce-square' ),
323
+ 'type' => 'FIXED_AMOUNT',
324
+ 'amount_money' => new SquareModel\Money( [
325
+ 'amount' => $amount,
326
+ 'currency' => $order->get_currency(),
327
+ ] ),
328
+ 'scope' => 'ORDER',
329
+ ] ) ] );
330
+
331
+ $this->square_request->setIdempotencyKey( wc_square()->get_idempotency_key( $order->unique_transaction_ref ) . $version );
332
+ $this->square_request->setOrder( $order_model );
333
+
334
+ $this->square_api_args = [
335
+ $location_id,
336
+ $order->square_order_id,
337
+ $this->square_request,
338
+ ];
339
+ }
340
+
341
}
includes/Lifecycle.php CHANGED
@@ -52,7 +52,7 @@ class Lifecycle extends Framework\Plugin\Lifecycle {
52
// plugin upgrade path: maps automatically each semver to upgrade_to_x_y_z() protected method
53
$this->upgrade_versions = [
54
'2.0.0',
55
- '2.0.3',
56
];
57
}
58
@@ -143,11 +143,11 @@ class Lifecycle extends Framework\Plugin\Lifecycle {
143
144
145
/**
146
- * Upgrades to version 2.0.3.
147
*
148
- * @since 2.0.3
149
*/
150
- protected function upgrade_to_2_0_3() {
151
152
$v1_settings = get_option( 'woocommerce_squareconnect_settings', [] );
153
$v2_settings = get_option( 'wc_square_settings', [] );
52
// plugin upgrade path: maps automatically each semver to upgrade_to_x_y_z() protected method
53
$this->upgrade_versions = [
54
'2.0.0',
55
+ '2.0.4',
56
];
57
}
58
143
144
145
/**
146
+ * Upgrades to version 2.0.4.
147
*
148
+ * @since 2.0.4
149
*/
150
+ protected function upgrade_to_2_0_4() {
151
152
$v1_settings = get_option( 'woocommerce_squareconnect_settings', [] );
153
$v2_settings = get_option( 'wc_square_settings', [] );
includes/Plugin.php CHANGED
@@ -41,7 +41,7 @@ class Plugin extends Framework\SV_WC_Payment_Gateway_Plugin {
41
42
43
/** plugin version number */
44
- const VERSION = '2.0.3';
45
46
/** plugin ID */
47
const PLUGIN_ID = 'square';
41
42
43
/** plugin version number */
44
+ const VERSION = '2.0.4';
45
46
/** plugin ID */
47
const PLUGIN_ID = 'square';
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: credit card, square, woocommerce, inventory sync
4
Requires at least: 4.6
5
Tested up to: 5.2.0
6
Requires PHP: 5.6
7
- Stable tag: 2.0.3
8
License: GPLv3
9
License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
@@ -72,6 +72,9 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
72
73
== Changelog ==
74
75
= 2.0.3 - 2019.08.19 =
76
* Tweak - Re-introduce the "inventory sync" toggle to allow syncing product data without affecting inventory
77
* Fix - Adjust v1 upgrades to properly toggle inventory sync when not enabled in v1
4
Requires at least: 4.6
5
Tested up to: 5.2.0
6
Requires PHP: 5.6
7
+ Stable tag: 2.0.4
8
License: GPLv3
9
License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
72
73
== Changelog ==
74
75
+ = 2.0.4 - 2019.09.03 =
76
+ * Fix - Add adjustments to Square order in the event of discrepancy with WooCommerce total
77
+
78
= 2.0.3 - 2019.08.19 =
79
* Tweak - Re-introduce the "inventory sync" toggle to allow syncing product data without affecting inventory
80
* Fix - Adjust v1 upgrades to properly toggle inventory sync when not enabled in v1
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
5
require_once __DIR__ . '/composer/autoload_real.php';
6
7
- return ComposerAutoloaderInitdca653ba0a294778f151c44f73d7ca89::getLoader();
4
5
require_once __DIR__ . '/composer/autoload_real.php';
6
7
+ return ComposerAutoloaderInit5fe3bee6c088a59752379ee4b9b38ccc::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -279,7 +279,7 @@ class ClassLoader
279
*/
280
public function setApcuPrefix($apcuPrefix)
281
{
282
- $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
}
284
285
/**
279
*/
280
public function setApcuPrefix($apcuPrefix)
281
{
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283
}
284
285
/**
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
3
// autoload_real.php @generated by Composer
4
5
- class ComposerAutoloaderInitdca653ba0a294778f151c44f73d7ca89
6
{
7
private static $loader;
8
@@ -19,15 +19,15 @@ class ComposerAutoloaderInitdca653ba0a294778f151c44f73d7ca89
19
return self::$loader;
20
}
21
22
- spl_autoload_register(array('ComposerAutoloaderInitdca653ba0a294778f151c44f73d7ca89', 'loadClassLoader'), true, true);
23
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitdca653ba0a294778f151c44f73d7ca89', 'loadClassLoader'));
25
26
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
if ($useStaticLoader) {
28
require_once __DIR__ . '/autoload_static.php';
29
30
- call_user_func(\Composer\Autoload\ComposerStaticInitdca653ba0a294778f151c44f73d7ca89::getInitializer($loader));
31
} else {
32
$map = require __DIR__ . '/autoload_namespaces.php';
33
foreach ($map as $namespace => $path) {
2
3
// autoload_real.php @generated by Composer
4
5
+ class ComposerAutoloaderInit5fe3bee6c088a59752379ee4b9b38ccc
6
{
7
private static $loader;
8
19
return self::$loader;
20
}
21
22
+ spl_autoload_register(array('ComposerAutoloaderInit5fe3bee6c088a59752379ee4b9b38ccc', 'loadClassLoader'), true, true);
23
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit5fe3bee6c088a59752379ee4b9b38ccc', 'loadClassLoader'));
25
26
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
if ($useStaticLoader) {
28
require_once __DIR__ . '/autoload_static.php';
29
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit5fe3bee6c088a59752379ee4b9b38ccc::getInitializer($loader));
31
} else {
32
$map = require __DIR__ . '/autoload_namespaces.php';
33
foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
5
namespace Composer\Autoload;
6
7
- class ComposerStaticInitdca653ba0a294778f151c44f73d7ca89
8
{
9
public static $prefixLengthsPsr4 = array (
10
'S' =>
@@ -23,8 +23,8 @@ class ComposerStaticInitdca653ba0a294778f151c44f73d7ca89
23
public static function getInitializer(ClassLoader $loader)
24
{
25
return \Closure::bind(function () use ($loader) {
26
- $loader->prefixLengthsPsr4 = ComposerStaticInitdca653ba0a294778f151c44f73d7ca89::$prefixLengthsPsr4;
27
- $loader->prefixDirsPsr4 = ComposerStaticInitdca653ba0a294778f151c44f73d7ca89::$prefixDirsPsr4;
28
29
}, null, ClassLoader::class);
30
}
4
5
namespace Composer\Autoload;
6
7
+ class ComposerStaticInit5fe3bee6c088a59752379ee4b9b38ccc
8
{
9
public static $prefixLengthsPsr4 = array (
10
'S' =>
23
public static function getInitializer(ClassLoader $loader)
24
{
25
return \Closure::bind(function () use ($loader) {
26
+ $loader->prefixLengthsPsr4 = ComposerStaticInit5fe3bee6c088a59752379ee4b9b38ccc::$prefixLengthsPsr4;
27
+ $loader->prefixDirsPsr4 = ComposerStaticInit5fe3bee6c088a59752379ee4b9b38ccc::$prefixDirsPsr4;
28
29
}, null, ClassLoader::class);
30
}
vendor/composer/installed.json CHANGED
@@ -55,17 +55,17 @@
55
},
56
{
57
"name": "square/connect",
58
- "version": "2.20190508.0",
59
- "version_normalized": "2.20190508.0.0",
60
"source": {
61
"type": "git",
62
"url": "https://github.com/square/connect-php-sdk.git",
63
- "reference": "da592185d59b8ed80a02d5b2eba812e49eed793e"
64
},
65
"dist": {
66
"type": "zip",
67
- "url": "https://api.github.com/repos/square/connect-php-sdk/zipball/da592185d59b8ed80a02d5b2eba812e49eed793e",
68
- "reference": "da592185d59b8ed80a02d5b2eba812e49eed793e",
69
"shasum": ""
70
},
71
"require": {
@@ -79,7 +79,7 @@
79
"satooshi/php-coveralls": "~0.6.1",
80
"squizlabs/php_codesniffer": "~2.0"
81
},
82
- "time": "2019-05-08T21:21:07+00:00",
83
"type": "library",
84
"installation-source": "dist",
85
"autoload": {
55
},
56
{
57
"name": "square/connect",
58
+ "version": "2.20190814.2",
59
+ "version_normalized": "2.20190814.2.0",
60
"source": {
61
"type": "git",
62
"url": "https://github.com/square/connect-php-sdk.git",
63
+ "reference": "d778579a9f42c06d4eb68bcd78e7371f1b2f8f94"
64
},
65
"dist": {
66
"type": "zip",
67
+ "url": "https://api.github.com/repos/square/connect-php-sdk/zipball/d778579a9f42c06d4eb68bcd78e7371f1b2f8f94",
68
+ "reference": "d778579a9f42c06d4eb68bcd78e7371f1b2f8f94",
69
"shasum": ""
70
},
71
"require": {
79
"satooshi/php-coveralls": "~0.6.1",
80
"squizlabs/php_codesniffer": "~2.0"
81
},
82
+ "time": "2019-08-23T19:44:40+00:00",
83
"type": "library",
84
"installation-source": "dist",
85
"autoload": {
vendor/square/connect/CHANGES.md CHANGED
@@ -1,5 +1,45 @@
1
# Change Log
2
3
## Version 2.20190508.0 (2019-05-08)
4
5
## Details
@@ -62,15 +102,15 @@
62
## New API: Labor API
63
64
The Labor API now includes functionality
65
- that gives a Square account the ability to track and retrieve employee labor hours
66
- including multiple hourly wage rates per employee, work shift break tracking, and
67
standardized break templates.
68
69
See the Connect v2 Technical Reference.
70
71
## New API: Employees API
72
73
- The Employees API includes the ability to list employees for a Square
74
account and retrieve a single employee by ID.
75
76
See the Connect v2 Technical Reference.
1
# Change Log
2
3
+ ## Version 2.20190814.2 (2019-08-23)
4
+
5
+ * **Bug fix**: Fixed path parameters for `UpdateOrder`
6
+
7
+ ## Version 2.20190814.1 (2018-08-16)
8
+
9
+ * **Bug fix**: Removed a currently unsupported API object type
10
+ ## Version 2.20190814.0 (2019-08-15)
11
+
12
+ * **New functionality**: All SDKs have been updated to support the Sandbox v2 BETA release
13
+ * **Deprecated functionality**: All Transactions API functionality is deprecated in favor of Payments API and Refunds API functionality.
14
+ * **New functionality**: All SDKs have been updated to support the Payments API GA.
15
+ * **New functionality**: All SDKs have been updated to support the Refunds API GA.
16
+ * **New functionality**: All SDKs have been updated to support Orders API updates:
17
+ * Pickup Fulfillments, SearchOrders, and ServiceCharges move from BETA to GA.
18
+ * New BETA endpoint: Orders.UpdateOrder — use the UpdateOrder endpoint to update existing orders.
19
+ * New BETA functionality: Create shipment-type fulfillments.
20
+ * **New functionality**: Locations.RetrieveLocation — use the RetrieveLocation endpoint to load details for a specific Location.
21
+
22
+ ## Version 2.20190724.0 (2019-07-24)
23
+
24
+ * **BETA releases**:
25
+ * Catalog API: supports item options with datatypes and enums for item options and item option values.
26
+
27
+ ## Version 2.20190710.0 (2019-07-10)
28
+
29
+ * **Retired functionality** — The `CatalogItem.image_url` field (deprecated under `Square-Version` YYYYMMDD) is retired and no longer included in Connect SDKs.
30
+
31
+ ## Version 2.20190612.1 (2019-06-26)
32
+
33
+ * **Bug fix**: `Transaction.Charge` and `Customers.CreateCustomerCard` request objects — now include the `verification_token` required for [Strong Customer Authentication](https://developer.squareup.com/docs/sca-overview).
34
+
35
+ ## Version 2.20190612.0 (2019-06-12)
36
+
37
+ * **BETA releases**:
38
+ * Orders API: supports service charges with a new field and datatype.
39
+ * Catalog API: supports measurement unites for item variation quantities with a new field and datatype.
40
+ * **New functionality**: `Order` entities — now include a `source` field that contains details on where the order originated.
41
+ * **Improved functionality**: ListLocations — Expanded business information available through the Locations API, including business hours, contact email, social media handles, and longitude/latitude for physical locations.
42
+
43
## Version 2.20190508.0 (2019-05-08)
44
45
## Details
102
## New API: Labor API
103
104
The Labor API now includes functionality
105
+ that gives a Square account the ability to track and retrieve employee labor hours
106
+ including multiple hourly wage rates per employee, work shift break tracking, and
107
standardized break templates.
108
109
See the Connect v2 Technical Reference.
110
111
## New API: Employees API
112
113
+ The Employees API includes the ability to list employees for a Square
114
account and retrieve a single employee by ID.
115
116
See the Connect v2 Technical Reference.
vendor/square/connect/README.md CHANGED
@@ -1,4 +1,11 @@
1
- Square Connect PHP SDK [![Build Status](https://travis-ci.org/square/connect-php-sdk.svg?branch=master)](https://travis-ci.org/square/connect-php-sdk)
2
==================
3
4
**If you have feedback about the new SDKs, or just want to talk to other Square Developers, request an invite to the new [slack community for Square Developers](https://squ.re/2JkDBcO)**
@@ -64,9 +71,12 @@ require 'vendor/autoload.php';
64
65
$access_token = 'YOUR_ACCESS_TOKEN';
66
# setup authorization
67
- \SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken($access_token);
68
# create an instance of the Location API
69
- $locations_api = new \SquareConnect\Api\LocationsApi();
70
71
try {
72
$locations = $locations_api->listLocations();
@@ -86,37 +96,59 @@ try {
86
require 'vendor/autoload.php';
87
88
$access_token = 'YOUR_ACCESS_TOKEN';
89
# setup authorization
90
- \SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken($access_token);
91
- # create an instance of the Transaction API class
92
- $transactions_api = new \SquareConnect\Api\TransactionsApi();
93
$location_id = 'YOUR_LOCATION_ID'
94
$nonce = 'YOUR_NONCE'
95
96
- $request_body = array (
97
- "card_nonce" => $nonce,
98
- # Monetary amounts are specified in the smallest unit of the applicable currency.
99
- # This amount is in cents. It's also hard-coded for $1.00, which isn't very useful.
100
- "amount_money" => array (
101
- "amount" => 100,
102
- "currency" => "USD"
103
- ),
104
- # Every payment you process with the SDK must have a unique idempotency key.
105
- # If you're unsure whether a particular payment succeeded, you can reattempt
106
- # it with the same idempotency key without worrying about double charging
107
- # the buyer.
108
- "idempotency_key" => uniqid()
109
- );
110
111
try {
112
- $result = $transactions_api->charge($location_id, $request_body);
113
print_r($result);
114
} catch (\SquareConnect\ApiException $e) {
115
- echo "Exception when calling TransactionApi->charge:";
116
var_dump($e->getResponseBody());
117
}
118
```
119
120
121
## Documentation for API Endpoints
122
@@ -175,7 +207,18 @@ Class | Method | HTTP request | Description
175
*OAuthApi* | [**revokeToken**](docs/Api/OAuthApi.md#revoketoken) | **POST** /oauth2/revoke | RevokeToken
176
*OrdersApi* | [**batchRetrieveOrders**](docs/Api/OrdersApi.md#batchretrieveorders) | **POST** /v2/locations/{location_id}/orders/batch-retrieve | BatchRetrieveOrders
177
*OrdersApi* | [**createOrder**](docs/Api/OrdersApi.md#createorder) | **POST** /v2/locations/{location_id}/orders | CreateOrder
178
*OrdersApi* | [**searchOrders**](docs/Api/OrdersApi.md#searchorders) | **POST** /v2/orders/search | SearchOrders
179
*ReportingApi* | [**listAdditionalRecipientReceivableRefunds**](docs/Api/ReportingApi.md#listadditionalrecipientreceivablerefunds) | **GET** /v2/locations/{location_id}/additional-recipient-receivable-refunds | ListAdditionalRecipientReceivableRefunds
180
*ReportingApi* | [**listAdditionalRecipientReceivables**](docs/Api/ReportingApi.md#listadditionalrecipientreceivables) | **GET** /v2/locations/{location_id}/additional-recipient-receivables | ListAdditionalRecipientReceivables
181
*TransactionsApi* | [**captureTransaction**](docs/Api/TransactionsApi.md#capturetransaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/capture | CaptureTransaction
@@ -262,6 +305,7 @@ Class | Method | HTTP request | Description
262
- [AdditionalRecipientReceivable](docs/Model/AdditionalRecipientReceivable.md)
263
- [AdditionalRecipientReceivableRefund](docs/Model/AdditionalRecipientReceivableRefund.md)
264
- [Address](docs/Model/Address.md)
265
- [BatchChangeInventoryRequest](docs/Model/BatchChangeInventoryRequest.md)
266
- [BatchChangeInventoryResponse](docs/Model/BatchChangeInventoryResponse.md)
267
- [BatchDeleteCatalogObjectsRequest](docs/Model/BatchDeleteCatalogObjectsRequest.md)
@@ -279,10 +323,15 @@ Class | Method | HTTP request | Description
279
- [BreakType](docs/Model/BreakType.md)
280
- [BusinessHours](docs/Model/BusinessHours.md)
281
- [BusinessHoursPeriod](docs/Model/BusinessHoursPeriod.md)
282
- [CaptureTransactionRequest](docs/Model/CaptureTransactionRequest.md)
283
- [CaptureTransactionResponse](docs/Model/CaptureTransactionResponse.md)
284
- [Card](docs/Model/Card.md)
285
- [CardBrand](docs/Model/CardBrand.md)
286
- [CatalogCategory](docs/Model/CatalogCategory.md)
287
- [CatalogDiscount](docs/Model/CatalogDiscount.md)
288
- [CatalogDiscountType](docs/Model/CatalogDiscountType.md)
@@ -293,8 +342,13 @@ Class | Method | HTTP request | Description
293
- [CatalogInfoResponseLimits](docs/Model/CatalogInfoResponseLimits.md)
294
- [CatalogItem](docs/Model/CatalogItem.md)
295
- [CatalogItemModifierListInfo](docs/Model/CatalogItemModifierListInfo.md)
296
- [CatalogItemProductType](docs/Model/CatalogItemProductType.md)
297
- [CatalogItemVariation](docs/Model/CatalogItemVariation.md)
298
- [CatalogModifier](docs/Model/CatalogModifier.md)
299
- [CatalogModifierList](docs/Model/CatalogModifierList.md)
300
- [CatalogModifierListSelectionType](docs/Model/CatalogModifierListSelectionType.md)
@@ -302,9 +356,13 @@ Class | Method | HTTP request | Description
302
- [CatalogObject](docs/Model/CatalogObject.md)
303
- [CatalogObjectBatch](docs/Model/CatalogObjectBatch.md)
304
- [CatalogObjectType](docs/Model/CatalogObjectType.md)
305
- [CatalogPricingType](docs/Model/CatalogPricingType.md)
306
- [CatalogQuery](docs/Model/CatalogQuery.md)
307
- [CatalogQueryExact](docs/Model/CatalogQueryExact.md)
308
- [CatalogQueryItemsForModifierList](docs/Model/CatalogQueryItemsForModifierList.md)
309
- [CatalogQueryItemsForTax](docs/Model/CatalogQueryItemsForTax.md)
310
- [CatalogQueryPrefix](docs/Model/CatalogQueryPrefix.md)
@@ -312,11 +370,15 @@ Class | Method | HTTP request | Description
312
- [CatalogQuerySortedAttribute](docs/Model/CatalogQuerySortedAttribute.md)
313
- [CatalogQueryText](docs/Model/CatalogQueryText.md)
314
- [CatalogTax](docs/Model/CatalogTax.md)
315
- [CatalogV1Id](docs/Model/CatalogV1Id.md)
316
- [ChargeRequest](docs/Model/ChargeRequest.md)
317
- [ChargeRequestAdditionalRecipient](docs/Model/ChargeRequestAdditionalRecipient.md)
318
- [ChargeResponse](docs/Model/ChargeResponse.md)
319
- [Checkout](docs/Model/Checkout.md)
320
- [Country](docs/Model/Country.md)
321
- [CreateBreakTypeRequest](docs/Model/CreateBreakTypeRequest.md)
322
- [CreateBreakTypeResponse](docs/Model/CreateBreakTypeResponse.md)
@@ -334,6 +396,8 @@ Class | Method | HTTP request | Description
334
- [CreateOrderRequestModifier](docs/Model/CreateOrderRequestModifier.md)
335
- [CreateOrderRequestTax](docs/Model/CreateOrderRequestTax.md)
336
- [CreateOrderResponse](docs/Model/CreateOrderResponse.md)
337
- [CreateRefundRequest](docs/Model/CreateRefundRequest.md)
338
- [CreateRefundResponse](docs/Model/CreateRefundResponse.md)
339
- [CreateShiftRequest](docs/Model/CreateShiftRequest.md)
@@ -372,6 +436,10 @@ Class | Method | HTTP request | Description
372
- [GetBreakTypeResponse](docs/Model/GetBreakTypeResponse.md)
373
- [GetEmployeeWageRequest](docs/Model/GetEmployeeWageRequest.md)
374
- [GetEmployeeWageResponse](docs/Model/GetEmployeeWageResponse.md)
375
- [GetShiftRequest](docs/Model/GetShiftRequest.md)
376
- [GetShiftResponse](docs/Model/GetShiftResponse.md)
377
- [InventoryAdjustment](docs/Model/InventoryAdjustment.md)
@@ -399,6 +467,10 @@ Class | Method | HTTP request | Description
399
- [ListEmployeesResponse](docs/Model/ListEmployeesResponse.md)
400
- [ListLocationsRequest](docs/Model/ListLocationsRequest.md)
401
- [ListLocationsResponse](docs/Model/ListLocationsResponse.md)
402
- [ListRefundsRequest](docs/Model/ListRefundsRequest.md)
403
- [ListRefundsResponse](docs/Model/ListRefundsResponse.md)
404
- [ListTransactionsRequest](docs/Model/ListTransactionsRequest.md)
@@ -412,7 +484,9 @@ Class | Method | HTTP request | Description
412
- [MeasurementUnit](docs/Model/MeasurementUnit.md)
413
- [MeasurementUnitArea](docs/Model/MeasurementUnitArea.md)
414
- [MeasurementUnitCustom](docs/Model/MeasurementUnitCustom.md)
415
- [MeasurementUnitLength](docs/Model/MeasurementUnitLength.md)
416
- [MeasurementUnitVolume](docs/Model/MeasurementUnitVolume.md)
417
- [MeasurementUnitWeight](docs/Model/MeasurementUnitWeight.md)
418
- [ModelBreak](docs/Model/ModelBreak.md)
@@ -425,9 +499,12 @@ Class | Method | HTTP request | Description
425
- [OrderFulfillmentPickupDetails](docs/Model/OrderFulfillmentPickupDetails.md)
426
- [OrderFulfillmentPickupDetailsScheduleType](docs/Model/OrderFulfillmentPickupDetailsScheduleType.md)
427
- [OrderFulfillmentRecipient](docs/Model/OrderFulfillmentRecipient.md)
428
- [OrderFulfillmentState](docs/Model/OrderFulfillmentState.md)
429
- [OrderFulfillmentType](docs/Model/OrderFulfillmentType.md)
430
- [OrderLineItem](docs/Model/OrderLineItem.md)
431
- [OrderLineItemDiscount](docs/Model/OrderLineItemDiscount.md)
432
- [OrderLineItemDiscountScope](docs/Model/OrderLineItemDiscountScope.md)
433
- [OrderLineItemDiscountType](docs/Model/OrderLineItemDiscountType.md)
@@ -441,12 +518,22 @@ Class | Method | HTTP request | Description
441
- [OrderReturnDiscount](docs/Model/OrderReturnDiscount.md)
442
- [OrderReturnLineItem](docs/Model/OrderReturnLineItem.md)
443
- [OrderReturnLineItemModifier](docs/Model/OrderReturnLineItemModifier.md)
444
- [OrderReturnTax](docs/Model/OrderReturnTax.md)
445
- [OrderRoundingAdjustment](docs/Model/OrderRoundingAdjustment.md)
446
- [OrderSource](docs/Model/OrderSource.md)
447
- [OrderState](docs/Model/OrderState.md)
448
- [Product](docs/Model/Product.md)
449
- [Refund](docs/Model/Refund.md)
450
- [RefundStatus](docs/Model/RefundStatus.md)
451
- [RegisterDomainRequest](docs/Model/RegisterDomainRequest.md)
452
- [RegisterDomainResponse](docs/Model/RegisterDomainResponse.md)
@@ -467,6 +554,8 @@ Class | Method | HTTP request | Description
467
- [RetrieveInventoryCountResponse](docs/Model/RetrieveInventoryCountResponse.md)
468
- [RetrieveInventoryPhysicalCountRequest](docs/Model/RetrieveInventoryPhysicalCountRequest.md)
469
- [RetrieveInventoryPhysicalCountResponse](docs/Model/RetrieveInventoryPhysicalCountResponse.md)
470
- [RetrieveTransactionRequest](docs/Model/RetrieveTransactionRequest.md)
471
- [RetrieveTransactionResponse](docs/Model/RetrieveTransactionResponse.md)
472
- [RevokeTokenRequest](docs/Model/RevokeTokenRequest.md)
@@ -500,6 +589,8 @@ Class | Method | HTTP request | Description
500
- [ShiftWorkdayMatcher](docs/Model/ShiftWorkdayMatcher.md)
501
- [SortOrder](docs/Model/SortOrder.md)
502
- [SourceApplication](docs/Model/SourceApplication.md)
503
- [TaxCalculationPhase](docs/Model/TaxCalculationPhase.md)
504
- [TaxInclusionType](docs/Model/TaxInclusionType.md)
505
- [Tender](docs/Model/Tender.md)
@@ -519,6 +610,8 @@ Class | Method | HTTP request | Description
519
- [UpdateItemModifierListsResponse](docs/Model/UpdateItemModifierListsResponse.md)
520
- [UpdateItemTaxesRequest](docs/Model/UpdateItemTaxesRequest.md)
521
- [UpdateItemTaxesResponse](docs/Model/UpdateItemTaxesResponse.md)
522
- [UpdateShiftRequest](docs/Model/UpdateShiftRequest.md)
523
- [UpdateShiftResponse](docs/Model/UpdateShiftResponse.md)
524
- [UpdateWorkweekConfigRequest](docs/Model/UpdateWorkweekConfigRequest.md)
@@ -687,6 +780,7 @@ Class | Method | HTTP request | Description
687
- [V1VariationPricingType](docs/Model/V1VariationPricingType.md)
688
- [VoidTransactionRequest](docs/Model/VoidTransactionRequest.md)
689
- [VoidTransactionResponse](docs/Model/VoidTransactionResponse.md)
690
- [Weekday](docs/Model/Weekday.md)
691
- [WorkweekConfig](docs/Model/WorkweekConfig.md)
692
@@ -706,7 +800,7 @@ Class | Method | HTTP request | Description
706
- **EMPLOYEES_WRITE**: __HTTP Method__: `POST`, `PUT`, `DELETE` Grants write access to employee profile information. For example, to create and modify employee profiles.
707
- **INVENTORY_READ**: __HTTP Method__: `GET` Grants read access to inventory information. For example, to call the RetrieveInventoryCount endpoint.
708
- **INVENTORY_WRITE**: __HTTP Method__: `POST`, `PUT`, `DELETE` Grants write access to inventory information. For example, to call the BatchChangeInventory endpoint.
709
- - **ITEMS_READ**: __HTTP Method__: `GET` Grants read access to business and location information. For example, to obtain a location ID for subsequent activity.
710
- **ITEMS_WRITE**: __HTTP Method__: `POST`, `PUT`, `DELETE` Grants write access to product catalog information. For example, to modify or add to a product catalog.
711
- **MERCHANT_PROFILE_READ**: __HTTP Method__: `GET` Grants read access to business and location information. For example, to obtain a location ID for subsequent activity.
712
- **ORDERS_READ**: __HTTP Method__: `GET` Grants read access to order information. For example, to call the BatchRetrieveOrders endpoint.
@@ -792,3 +886,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
792
See the License for the specific language governing permissions and
793
limitations under the License.
794
```
1
+ ![Square logo]
2
+
3
+ # Square Connect PHP SDK
4
+
5
+ ---
6
+
7
+ [![Build Status](https://travis-ci.org/square/connect-php-sdk.svg?branch=master)](https://travis-ci.org/square/connect-php-sdk)
8
+ [![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)
9
==================
10
11
**If you have feedback about the new SDKs, or just want to talk to other Square Developers, request an invite to the new [slack community for Square Developers](https://squ.re/2JkDBcO)**
71
72
$access_token = 'YOUR_ACCESS_TOKEN';
73
# setup authorization
74
+ $api_config = new \SquareConnect\Configuration();
75
+ $api_config->setHost("https://connect.squareup.com");
76
+ $api_config->setAccessToken($access_token);
77
+ $api_client = new \SquareConnect\ApiClient($api_config);
78
# create an instance of the Location API
79
+ $locations_api = new \SquareConnect\Api\LocationsApi($api_client);
80
81
try {
82
$locations = $locations_api->listLocations();
96
require 'vendor/autoload.php';
97
98
$access_token = 'YOUR_ACCESS_TOKEN';
99
+
100
# setup authorization
101
+ $api_config = new \SquareConnect\Configuration();
102
+ $api_config->setHost("https://connect.squareup.com");
103
+ $api_config->setAccessToken($access_token);
104
+ $api_client = new \SquareConnect\ApiClient($api_config);
105
+
106
+ # create an instance of the Payments API class
107
+ $payments_api = new \SquareConnect\Api\PaymentsApi($api_client);
108
$location_id = 'YOUR_LOCATION_ID'
109
$nonce = 'YOUR_NONCE'
110
111
+ $body = new \SquareConnect\Model\CreatePaymentRequest();
112
+
113
+ $amountMoney = new \SquareConnect\Model\Money();
114
+
115
+ # Monetary amounts are specified in the smallest unit of the applicable currency.
116
+ # This amount is in cents. It's also hard-coded for $1.00, which isn't very useful.
117
+ $amountMoney->setAmount(100);
118
+ $amountMoney->setCurrency("USD");
119
+
120
+ $body->setSourceId($nonce);
121
+ $body->setAmountMoney($amountMoney);
122
+ $body->setLocationId($location_id);
123
+
124
+ # Every payment you process with the SDK must have a unique idempotency key.
125
+ # If you're unsure whether a particular payment succeeded, you can reattempt
126
+ # it with the same idempotency key without worrying about double charging
127
+ # the buyer.
128
+ $body->setIdempotencyKey(uniqid());
129
130
try {
131
+ $result = $payments_api->createPayment($body);
132
print_r($result);
133
} catch (\SquareConnect\ApiException $e) {
134
+ echo "Exception when calling PaymentsApi->createPayment:";
135
var_dump($e->getResponseBody());
136
}
137
```
138
139
+ ### How to configure sandbox environment
140
+ ```php
141
+ require 'vendor/autoload.php';
142
+
143
+ $access_token = 'YOUR_SANDBOX_ACCESS_TOKEN';
144
+ # setup authorization
145
+ $api_config = new \SquareConnect\Configuration();
146
+ $api_config->setHost("https://connect.squareupsandbox.com");
147
+ $api_config->setAccessToken($access_token);
148
+ $api_client = new \SquareConnect\ApiClient($api_config);
149
+ # create an instance of the Location API
150
+ $locations_api = new \SquareConnect\Api\LocationsApi($api_client);
151
+ ```
152
153
## Documentation for API Endpoints
154
207
*OAuthApi* | [**revokeToken**](docs/Api/OAuthApi.md#revoketoken) | **POST** /oauth2/revoke | RevokeToken
208
*OrdersApi* | [**batchRetrieveOrders**](docs/Api/OrdersApi.md#batchretrieveorders) | **POST** /v2/locations/{location_id}/orders/batch-retrieve | BatchRetrieveOrders
209
*OrdersApi* | [**createOrder**](docs/Api/OrdersApi.md#createorder) | **POST** /v2/locations/{location_id}/orders | CreateOrder
210
+ *OrdersApi* | [**payOrder**](docs/Api/OrdersApi.md#payorder) | **POST** /v2/orders/{order_id}/pay | PayOrder
211
*OrdersApi* | [**searchOrders**](docs/Api/OrdersApi.md#searchorders) | **POST** /v2/orders/search | SearchOrders
212
+ *OrdersApi* | [**updateOrder**](docs/Api/OrdersApi.md#updateorder) | **PUT** /v2/locations/{location_id}/orders/{order_id} | UpdateOrder
213
+ *PaymentsApi* | [**cancelPayment**](docs/Api/PaymentsApi.md#cancelpayment) | **POST** /v2/payments/{payment_id}/cancel | CancelPayment
214
+ *PaymentsApi* | [**cancelPaymentByIdempotencyKey**](docs/Api/PaymentsApi.md#cancelpaymentbyidempotencykey) | **POST** /v2/payments/cancel | CancelPaymentByIdempotencyKey
215
+ *PaymentsApi* | [**completePayment**](docs/Api/PaymentsApi.md#completepayment) | **POST** /v2/payments/{payment_id}/complete | CompletePayment
216
+ *PaymentsApi* | [**createPayment**](docs/Api/PaymentsApi.md#createpayment) | **POST** /v2/payments | CreatePayment
217
+ *PaymentsApi* | [**getPayment**](docs/Api/PaymentsApi.md#getpayment) | **GET** /v2/payments/{payment_id} | GetPayment
218
+ *PaymentsApi* | [**listPayments**](docs/Api/PaymentsApi.md#listpayments) | **GET** /v2/payments | ListPayments
219
+ *RefundsApi* | [**getPaymentRefund**](docs/Api/RefundsApi.md#getpaymentrefund) | **GET** /v2/refunds/{refund_id} | GetPaymentRefund
220
+ *RefundsApi* | [**listPaymentRefunds**](docs/Api/RefundsApi.md#listpaymentrefunds) | **GET** /v2/refunds | ListPaymentRefunds
221
+ *RefundsApi* | [**refundPayment**](docs/Api/RefundsApi.md#refundpayment) | **POST** /v2/refunds | RefundPayment
222
*ReportingApi* | [**listAdditionalRecipientReceivableRefunds**](docs/Api/ReportingApi.md#listadditionalrecipientreceivablerefunds) | **GET** /v2/locations/{location_id}/additional-recipient-receivable-refunds | ListAdditionalRecipientReceivableRefunds
223
*ReportingApi* | [**listAdditionalRecipientReceivables**](docs/Api/ReportingApi.md#listadditionalrecipientreceivables) | **GET** /v2/locations/{location_id}/additional-recipient-receivables | ListAdditionalRecipientReceivables
224
*TransactionsApi* | [**captureTransaction**](docs/Api/TransactionsApi.md#capturetransaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/capture | CaptureTransaction
305
- [AdditionalRecipientReceivable](docs/Model/AdditionalRecipientReceivable.md)
306
- [AdditionalRecipientReceivableRefund](docs/Model/AdditionalRecipientReceivableRefund.md)
307
- [Address](docs/Model/Address.md)
308
+ - [BalancePaymentDetails](docs/Model/BalancePaymentDetails.md)
309
- [BatchChangeInventoryRequest](docs/Model/BatchChangeInventoryRequest.md)
310
- [BatchChangeInventoryResponse](docs/Model/BatchChangeInventoryResponse.md)
311
- [BatchDeleteCatalogObjectsRequest](docs/Model/BatchDeleteCatalogObjectsRequest.md)
323
- [BreakType](docs/Model/BreakType.md)
324
- [BusinessHours](docs/Model/BusinessHours.md)
325
- [BusinessHoursPeriod](docs/Model/BusinessHoursPeriod.md)
326
+ - [CancelPaymentByIdempotencyKeyRequest](docs/Model/CancelPaymentByIdempotencyKeyRequest.md)
327
+ - [CancelPaymentByIdempotencyKeyResponse](docs/Model/CancelPaymentByIdempotencyKeyResponse.md)
328
+ - [CancelPaymentRequest](docs/Model/CancelPaymentRequest.md)
329
+ - [CancelPaymentResponse](docs/Model/CancelPaymentResponse.md)
330
- [CaptureTransactionRequest](docs/Model/CaptureTransactionRequest.md)
331
- [CaptureTransactionResponse](docs/Model/CaptureTransactionResponse.md)
332
- [Card](docs/Model/Card.md)
333
- [CardBrand](docs/Model/CardBrand.md)
334
+ - [CardPaymentDetails](docs/Model/CardPaymentDetails.md)
335
- [CatalogCategory](docs/Model/CatalogCategory.md)
336
- [CatalogDiscount](docs/Model/CatalogDiscount.md)
337
- [CatalogDiscountType](docs/Model/CatalogDiscountType.md)
342
- [CatalogInfoResponseLimits](docs/Model/CatalogInfoResponseLimits.md)
343
- [CatalogItem](docs/Model/CatalogItem.md)
344
- [CatalogItemModifierListInfo](docs/Model/CatalogItemModifierListInfo.md)
345
+ - [CatalogItemOption](docs/Model/CatalogItemOption.md)
346
+ - [CatalogItemOptionForItem](docs/Model/CatalogItemOptionForItem.md)
347
+ - [CatalogItemOptionValue](docs/Model/CatalogItemOptionValue.md)
348
+ - [CatalogItemOptionValueForItemVariation](docs/Model/CatalogItemOptionValueForItemVariation.md)
349
- [CatalogItemProductType](docs/Model/CatalogItemProductType.md)
350
- [CatalogItemVariation](docs/Model/CatalogItemVariation.md)
351
+ - [CatalogMeasurementUnit](docs/Model/CatalogMeasurementUnit.md)
352
- [CatalogModifier](docs/Model/CatalogModifier.md)
353
- [CatalogModifierList](docs/Model/CatalogModifierList.md)
354
- [CatalogModifierListSelectionType](docs/Model/CatalogModifierListSelectionType.md)
356
- [CatalogObject](docs/Model/CatalogObject.md)
357
- [CatalogObjectBatch](docs/Model/CatalogObjectBatch.md)
358
- [CatalogObjectType](docs/Model/CatalogObjectType.md)
359
+ - [CatalogPricingRule](docs/Model/CatalogPricingRule.md)
360
- [CatalogPricingType](docs/Model/CatalogPricingType.md)
361
+ - [CatalogProductSet](docs/Model/CatalogProductSet.md)
362
- [CatalogQuery](docs/Model/CatalogQuery.md)
363
- [CatalogQueryExact](docs/Model/CatalogQueryExact.md)
364
+ - [CatalogQueryItemVariationsForItemOptionValues](docs/Model/CatalogQueryItemVariationsForItemOptionValues.md)
365
+ - [CatalogQueryItemsForItemOptions](docs/Model/CatalogQueryItemsForItemOptions.md)
366
- [CatalogQueryItemsForModifierList](docs/Model/CatalogQueryItemsForModifierList.md)
367
- [CatalogQueryItemsForTax](docs/Model/CatalogQueryItemsForTax.md)
368
- [CatalogQueryPrefix](docs/Model/CatalogQueryPrefix.md)
370
- [CatalogQuerySortedAttribute](docs/Model/CatalogQuerySortedAttribute.md)
371
- [CatalogQueryText](docs/Model/CatalogQueryText.md)
372
- [CatalogTax](docs/Model/CatalogTax.md)
373
+ - [CatalogTimePeriod](docs/Model/CatalogTimePeriod.md)
374
- [CatalogV1Id](docs/Model/CatalogV1Id.md)
375
- [ChargeRequest](docs/Model/ChargeRequest.md)
376
- [ChargeRequestAdditionalRecipient](docs/Model/ChargeRequestAdditionalRecipient.md)
377
- [ChargeResponse](docs/Model/ChargeResponse.md)
378
- [Checkout](docs/Model/Checkout.md)
379
+ - [CompletePaymentRequest](docs/Model/CompletePaymentRequest.md)
380
+ - [CompletePaymentResponse](docs/Model/CompletePaymentResponse.md)
381
+ - [Coordinates](docs/Model/Coordinates.md)
382
- [Country](docs/Model/Country.md)
383
- [CreateBreakTypeRequest](docs/Model/CreateBreakTypeRequest.md)
384
- [CreateBreakTypeResponse](docs/Model/CreateBreakTypeResponse.md)
396
- [CreateOrderRequestModifier](docs/Model/CreateOrderRequestModifier.md)
397
- [CreateOrderRequestTax](docs/Model/CreateOrderRequestTax.md)
398
- [CreateOrderResponse](docs/Model/CreateOrderResponse.md)
399
+ - [CreatePaymentRequest](docs/Model/CreatePaymentRequest.md)
400
+ - [CreatePaymentResponse](docs/Model/CreatePaymentResponse.md)
401
- [CreateRefundRequest](docs/Model/CreateRefundRequest.md)
402
- [CreateRefundResponse](docs/Model/CreateRefundResponse.md)
403
- [CreateShiftRequest](docs/Model/CreateShiftRequest.md)
436
- [GetBreakTypeResponse](docs/Model/GetBreakTypeResponse.md)
437
- [GetEmployeeWageRequest](docs/Model/GetEmployeeWageRequest.md)
438
- [GetEmployeeWageResponse](docs/Model/GetEmployeeWageResponse.md)
439
+ - [GetPaymentRefundRequest](docs/Model/GetPaymentRefundRequest.md)
440
+ - [GetPaymentRefundResponse](docs/Model/GetPaymentRefundResponse.md)
441
+ - [GetPaymentRequest](docs/Model/GetPaymentRequest.md)
442
+ - [GetPaymentResponse](docs/Model/GetPaymentResponse.md)
443
- [GetShiftRequest](docs/Model/GetShiftRequest.md)
444
- [GetShiftResponse](docs/Model/GetShiftResponse.md)
445
- [InventoryAdjustment](docs/Model/InventoryAdjustment.md)
467
- [ListEmployeesResponse](docs/Model/ListEmployeesResponse.md)
468
- [ListLocationsRequest](docs/Model/ListLocationsRequest.md)
469
- [ListLocationsResponse](docs/Model/ListLocationsResponse.md)
470
+ - [ListPaymentRefundsRequest](docs/Model/ListPaymentRefundsRequest.md)
471
+ - [ListPaymentRefundsResponse](docs/Model/ListPaymentRefundsResponse.md)
472
+ - [ListPaymentsRequest](docs/Model/ListPaymentsRequest.md)
473
+ - [ListPaymentsResponse](docs/Model/ListPaymentsResponse.md)
474
- [ListRefundsRequest](docs/Model/ListRefundsRequest.md)
475
- [ListRefundsResponse](docs/Model/ListRefundsResponse.md)
476
- [ListTransactionsRequest](docs/Model/ListTransactionsRequest.md)
484
- [MeasurementUnit](docs/Model/MeasurementUnit.md)
485
- [MeasurementUnitArea](docs/Model/MeasurementUnitArea.md)
486
- [MeasurementUnitCustom](docs/Model/MeasurementUnitCustom.md)
487
+ - [MeasurementUnitGeneric](docs/Model/MeasurementUnitGeneric.md)
488
- [MeasurementUnitLength](docs/Model/MeasurementUnitLength.md)
489
+ - [MeasurementUnitUnitType](docs/Model/MeasurementUnitUnitType.md)
490
- [MeasurementUnitVolume](docs/Model/MeasurementUnitVolume.md)
491
- [MeasurementUnitWeight](docs/Model/MeasurementUnitWeight.md)
492
- [ModelBreak](docs/Model/ModelBreak.md)
499
- [OrderFulfillmentPickupDetails](docs/Model/OrderFulfillmentPickupDetails.md)
500
- [OrderFulfillmentPickupDetailsScheduleType](docs/Model/OrderFulfillmentPickupDetailsScheduleType.md)
501
- [OrderFulfillmentRecipient](docs/Model/OrderFulfillmentRecipient.md)
502
+ - [OrderFulfillmentShipmentDetails](docs/Model/OrderFulfillmentShipmentDetails.md)
503
- [OrderFulfillmentState](docs/Model/OrderFulfillmentState.md)
504
- [OrderFulfillmentType](docs/Model/OrderFulfillmentType.md)
505
- [OrderLineItem](docs/Model/OrderLineItem.md)
506
+ - [OrderLineItemAppliedDiscount](docs/Model/OrderLineItemAppliedDiscount.md)
507
+ - [OrderLineItemAppliedTax](docs/Model/OrderLineItemAppliedTax.md)
508
- [OrderLineItemDiscount](docs/Model/OrderLineItemDiscount.md)
509
- [OrderLineItemDiscountScope](docs/Model/OrderLineItemDiscountScope.md)
510
- [OrderLineItemDiscountType](docs/Model/OrderLineItemDiscountType.md)
518
- [OrderReturnDiscount](docs/Model/OrderReturnDiscount.md)
519
- [OrderReturnLineItem](docs/Model/OrderReturnLineItem.md)
520
- [OrderReturnLineItemModifier](docs/Model/OrderReturnLineItemModifier.md)
521
+ - [OrderReturnServiceCharge](docs/Model/OrderReturnServiceCharge.md)
522
- [OrderReturnTax](docs/Model/OrderReturnTax.md)
523
- [OrderRoundingAdjustment](docs/Model/OrderRoundingAdjustment.md)
524
+ - [OrderServiceCharge](docs/Model/OrderServiceCharge.md)
525
+ - [OrderServiceChargeCalculationPhase](docs/Model/OrderServiceChargeCalculationPhase.md)
526
- [OrderSource](docs/Model/OrderSource.md)
527
- [OrderState](docs/Model/OrderState.md)
528
+ - [PayOrderRequest](docs/Model/PayOrderRequest.md)
529
+ - [PayOrderResponse](docs/Model/PayOrderResponse.md)
530
+ - [Payment](docs/Model/Payment.md)
531
+ - [PaymentRefund](docs/Model/PaymentRefund.md)
532
+ - [ProcessingFee](docs/Model/ProcessingFee.md)
533
- [Product](docs/Model/Product.md)
534
- [Refund](docs/Model/Refund.md)
535
+ - [RefundPaymentRequest](docs/Model/RefundPaymentRequest.md)
536
+ - [RefundPaymentResponse](docs/Model/RefundPaymentResponse.md)
537
- [RefundStatus](docs/Model/RefundStatus.md)
538
- [RegisterDomainRequest](docs/Model/RegisterDomainRequest.md)
539
- [RegisterDomainResponse](docs/Model/RegisterDomainResponse.md)
554
- [RetrieveInventoryCountResponse](docs/Model/RetrieveInventoryCountResponse.md)
555
- [RetrieveInventoryPhysicalCountRequest](docs/Model/RetrieveInventoryPhysicalCountRequest.md)
556
- [RetrieveInventoryPhysicalCountResponse](docs/Model/RetrieveInventoryPhysicalCountResponse.md)
557
+ - [RetrieveLocationRequest](docs/Model/RetrieveLocationRequest.md)
558
+ - [RetrieveLocationResponse](docs/Model/RetrieveLocationResponse.md)
559
- [RetrieveTransactionRequest](docs/Model/RetrieveTransactionRequest.md)
560
- [RetrieveTransactionResponse](docs/Model/RetrieveTransactionResponse.md)
561
- [RevokeTokenRequest](docs/Model/RevokeTokenRequest.md)
589
- [ShiftWorkdayMatcher](docs/Model/ShiftWorkdayMatcher.md)
590
- [SortOrder](docs/Model/SortOrder.md)
591
- [SourceApplication](docs/Model/SourceApplication.md)
592
+ - [StandardUnitDescription](docs/Model/StandardUnitDescription.md)
593
+ - [StandardUnitDescriptionGroup](docs/Model/StandardUnitDescriptionGroup.md)
594
- [TaxCalculationPhase](docs/Model/TaxCalculationPhase.md)
595
- [TaxInclusionType](docs/Model/TaxInclusionType.md)
596
- [Tender](docs/Model/Tender.md)
610
- [UpdateItemModifierListsResponse](docs/Model/UpdateItemModifierListsResponse.md)
611
- [UpdateItemTaxesRequest](docs/Model/UpdateItemTaxesRequest.md)
612
- [UpdateItemTaxesResponse](docs/Model/UpdateItemTaxesResponse.md)
613
+ - [UpdateOrderRequest](docs/Model/UpdateOrderRequest.md)
614
+ - [UpdateOrderResponse](docs/Model/UpdateOrderResponse.md)
615
- [UpdateShiftRequest](docs/Model/UpdateShiftRequest.md)
616
- [UpdateShiftResponse](docs/Model/UpdateShiftResponse.md)
617
- [UpdateWorkweekConfigRequest](docs/Model/UpdateWorkweekConfigRequest.md)
780
- [V1VariationPricingType](docs/Model/V1VariationPricingType.md)
781
- [VoidTransactionRequest](docs/Model/VoidTransactionRequest.md)
782
- [VoidTransactionResponse](docs/Model/VoidTransactionResponse.md)
783
+ - [WebhookEvents](docs/Model/WebhookEvents.md)
784
- [Weekday](docs/Model/Weekday.md)
785
- [WorkweekConfig](docs/Model/WorkweekConfig.md)
786
800
- **EMPLOYEES_WRITE**: __HTTP Method__: `POST`, `PUT`, `DELETE` Grants write access to employee profile information. For example, to create and modify employee profiles.
801
- **INVENTORY_READ**: __HTTP Method__: `GET` Grants read access to inventory information. For example, to call the RetrieveInventoryCount endpoint.
802
- **INVENTORY_WRITE**: __HTTP Method__: `POST`, `PUT`, `DELETE` Grants write access to inventory information. For example, to call the BatchChangeInventory endpoint.
803
+ - **ITEMS_READ**: __HTTP Method__: `GET` Grants read access to product catalog information. For example, to get an item or a list of items.
804
- **ITEMS_WRITE**: __HTTP Method__: `POST`, `PUT`, `DELETE` Grants write access to product catalog information. For example, to modify or add to a product catalog.
805
- **MERCHANT_PROFILE_READ**: __HTTP Method__: `GET` Grants read access to business and location information. For example, to obtain a location ID for subsequent activity.
806
- **ORDERS_READ**: __HTTP Method__: `GET` Grants read access to order information. For example, to call the BatchRetrieveOrders endpoint.
886
See the License for the specific language governing permissions and
887
limitations under the License.
888
```
889
+
890
+ [//]: # "Link anchor definitions"
891
+ [Square Logo]: https://docs.connect.squareup.com/images/github/github-square-logo.svg
vendor/square/connect/composer.json CHANGED
@@ -1,6 +1,6 @@
1
{
2
"name": "square/connect",
3
- "version": "2.20190508.0",
4
"description": "PHP client library for the Square Connect v2 API",
5
"keywords": [
6
"swagger",
1
{
2
"name": "square/connect",
3
+ "version": "2.20190814.2",
4
"description": "PHP client library for the Square Connect v2 API",
5
"keywords": [
6
"swagger",
vendor/square/connect/docs/Api/ApplePayApi.md CHANGED
@@ -12,7 +12,7 @@ Method | HTTP request | Description
12
13
RegisterDomain
14
15
- Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](/payments/sqpaymentform/overview) guide.
16
17
### Example
18
```php
@@ -22,11 +22,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
22
// Configure OAuth2 access token for authorization: oauth2
23
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
24
25
- $api_instance = new SquareConnect\Api\ApplePayApi();
26
$body = new \SquareConnect\Model\RegisterDomainRequest(); // \SquareConnect\Model\RegisterDomainRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
27
28
try {
29
- $result = $api_instance->registerDomain($body);
30
print_r($result);
31
} catch (Exception $e) {
32
echo 'Exception when calling ApplePayApi->registerDomain: ', $e->getMessage(), PHP_EOL;
12
13
RegisterDomain
14
15
+ Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](/payment-form/add-digital-wallets/apple-pay) guide.
16
17
### Example
18
```php
22
// Configure OAuth2 access token for authorization: oauth2
23
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
24
25
+ $apiInstance = new SquareConnect\Api\ApplePayApi();
26
$body = new \SquareConnect\Model\RegisterDomainRequest(); // \SquareConnect\Model\RegisterDomainRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
27
28
try {
29
+ $result = $apiInstance->registerDomain($body);
30
print_r($result);
31
} catch (Exception $e) {
32
echo 'Exception when calling ApplePayApi->registerDomain: ', $e->getMessage(), PHP_EOL;
vendor/square/connect/docs/Api/CatalogApi.md CHANGED
@@ -32,11 +32,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
32
// Configure OAuth2 access token for authorization: oauth2
33
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
34
35
- $api_instance = new SquareConnect\Api\CatalogApi();
36
$body = new \SquareConnect\Model\BatchDeleteCatalogObjectsRequest(); // \SquareConnect\Model\BatchDeleteCatalogObjectsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
37
38
try {
39
- $result = $api_instance->batchDeleteCatalogObjects($body);
40
print_r($result);
41
} catch (Exception $e) {
42
echo 'Exception when calling CatalogApi->batchDeleteCatalogObjects: ', $e->getMessage(), PHP_EOL;
@@ -80,11 +80,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
80
// Configure OAuth2 access token for authorization: oauth2
81
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
82
83
- $api_instance = new SquareConnect\Api\CatalogApi();
84
$body = new \SquareConnect\Model\BatchRetrieveCatalogObjectsRequest(); // \SquareConnect\Model\BatchRetrieveCatalogObjectsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
85
86
try {
87
- $result = $api_instance->batchRetrieveCatalogObjects($body);
88
print_r($result);
89
} catch (Exception $e) {
90
echo 'Exception when calling CatalogApi->batchRetrieveCatalogObjects: ', $e->getMessage(), PHP_EOL;
@@ -128,11 +128,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
128
// Configure OAuth2 access token for authorization: oauth2
129
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
130
131
- $api_instance = new SquareConnect\Api\CatalogApi();
132
$body = new \SquareConnect\Model\BatchUpsertCatalogObjectsRequest(); // \SquareConnect\Model\BatchUpsertCatalogObjectsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
133
134
try {
135
- $result = $api_instance->batchUpsertCatalogObjects($body);
136
print_r($result);
137
} catch (Exception $e) {
138
echo 'Exception when calling CatalogApi->batchUpsertCatalogObjects: ', $e->getMessage(), PHP_EOL;
@@ -176,10 +176,10 @@ require_once(__DIR__ . '/vendor/autoload.php');
176
// Configure OAuth2 access token for authorization: oauth2
177
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
178
179
- $api_instance = new SquareConnect\Api\CatalogApi();
180
181
try {
182
- $result = $api_instance->catalogInfo();
183
print_r($result);
184
} catch (Exception $e) {
185
echo 'Exception when calling CatalogApi->catalogInfo: ', $e->getMessage(), PHP_EOL;
@@ -220,11 +220,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
220
// Configure OAuth2 access token for authorization: oauth2
221
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
222
223
- $api_instance = new SquareConnect\Api\CatalogApi();
224
$object_id = "object_id_example"; // string | The ID of the [CatalogObject](#type-catalogobject) to be deleted. When an object is deleted, other objects in the graph that depend on that object will be deleted as well (for example, deleting a [CatalogItem](#type-catalogitem) will delete its [CatalogItemVariation](#type-catalogitemvariation)s).
225
226
try {
227
- $result = $api_instance->deleteCatalogObject($object_id);
228
print_r($result);
229
} catch (Exception $e) {
230
echo 'Exception when calling CatalogApi->deleteCatalogObject: ', $e->getMessage(), PHP_EOL;
@@ -258,7 +258,7 @@ Name | Type | Description | Notes
258
259
ListCatalog
260
261
- Returns a list of [CatalogObject](#type-catalogobject)s that includes all objects of a set of desired types (for example, all [CatalogItem](#type-catalogitem) and [CatalogTax](#type-catalogtax) objects) in the catalog. The types parameter is specified as a comma-separated list of valid [CatalogObject](#type-catalogobject) types: `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`.
262
263
### Example
264
```php
@@ -268,12 +268,12 @@ require_once(__DIR__ . '/vendor/autoload.php');
268
// Configure OAuth2 access token for authorization: oauth2
269
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
270
271
- $api_instance = new SquareConnect\Api\CatalogApi();
272
$cursor = "cursor_example"; // string | The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](/basics/api101/pagination) for more information.
273
$types = "types_example"; // string | An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`.
274
275
try {
276
- $result = $api_instance->listCatalog($cursor, $types);
277
print_r($result);
278
} catch (Exception $e) {
279
echo 'Exception when calling CatalogApi->listCatalog: ', $e->getMessage(), PHP_EOL;
@@ -318,12 +318,12 @@ require_once(__DIR__ . '/vendor/autoload.php');
318
// Configure OAuth2 access token for authorization: oauth2
319
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
320
321
- $api_instance = new SquareConnect\Api\CatalogApi();
322
$object_id = "object_id_example"; // string | The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved.
323
- $include_related_objects = true; // bool | If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false`
324
325
try {
326
- $result = $api_instance->retrieveCatalogObject($object_id, $include_related_objects);
327
print_r($result);
328
} catch (Exception $e) {
329
echo 'Exception when calling CatalogApi->retrieveCatalogObject: ', $e->getMessage(), PHP_EOL;
@@ -336,7 +336,7 @@ try {
336
Name | Type | Description | Notes
337
------------- | ------------- | ------------- | -------------
338
**object_id** | **string**| The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. |
339
- **include_related_objects** | **bool**| If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` | [optional]
340
341
### Return type
342
@@ -368,11 +368,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
368
// Configure OAuth2 access token for authorization: oauth2
369
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
370
371
- $api_instance = new SquareConnect\Api\CatalogApi();
372
$body = new \SquareConnect\Model\SearchCatalogObjectsRequest(); // \SquareConnect\Model\SearchCatalogObjectsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
373
374
try {
375
- $result = $api_instance->searchCatalogObjects($body);
376
print_r($result);
377
} catch (Exception $e) {
378
echo 'Exception when calling CatalogApi->searchCatalogObjects: ', $e->getMessage(), PHP_EOL;
@@ -416,11 +416,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
416
// Configure OAuth2 access token for authorization: oauth2
417
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
418
419
- $api_instance = new SquareConnect\Api\CatalogApi();
420
$body = new \SquareConnect\Model\UpdateItemModifierListsRequest(); // \SquareConnect\Model\UpdateItemModifierListsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
421
422
try {
423
- $result = $api_instance->updateItemModifierLists($body);
424
print_r($result);
425
} catch (Exception $e) {
426
echo 'Exception when calling CatalogApi->updateItemModifierLists: ', $e->getMessage(), PHP_EOL;
@@ -464,11 +464,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
464
// Configure OAuth2 access token for authorization: oauth2
465
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
466
467
- $api_instance = new SquareConnect\Api\CatalogApi();
468
$body = new \SquareConnect\Model\UpdateItemTaxesRequest(); // \SquareConnect\Model\UpdateItemTaxesRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
469
470
try {
471
- $result = $api_instance->updateItemTaxes($body);
472
print_r($result);
473
} catch (Exception $e) {
474
echo 'Exception when calling CatalogApi->updateItemTaxes: ', $e->getMessage(), PHP_EOL;
@@ -512,11 +512,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
512
// Configure OAuth2 access token for authorization: oauth2
513
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
514
515
- $api_instance = new SquareConnect\Api\CatalogApi();
516
$body = new \SquareConnect\Model\UpsertCatalogObjectRequest(); // \SquareConnect\Model\UpsertCatalogObjectRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
517
518
try {
519
- $result = $api_instance->upsertCatalogObject($body);
520
print_r($result);
521
} catch (Exception $e) {
522
echo 'Exception when calling CatalogApi->upsertCatalogObject: ', $e->getMessage(), PHP_EOL;
32
// Configure OAuth2 access token for authorization: oauth2
33
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
34
35
+ $apiInstance = new SquareConnect\Api\CatalogApi();
36
$body = new \SquareConnect\Model\BatchDeleteCatalogObjectsRequest(); // \SquareConnect\Model\BatchDeleteCatalogObjectsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
37
38
try {
39
+ $result = $apiInstance->batchDeleteCatalogObjects($body);
40
print_r($result);
41
} catch (Exception $e) {
42
echo 'Exception when calling CatalogApi->batchDeleteCatalogObjects: ', $e->getMessage(), PHP_EOL;
80
// Configure OAuth2 access token for authorization: oauth2
81
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
82
83
+ $apiInstance = new SquareConnect\Api\CatalogApi();
84
$body = new \SquareConnect\Model\BatchRetrieveCatalogObjectsRequest(); // \SquareConnect\Model\BatchRetrieveCatalogObjectsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
85
86
try {
87
+ $result = $apiInstance->batchRetrieveCatalogObjects($body);
88
print_r($result);
89
} catch (Exception $e) {
90
echo 'Exception when calling CatalogApi->batchRetrieveCatalogObjects: ', $e->getMessage(), PHP_EOL;
128
// Configure OAuth2 access token for authorization: oauth2
129
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
130
131
+ $apiInstance = new SquareConnect\Api\CatalogApi();
132
$body = new \SquareConnect\Model\BatchUpsertCatalogObjectsRequest(); // \SquareConnect\Model\BatchUpsertCatalogObjectsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
133
134
try {
135
+ $result = $apiInstance->batchUpsertCatalogObjects($body);
136
print_r($result);
137
} catch (Exception $e) {
138
echo 'Exception when calling CatalogApi->batchUpsertCatalogObjects: ', $e->getMessage(), PHP_EOL;
176
// Configure OAuth2 access token for authorization: oauth2
177
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
178
179
+ $apiInstance = new SquareConnect\Api\CatalogApi();
180
181
try {
182
+ $result = $apiInstance->catalogInfo();
183
print_r($result);
184
} catch (Exception $e) {
185
echo 'Exception when calling CatalogApi->catalogInfo: ', $e->getMessage(), PHP_EOL;
220
// Configure OAuth2 access token for authorization: oauth2
221
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
222
223
+ $apiInstance = new SquareConnect\Api\CatalogApi();
224
$object_id = "object_id_example"; // string | The ID of the [CatalogObject](#type-catalogobject) to be deleted. When an object is deleted, other objects in the graph that depend on that object will be deleted as well (for example, deleting a [CatalogItem](#type-catalogitem) will delete its [CatalogItemVariation](#type-catalogitemvariation)s).
225
226
try {
227
+ $result = $apiInstance->deleteCatalogObject($object_id);
228
print_r($result);
229
} catch (Exception $e) {
230
echo 'Exception when calling CatalogApi->deleteCatalogObject: ', $e->getMessage(), PHP_EOL;
258
259
ListCatalog
260
261
+ Returns a list of [CatalogObject](#type-catalogobject)s that includes all objects of a set of desired types (for example, all [CatalogItem](#type-catalogitem) and [CatalogTax](#type-catalogtax) objects) in the catalog. The `types` parameter is specified as a comma-separated list of valid [CatalogObject](#type-catalogobject) types: `ITEM`, `ITEM_VARIATION`, `MODIFIER`, `MODIFIER_LIST`, `CATEGORY`, `DISCOUNT`, `TAX`. __Important:__ ListCatalog does not return deleted catalog items. To retrieve deleted catalog items, use SearchCatalogObjects and set `include_deleted_objects` to `true`.
262
263
### Example
264
```php
268
// Configure OAuth2 access token for authorization: oauth2
269
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
270
271
+ $apiInstance = new SquareConnect\Api\CatalogApi();
272
$cursor = "cursor_example"; // string | The pagination cursor returned in the previous response. Leave unset for an initial request. See [Pagination](/basics/api101/pagination) for more information.
273
$types = "types_example"; // string | An optional case-insensitive, comma-separated list of object types to retrieve, for example `ITEM,ITEM_VARIATION,CATEGORY,IMAGE`. The legal values are taken from the [CatalogObjectType](#type-catalogobjecttype) enumeration, namely `ITEM`, `ITEM_VARIATION`, `CATEGORY`, `DISCOUNT`, `TAX`, `MODIFIER`, `MODIFIER_LIST`, or `IMAGE`.
274
275
try {
276
+ $result = $apiInstance->listCatalog($cursor, $types);
277
print_r($result);
278
} catch (Exception $e) {
279
echo 'Exception when calling CatalogApi->listCatalog: ', $e->getMessage(), PHP_EOL;
318
// Configure OAuth2 access token for authorization: oauth2
319
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
320
321
+ $apiInstance = new SquareConnect\Api\CatalogApi();
322
$object_id = "object_id_example"; // string | The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved.
323
+ $include_related_objects = true; // bool | If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, [CatalogImage](#type-catalogimage)s and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false`
324
325
try {
326
+ $result = $apiInstance->retrieveCatalogObject($object_id, $include_related_objects);
327
print_r($result);
328
} catch (Exception $e) {
329
echo 'Exception when calling CatalogApi->retrieveCatalogObject: ', $e->getMessage(), PHP_EOL;
336
Name | Type | Description | Notes
337
------------- | ------------- | ------------- | -------------
338
**object_id** | **string**| The object ID of any type of [CatalogObject](#type-catalogobject)s to be retrieved. |
339
+ **include_related_objects** | **bool**| If `true`, the response will include additional objects that are related to the requested object, as follows: If the `object` field of the response contains a [CatalogItem](#type-catalogitem), its associated [CatalogCategory](#type-catalogcategory), [CatalogTax](#type-catalogtax)es, [CatalogImage](#type-catalogimage)s and [CatalogModifierList](#type-catalogmodifierlist)s will be returned in the `related_objects` field of the response. If the `object` field of the response contains a [CatalogItemVariation](#type-catalogitemvariation), its parent [CatalogItem](#type-catalogitem) will be returned in the `related_objects` field of the response. Default value: `false` | [optional]
340
341
### Return type
342
368
// Configure OAuth2 access token for authorization: oauth2
369
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
370
371
+ $apiInstance = new SquareConnect\Api\CatalogApi();
372
$body = new \SquareConnect\Model\SearchCatalogObjectsRequest(); // \SquareConnect\Model\SearchCatalogObjectsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
373
374
try {
375
+ $result = $apiInstance->searchCatalogObjects($body);
376
print_r($result);
377
} catch (Exception $e) {
378
echo 'Exception when calling CatalogApi->searchCatalogObjects: ', $e->getMessage(), PHP_EOL;
416
// Configure OAuth2 access token for authorization: oauth2
417
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
418
419
+ $apiInstance = new SquareConnect\Api\CatalogApi();
420
$body = new \SquareConnect\Model\UpdateItemModifierListsRequest(); // \SquareConnect\Model\UpdateItemModifierListsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
421
422
try {
423
+ $result = $apiInstance->updateItemModifierLists($body);
424
print_r($result);
425
} catch (Exception $e) {
426
echo 'Exception when calling CatalogApi->updateItemModifierLists: ', $e->getMessage(), PHP_EOL;
464
// Configure OAuth2 access token for authorization: oauth2
465
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
466
467
+ $apiInstance = new SquareConnect\Api\CatalogApi();
468
$body = new \SquareConnect\Model\UpdateItemTaxesRequest(); // \SquareConnect\Model\UpdateItemTaxesRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
469
470
try {
471
+ $result = $apiInstance->updateItemTaxes($body);
472
print_r($result);
473
} catch (Exception $e) {
474
echo 'Exception when calling CatalogApi->updateItemTaxes: ', $e->getMessage(), PHP_EOL;
512
// Configure OAuth2 access token for authorization: oauth2
513
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
514
515
+ $apiInstance = new SquareConnect\Api\CatalogApi();
516
$body = new \SquareConnect\Model\UpsertCatalogObjectRequest(); // \SquareConnect\Model\UpsertCatalogObjectRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
517
518
try {
519
+ $result = $apiInstance->upsertCatalogObject($body);
520
print_r($result);
521
} catch (Exception $e) {
522
echo 'Exception when calling CatalogApi->upsertCatalogObject: ', $e->getMessage(), PHP_EOL;
vendor/square/connect/docs/Api/CheckoutApi.md CHANGED
@@ -22,12 +22,12 @@ require_once(__DIR__ . '/vendor/autoload.php');
22
// Configure OAuth2 access token for authorization: oauth2
23
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
24
25
- $api_instance = new SquareConnect\Api\CheckoutApi();
26
$location_id = "location_id_example"; // string | The ID of the business location to associate the checkout with.
27
$body = new \SquareConnect\Model\CreateCheckoutRequest(); // \SquareConnect\Model\CreateCheckoutRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
28
29
try {
30
- $result = $api_instance->createCheckout($location_id, $body);
31
print_r($result);
32
} catch (Exception $e) {
33
echo 'Exception when calling CheckoutApi->createCheckout: ', $e->getMessage(), PHP_EOL;
22
// Configure OAuth2 access token for authorization: oauth2
23
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
24
25
+ $apiInstance = new SquareConnect\Api\CheckoutApi();
26
$location_id = "location_id_example"; // string | The ID of the business location to associate the checkout with.
27
$body = new \SquareConnect\Model\CreateCheckoutRequest(); // \SquareConnect\Model\CreateCheckoutRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
28
29
try {
30
+ $result = $apiInstance->createCheckout($location_id, $body);
31
print_r($result);
32
} catch (Exception $e) {
33
echo 'Exception when calling CheckoutApi->createCheckout: ', $e->getMessage(), PHP_EOL;
vendor/square/connect/docs/Api/CustomersApi.md CHANGED
@@ -29,11 +29,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
29
// Configure OAuth2 access token for authorization: oauth2
30
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
31
32
- $api_instance = new SquareConnect\Api\CustomersApi();
33
$body = new \SquareConnect\Model\CreateCustomerRequest(); // \SquareConnect\Model\CreateCustomerRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
34
35
try {
36
- $result = $api_instance->createCustomer($body);
37
print_r($result);
38
} catch (Exception $e) {
39
echo 'Exception when calling CustomersApi->createCustomer: ', $e->getMessage(), PHP_EOL;
@@ -77,12 +77,12 @@ require_once(__DIR__ . '/vendor/autoload.php');
77
// Configure OAuth2 access token for authorization: oauth2
78
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
79
80
- $api_instance = new SquareConnect\Api\CustomersApi();
81
- $customer_id = "customer_id_example"; // string | The ID of the customer to link the card on file to.
82
$body = new \SquareConnect\Model\CreateCustomerCardRequest(); // \SquareConnect\Model\CreateCustomerCardRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
83
84
try {
85
- $result = $api_instance->createCustomerCard($customer_id, $body);
86
print_r($result);
87
} catch (Exception $e) {
88
echo 'Exception when calling CustomersApi->createCustomerCard: ', $e->getMessage(), PHP_EOL;
@@ -94,7 +94,7 @@ try {
94
95
Name | Type | Description | Notes
96
------------- | ------------- | ------------- | -------------
97
- **customer_id** | **string**| The ID of the customer to link the card on file to. |
98
**body** | [**\SquareConnect\Model\CreateCustomerCardRequest**](../Model/CreateCustomerCardRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
99
100
### Return type
@@ -127,11 +127,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
127
// Configure OAuth2 access token for authorization: oauth2
128
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
129
130
- $api_instance = new SquareConnect\Api\CustomersApi();
131
$customer_id = "customer_id_example"; // string | The ID of the customer to delete.
132
133
try {
134
- $result = $api_instance->deleteCustomer($customer_id);
135
print_r($result);
136
} catch (Exception $e) {
137
echo 'Exception when calling CustomersApi->deleteCustomer: ', $e->getMessage(), PHP_EOL;
@@ -175,12 +175,12 @@ require_once(__DIR__ . '/vendor/autoload.php');
175
// Configure OAuth2 access token for authorization: oauth2
176
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
177
178
- $api_instance = new SquareConnect\Api\CustomersApi();
179
$customer_id = "customer_id_example"; // string | The ID of the customer that the card on file belongs to.
180
$card_id = "card_id_example"; // string | The ID of the card on file to delete.
181
182
try {
183
- $result = $api_instance->deleteCustomerCard($customer_id, $card_id);
184
print_r($result);
185
} catch (Exception $e) {
186
echo 'Exception when calling CustomersApi->deleteCustomerCard: ', $e->getMessage(), PHP_EOL;
@@ -225,13 +225,13 @@ require_once(__DIR__ . '/vendor/autoload.php');
225
// Configure OAuth2 access token for authorization: oauth2
226
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
227
228
- $api_instance = new SquareConnect\Api\CustomersApi();
229
$cursor = "cursor_example"; // string | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.
230
$sort_field = "sort_field_example"; // string | Indicates how Customers should be sorted. Default: `DEFAULT`.
231
$sort_order = "sort_order_example"; // string | Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`.
232
233
try {
234
- $result = $api_instance->listCustomers($cursor, $sort_field, $sort_order);
235
print_r($result);
236
} catch (Exception $e) {
237
echo 'Exception when calling CustomersApi->listCustomers: ', $e->getMessage(), PHP_EOL;
@@ -277,11 +277,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
277
// Configure OAuth2 access token for authorization: oauth2
278
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
279
280
- $api_instance = new SquareConnect\Api\CustomersApi();
281
$customer_id = "customer_id_example"; // string | The ID of the customer to retrieve.
282
283
try {
284
- $result = $api_instance->retrieveCustomer($customer_id);
285
print_r($result);
286
} catch (Exception $e) {
287
echo 'Exception when calling CustomersApi->retrieveCustomer: ', $e->getMessage(), PHP_EOL;
@@ -325,11 +325,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
325
// Configure OAuth2 access token for authorization: oauth2
326
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
327
328
- $api_instance = new SquareConnect\Api\CustomersApi();
329
$body = new \SquareConnect\Model\SearchCustomersRequest(); // \SquareConnect\Model\SearchCustomersRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
330
331
try {
332
- $result = $api_instance->searchCustomers($body);
333
print_r($result);
334
} catch (Exception $e) {
335
echo 'Exception when calling CustomersApi->searchCustomers: ', $e->getMessage(), PHP_EOL;
@@ -373,12 +373,12 @@ require_once(__DIR__ . '/vendor/autoload.php');
373
// Configure OAuth2 access token for authorization: oauth2
374
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
375
376
- $api_instance = new SquareConnect\Api\CustomersApi();
377
$customer_id = "customer_id_example"; // string | The ID of the customer to update.
378
$body = new \SquareConnect\Model\UpdateCustomerRequest(); // \SquareConnect\Model\UpdateCustomerRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
379
380
try {
381
- $result = $api_instance->updateCustomer($customer_id, $body);
382
print_r($result);
383
} catch (Exception $e) {
384
echo 'Exception when calling CustomersApi->updateCustomer: ', $e->getMessage(), PHP_EOL;
29
// Configure OAuth2 access token for authorization: oauth2
30
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
31
32
+ $apiInstance = new SquareConnect\Api\CustomersApi();
33
$body = new \SquareConnect\Model\CreateCustomerRequest(); // \SquareConnect\Model\CreateCustomerRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
34
35
try {
36
+ $result = $apiInstance->createCustomer($body);
37
print_r($result);
38
} catch (Exception $e) {
39
echo 'Exception when calling CustomersApi->createCustomer: ', $e->getMessage(), PHP_EOL;
77
// Configure OAuth2 access token for authorization: oauth2
78
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
79
80
+ $apiInstance = new SquareConnect\Api\CustomersApi();
81
+ $customer_id = "customer_id_example"; // string | The Square ID of the customer profile the card is linked to.
82
$body = new \SquareConnect\Model\CreateCustomerCardRequest(); // \SquareConnect\Model\CreateCustomerCardRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
83
84
try {
85
+ $result = $apiInstance->createCustomerCard($customer_id, $body);
86
print_r($result);
87
} catch (Exception $e) {
88
echo 'Exception when calling CustomersApi->createCustomerCard: ', $e->getMessage(), PHP_EOL;
94
95
Name | Type | Description | Notes
96
------------- | ------------- | ------------- | -------------
97
+ **customer_id** | **string**| The Square ID of the customer profile the card is linked to. |
98
**body** | [**\SquareConnect\Model\CreateCustomerCardRequest**](../Model/CreateCustomerCardRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |
99
100
### Return type
127
// Configure OAuth2 access token for authorization: oauth2
128
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
129
130
+ $apiInstance = new SquareConnect\Api\CustomersApi();
131
$customer_id = "customer_id_example"; // string | The ID of the customer to delete.
132
133
try {
134
+ $result = $apiInstance->deleteCustomer($customer_id);
135
print_r($result);
136
} catch (Exception $e) {
137
echo 'Exception when calling CustomersApi->deleteCustomer: ', $e->getMessage(), PHP_EOL;
175
// Configure OAuth2 access token for authorization: oauth2
176
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
177
178
+ $apiInstance = new SquareConnect\Api\CustomersApi();
179
$customer_id = "customer_id_example"; // string | The ID of the customer that the card on file belongs to.
180
$card_id = "card_id_example"; // string | The ID of the card on file to delete.
181
182
try {
183
+ $result = $apiInstance->deleteCustomerCard($customer_id, $card_id);
184
print_r($result);
185
} catch (Exception $e) {
186
echo 'Exception when calling CustomersApi->deleteCustomerCard: ', $e->getMessage(), PHP_EOL;
225
// Configure OAuth2 access token for authorization: oauth2
226
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
227
228
+ $apiInstance = new SquareConnect\Api\CustomersApi();
229
$cursor = "cursor_example"; // string | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.
230
$sort_field = "sort_field_example"; // string | Indicates how Customers should be sorted. Default: `DEFAULT`.
231
$sort_order = "sort_order_example"; // string | Indicates whether Customers should be sorted in ascending (`ASC`) or descending (`DESC`) order. Default: `ASC`.
232
233
try {
234
+ $result = $apiInstance->listCustomers($cursor, $sort_field, $sort_order);
235
print_r($result);
236
} catch (Exception $e) {
237
echo 'Exception when calling CustomersApi->listCustomers: ', $e->getMessage(), PHP_EOL;
277
// Configure OAuth2 access token for authorization: oauth2
278
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
279
280
+ $apiInstance = new SquareConnect\Api\CustomersApi();
281
$customer_id = "customer_id_example"; // string | The ID of the customer to retrieve.
282
283
try {
284
+ $result = $apiInstance->retrieveCustomer($customer_id);
285
print_r($result);
286
} catch (Exception $e) {
287
echo 'Exception when calling CustomersApi->retrieveCustomer: ', $e->getMessage(), PHP_EOL;
325
// Configure OAuth2 access token for authorization: oauth2
326
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
327
328
+ $apiInstance = new SquareConnect\Api\CustomersApi();
329
$body = new \SquareConnect\Model\SearchCustomersRequest(); // \SquareConnect\Model\SearchCustomersRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
330
331
try {
332
+ $result = $apiInstance->searchCustomers($body);
333
print_r($result);
334
} catch (Exception $e) {
335
echo 'Exception when calling CustomersApi->searchCustomers: ', $e->getMessage(), PHP_EOL;
373
// Configure OAuth2 access token for authorization: oauth2
374
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
375
376
+ $apiInstance = new SquareConnect\Api\CustomersApi();
377
$customer_id = "customer_id_example"; // string | The ID of the customer to update.
378
$body = new \SquareConnect\Model\UpdateCustomerRequest(); // \SquareConnect\Model\UpdateCustomerRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
379
380
try {
381
+ $result = $apiInstance->updateCustomer($customer_id, $body);
382
print_r($result);
383
} catch (Exception $e) {
384
echo 'Exception when calling CustomersApi->updateCustomer: ', $e->getMessage(), PHP_EOL;
vendor/square/connect/docs/Api/EmployeesApi.md CHANGED
@@ -23,14 +23,14 @@ require_once(__DIR__ . '/vendor/autoload.php');
23
// Configure OAuth2 access token for authorization: oauth2
24
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
25
26
- $api_instance = new SquareConnect\Api\EmployeesApi();
27
$location_id = "location_id_example"; // string | Filter employees returned to only those that are associated with the specified location.
28
$status = "status_example"; // string | Specifies the EmployeeStatus to filter the employee by.
29
$limit = 56; // int | The number of employees to be returned on each page.
30
$cursor = "cursor_example"; // string | The token required to retrieve the specified page of results.
31
32
try {
33
- $result = $api_instance->listEmployees($location_id, $status, $limit, $cursor);
34
print_r($result);
35
} catch (Exception $e) {
36
echo 'Exception when calling EmployeesApi->listEmployees: ', $e->getMessage(), PHP_EOL;
@@ -77,11 +77,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
77
// Configure OAuth2 access token for authorization: oauth2
78
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
79
80
- $api_instance = new SquareConnect\Api\EmployeesApi();
81
$id = "id_example"; // string | UUID for the employee that was requested.
82
83
try {
84
- $result = $api_instance->retrieveEmployee($id);
85
print_r($result);
86
} catch (Exception $e) {
87
echo 'Exception when calling EmployeesApi->retrieveEmployee: ', $e->getMessage(), PHP_EOL;
23
// Configure OAuth2 access token for authorization: oauth2
24
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
25
26
+ $apiInstance = new SquareConnect\Api\EmployeesApi();
27
$location_id = "location_id_example"; // string | Filter employees returned to only those that are associated with the specified location.
28
$status = "status_example"; // string | Specifies the EmployeeStatus to filter the employee by.
29
$limit = 56; // int | The number of employees to be returned on each page.
30
$cursor = "cursor_example"; // string | The token required to retrieve the specified page of results.
31
32
try {
33
+ $result = $apiInstance->listEmployees($location_id, $status, $limit, $cursor);
34
print_r($result);
35
} catch (Exception $e) {
36
echo 'Exception when calling EmployeesApi->listEmployees: ', $e->getMessage(), PHP_EOL;
77
// Configure OAuth2 access token for authorization: oauth2
78
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
79
80
+ $apiInstance = new SquareConnect\Api\EmployeesApi();
81
$id = "id_example"; // string | UUID for the employee that was requested.
82
83
try {
84
+ $result = $apiInstance->retrieveEmployee($id);
85
print_r($result);
86
} catch (Exception $e) {
87
echo 'Exception when calling EmployeesApi->retrieveEmployee: ', $e->getMessage(), PHP_EOL;
vendor/square/connect/docs/Api/InventoryApi.md CHANGED
@@ -28,11 +28,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
28
// Configure OAuth2 access token for authorization: oauth2
29
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
30
31
- $api_instance = new SquareConnect\Api\InventoryApi();
32
$body = new \SquareConnect\Model\BatchChangeInventoryRequest(); // \SquareConnect\Model\BatchChangeInventoryRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
33
34
try {
35
- $result = $api_instance->batchChangeInventory($body);
36
print_r($result);
37
} catch (Exception $e) {
38
echo 'Exception when calling InventoryApi->batchChangeInventory: ', $e->getMessage(), PHP_EOL;
@@ -76,11 +76,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
76
// Configure OAuth2 access token for authorization: oauth2
77
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
78
79
- $api_instance = new SquareConnect\Api\InventoryApi();
80
$body = new \SquareConnect\Model\BatchRetrieveInventoryChangesRequest(); // \SquareConnect\Model\BatchRetrieveInventoryChangesRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
81
82
try {
83
- $result = $api_instance->batchRetrieveInventoryChanges($body);
84
print_r($result);
85
} catch (Exception $e) {
86
echo 'Exception when calling InventoryApi->batchRetrieveInventoryChanges: ', $e->getMessage(), PHP_EOL;
@@ -124,11 +124,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
124
// Configure OAuth2 access token for authorization: oauth2
125
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
126
127
- $api_instance = new SquareConnect\Api\InventoryApi();
128
$body = new \SquareConnect\Model\BatchRetrieveInventoryCountsRequest(); // \SquareConnect\Model\BatchRetrieveInventoryCountsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
129
130
try {
131
- $result = $api_instance->batchRetrieveInventoryCounts($body);
132
print_r($result);
133
} catch (Exception $e) {
134
echo 'Exception when calling InventoryApi->batchRetrieveInventoryCounts: ', $e->getMessage(), PHP_EOL;
@@ -172,11 +172,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
172
// Configure OAuth2 access token for authorization: oauth2
173
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
174
175
- $api_instance = new SquareConnect\Api\InventoryApi();
176
$adjustment_id = "adjustment_id_example"; // string | ID of the [InventoryAdjustment](#type-inventoryadjustment) to retrieve.
177
178
try {
179
- $result = $api_instance->retrieveInventoryAdjustment($adjustment_id);
180
print_r($result);
181
} catch (Exception $e) {
182
echo 'Exception when calling InventoryApi->retrieveInventoryAdjustment: ', $e->getMessage(), PHP_EOL;
@@ -220,13 +220,13 @@ require_once(__DIR__ . '/vendor/autoload.php');
220
// Configure OAuth2 access token for authorization: oauth2
221
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
222
223
- $api_instance = new SquareConnect\Api\InventoryApi();
224
$catalog_object_id = "catalog_object_id_example"; // string | ID of the [CatalogObject](#type-catalogobject) to retrieve.
225
$location_ids = "location_ids_example"; // string | The [Location](#type-location) IDs to look up as a comma-separated list. An empty list queries all locations.
226
$cursor = "cursor_example"; // string | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See [Pagination](/basics/api101/pagination) for more information.
227
228
try {
229
- $result = $api_instance->retrieveInventoryChanges($catalog_object_id, $location_ids, $cursor);
230
print_r($result);
231
} catch (Exception $e) {
232
echo 'Exception when calling InventoryApi->retrieveInventoryChanges: ', $e->getMessage(), PHP_EOL;
@@ -272,13 +272,13 @@ require_once(__DIR__ . '/vendor/autoload.php');
272
// Configure OAuth2 access token for authorization: oauth2
273
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
274
275
- $api_instance = new SquareConnect\Api\InventoryApi();
276
$catalog_object_id = "catalog_object_id_example"; // string | ID of the [CatalogObject](#type-catalogobject) to retrieve.
277
$location_ids = "location_ids_example"; // string | The [Location](#type-location) IDs to look up as a comma-separated list. An empty list queries all locations.
278
$cursor = "cursor_example"; // string | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See [Pagination](/basics/api101/pagination) for more information.
279
280
try {
281
- $result = $api_instance->retrieveInventoryCount($catalog_object_id, $location_ids, $cursor);
282
print_r($result);
283
} catch (Exception $e) {
284
echo 'Exception when calling InventoryApi->retrieveInventoryCount: ', $e->getMessage(), PHP_EOL;
@@ -324,11 +324,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
324
// Configure OAuth2 access token for authorization: oauth2
325
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
326
327
- $api_instance = new SquareConnect\Api\InventoryApi();
328
$physical_count_id = "physical_count_id_example"; // string | ID of the [InventoryPhysicalCount](#type-inventoryphysicalcount) to retrieve.
329
330
try {
331
- $result = $api_instance->retrieveInventoryPhysicalCount($physical_count_id);
332
print_r($result);
333
} catch (Exception $e) {
334
echo 'Exception when calling InventoryApi->retrieveInventoryPhysicalCount: ', $e->getMessage(), PHP_EOL;
28
// Configure OAuth2 access token for authorization: oauth2
29
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
30
31
+ $apiInstance = new SquareConnect\Api\InventoryApi();
32
$body = new \SquareConnect\Model\BatchChangeInventoryRequest(); // \SquareConnect\Model\BatchChangeInventoryRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
33
34
try {
35
+ $result = $apiInstance->batchChangeInventory($body);
36
print_r($result);
37
} catch (Exception $e) {
38
echo 'Exception when calling InventoryApi->batchChangeInventory: ', $e->getMessage(), PHP_EOL;
76
// Configure OAuth2 access token for authorization: oauth2
77
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
78
79
+ $apiInstance = new SquareConnect\Api\InventoryApi();
80
$body = new \SquareConnect\Model\BatchRetrieveInventoryChangesRequest(); // \SquareConnect\Model\BatchRetrieveInventoryChangesRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
81
82
try {
83
+ $result = $apiInstance->batchRetrieveInventoryChanges($body);
84
print_r($result);
85
} catch (Exception $e) {
86
echo 'Exception when calling InventoryApi->batchRetrieveInventoryChanges: ', $e->getMessage(), PHP_EOL;
124
// Configure OAuth2 access token for authorization: oauth2
125
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
126
127
+ $apiInstance = new SquareConnect\Api\InventoryApi();
128
$body = new \SquareConnect\Model\BatchRetrieveInventoryCountsRequest(); // \SquareConnect\Model\BatchRetrieveInventoryCountsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
129
130
try {
131
+ $result = $apiInstance->batchRetrieveInventoryCounts($body);
132
print_r($result);
133
} catch (Exception $e) {
134
echo 'Exception when calling InventoryApi->batchRetrieveInventoryCounts: ', $e->getMessage(), PHP_EOL;
172
// Configure OAuth2 access token for authorization: oauth2
173
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
174
175
+ $apiInstance = new SquareConnect\Api\InventoryApi();
176
$adjustment_id = "adjustment_id_example"; // string | ID of the [InventoryAdjustment](#type-inventoryadjustment) to retrieve.
177
178
try {
179
+ $result = $apiInstance->retrieveInventoryAdjustment($adjustment_id);
180
print_r($result);
181
} catch (Exception $e) {
182
echo 'Exception when calling InventoryApi->retrieveInventoryAdjustment: ', $e->getMessage(), PHP_EOL;
220
// Configure OAuth2 access token for authorization: oauth2
221
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
222
223
+ $apiInstance = new SquareConnect\Api\InventoryApi();
224
$catalog_object_id = "catalog_object_id_example"; // string | ID of the [CatalogObject](#type-catalogobject) to retrieve.
225
$location_ids = "location_ids_example"; // string | The [Location](#type-location) IDs to look up as a comma-separated list. An empty list queries all locations.
226
$cursor = "cursor_example"; // string | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See [Pagination](/basics/api101/pagination) for more information.
227
228
try {
229
+ $result = $apiInstance->retrieveInventoryChanges($catalog_object_id, $location_ids, $cursor);
230
print_r($result);
231
} catch (Exception $e) {
232
echo 'Exception when calling InventoryApi->retrieveInventoryChanges: ', $e->getMessage(), PHP_EOL;
272
// Configure OAuth2 access token for authorization: oauth2
273
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
274
275
+ $apiInstance = new SquareConnect\Api\InventoryApi();
276
$catalog_object_id = "catalog_object_id_example"; // string | ID of the [CatalogObject](#type-catalogobject) to retrieve.
277
$location_ids = "location_ids_example"; // string | The [Location](#type-location) IDs to look up as a comma-separated list. An empty list queries all locations.
278
$cursor = "cursor_example"; // string | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. See [Pagination](/basics/api101/pagination) for more information.
279
280
try {
281
+ $result = $apiInstance->retrieveInventoryCount($catalog_object_id, $location_ids, $cursor);
282
print_r($result);
283
} catch (Exception $e) {
284
echo 'Exception when calling InventoryApi->retrieveInventoryCount: ', $e->getMessage(), PHP_EOL;
324
// Configure OAuth2 access token for authorization: oauth2
325
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
326
327
+ $apiInstance = new SquareConnect\Api\InventoryApi();
328
$physical_count_id = "physical_count_id_example"; // string | ID of the [InventoryPhysicalCount](#type-inventoryphysicalcount) to retrieve.
329
330
try {
331
+ $result = $apiInstance->retrieveInventoryPhysicalCount($physical_count_id);
332
print_r($result);
333
} catch (Exception $e) {
334
echo 'Exception when calling InventoryApi->retrieveInventoryPhysicalCount: ', $e->getMessage(), PHP_EOL;
vendor/square/connect/docs/Api/LaborApi.md CHANGED
@@ -35,11 +35,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
35
// Configure OAuth2 access token for authorization: oauth2
36
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
37
38
- $api_instance = new SquareConnect\Api\LaborApi();
39
$body = new \SquareConnect\Model\CreateBreakTypeRequest(); // \SquareConnect\Model\CreateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
40
41
try {
42
- $result = $api_instance->createBreakType($body);
43
print_r($result);
44
} catch (Exception $e) {
45
echo 'Exception when calling LaborApi->createBreakType: ', $e->getMessage(), PHP_EOL;
@@ -83,11 +83,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
83
// Configure OAuth2 access token for authorization: oauth2
84
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
85
86
- $api_instance = new SquareConnect\Api\LaborApi();
87
$body = new \SquareConnect\Model\CreateShiftRequest(); // \SquareConnect\Model\CreateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
88
89
try {
90
- $result = $api_instance->createShift($body);
91
print_r($result);
92
} catch (Exception $e) {
93
echo 'Exception when calling LaborApi->createShift: ', $e->getMessage(), PHP_EOL;
@@ -131,11 +131,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
131
// Configure OAuth2 access token for authorization: oauth2
132
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
133
134
- $api_instance = new SquareConnect\Api\LaborApi();
135
$id = "id_example"; // string | UUID for the `BreakType` being deleted.
136
137
try {
138
- $result = $api_instance->deleteBreakType($id);
139
print_r($result);
140
} catch (Exception $e) {
141
echo 'Exception when calling LaborApi->deleteBreakType: ', $e->getMessage(), PHP_EOL;
@@ -179,11 +179,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
179
// Configure OAuth2 access token for authorization: oauth2
180
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
181
182
- $api_instance = new SquareConnect\Api\LaborApi();
183
$id = "id_example"; // string | UUID for the `Shift` being deleted.
184
185
try {
186
- $result = $api_instance->deleteShift($id);
187
print_r($result);
188
} catch (Exception $e) {
189
echo 'Exception when calling LaborApi->deleteShift: ', $e->getMessage(), PHP_EOL;
@@ -227,11 +227,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
227
// Configure OAuth2 access token for authorization: oauth2
228
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
229
230
- $api_instance = new SquareConnect\Api\LaborApi();
231
$id = "id_example"; // string | UUID for the `BreakType` being retrieved.
232
233
try {
234
- $result = $api_instance->getBreakType($id);
235
print_r($result);
236
} catch (Exception $e) {
237
echo 'Exception when calling LaborApi->getBreakType: ', $e->getMessage(), PHP_EOL;
@@ -275,11 +275,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
275
// Configure OAuth2 access token for authorization: oauth2
276
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
277
278
- $api_instance = new SquareConnect\Api\LaborApi();
279
$id = "id_example"; // string | UUID for the `EmployeeWage` being retrieved.
280
281
try {
282
- $result = $api_instance->getEmployeeWage($id);
283
print_r($result);
284
} catch (Exception $e) {
285
echo 'Exception when calling LaborApi->getEmployeeWage: ', $e->getMessage(), PHP_EOL;
@@ -323,11 +323,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
323
// Configure OAuth2 access token for authorization: oauth2
324
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
325
326
- $api_instance = new SquareConnect\Api\LaborApi();
327
$id = "id_example"; // string | UUID for the `Shift` being retrieved.
328
329
try {
330
- $result = $api_instance->getShift($id);
331
print_r($result);
332
} catch (Exception $e) {
333
echo 'Exception when calling LaborApi->getShift: ', $e->getMessage(), PHP_EOL;
@@ -371,13 +371,13 @@ require_once(__DIR__ . '/vendor/autoload.php');
371
// Configure OAuth2 access token for authorization: oauth2
372
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
373
374
- $api_instance = new SquareConnect\Api\LaborApi();
375
$location_id = "location_id_example"; // string | Filter Break Types returned to only those that are associated with the specified location.
376
$limit = 56; // int | Maximum number of Break Types to return per page. Can range between 1 and 200. The default is the maximum at 200.
377
$cursor = "cursor_example"; // string | Pointer to the next page of Break Type results to fetch.
378
379
try {
380
- $result = $api_instance->listBreakTypes($location_id, $limit, $cursor);
381
print_r($result);
382
} catch (Exception $e) {
383
echo 'Exception when calling LaborApi->listBreakTypes: ', $e->getMessage(), PHP_EOL;
@@ -423,13 +423,13 @@ require_once(__DIR__ . '/vendor/autoload.php');
423
// Configure OAuth2 access token for authorization: oauth2
424
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
425
426
- $api_instance = new SquareConnect\Api\LaborApi();
427
$employee_id = "employee_id_example"; // string | Filter wages returned to only those that are associated with the specified employee.
428
$limit = 56; // int | Maximum number of Employee Wages to return per page. Can range between 1 and 200. The default is the maximum at 200.
429
$cursor = "cursor_example"; // string | Pointer to the next page of Employee Wage results to fetch.
430
431
try {
432
- $result = $api_instance->listEmployeeWages($employee_id, $limit, $cursor);
433
print_r($result);
434
} catch (Exception $e) {
435
echo 'Exception when calling LaborApi->listEmployeeWages: ', $e->getMessage(), PHP_EOL;
@@ -475,12 +475,12 @@ require_once(__DIR__ . '/vendor/autoload.php');
475
// Configure OAuth2 access token for authorization: oauth2
476
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
477
478
- $api_instance = new SquareConnect\Api\LaborApi();
479
$limit = 56; // int | Maximum number of Workweek Configs to return per page.
480
$cursor = "cursor_example"; // string | Pointer to the next page of Workweek Config results to fetch.
481
482
try {
483
- $result = $api_instance->listWorkweekConfigs($limit, $cursor);
484
print_r($result);
485
} catch (Exception $e) {
486
echo 'Exception when calling LaborApi->listWorkweekConfigs: ', $e->getMessage(), PHP_EOL;
@@ -525,11 +525,11 @@ require_once(__DIR__ . '/vendor/autoload.php');
525
// Configure OAuth2 access token for authorization: oauth2
526
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
527
528
- $api_instance = new SquareConnect\Api\LaborApi();
529
$body = new \SquareConnect\Model\SearchShiftsRequest(); // \SquareConnect\Model\SearchShiftsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
530
531
try {
532
- $result = $api_instance->searchShifts($body);
533
print_r($result);
534
} catch (Exception $e) {
535
echo 'Exception when calling LaborApi->searchShifts: ', $e->getMessage(), PHP_EOL;
@@ -573,12 +573,12 @@ require_once(__DIR__ . '/vendor/autoload.php');
573
// Configure OAuth2 access token for authorization: oauth2
574
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
575
576
- $api_instance = new SquareConnect\Api\LaborApi();
577
$id = "id_example"; // string | UUID for the `BreakType` being updated.
578
$body = new \SquareConnect\Model\UpdateBreakTypeRequest(); // \SquareConnect\Model\UpdateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
579
580
try {
581
- $result = $api_instance->updateBreakType($id, $body);
582
print_r($result);
583
} catch (Exception $e) {
584
echo 'Exception when calling LaborApi->updateBreakType: ', $e->getMessage(), PHP_EOL;
@@ -623,12 +623,12 @@ require_once(__DIR__ . '/vendor/autoload.php');
623
// Configure OAuth2 access token for authorization: oauth2
624
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
625
626
- $api_instance = new SquareConnect\Api\LaborApi();
627
$id = "id_example"; // string | ID of the object being updated.
628
$body = new \SquareConnect\Model\UpdateShiftRequest(); // \SquareConnect\Model\UpdateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
629
630
try {
631
- $result = $api_instance->updateShift($id, $body);
632
print_r($result);
633
} catch (Exception $e) {
634
echo 'Exception when calling LaborApi->updateShift: ', $e->getMessage(), PHP_EOL;
@@ -673,12 +673,12 @@ require_once(__DIR__ . '/vendor/autoload.php');
673
// Configure OAuth2 access token for authorization: oauth2
674
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
675
676
- $api_instance = new SquareConnect\Api\LaborApi();
677
$id = "id_example"; // string | UUID for the `WorkweekConfig` object being updated.
678
$body = new \SquareConnect\Model\UpdateWorkweekConfigRequest(); // \SquareConnect\Model\UpdateWorkweekConfigRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
679
680
try {
681
- $result = $api_instance->updateWorkweekConfig($id, $body);
682
print_r($result);
683
} catch (Exception $e) {
684
echo 'Exception when calling LaborApi->updateWorkweekConfig: ', $e->getMessage(), PHP_EOL;
35
// Configure OAuth2 access token for authorization: oauth2
36
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
37
38
+ $apiInstance = new SquareConnect\Api\LaborApi();
39
$body = new \SquareConnect\Model\CreateBreakTypeRequest(); // \SquareConnect\Model\CreateBreakTypeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
40
41
try {
42
+ $result = $apiInstance->createBreakType($body);
43
print_r($result);
44
} catch (Exception $e) {
45
echo 'Exception when calling LaborApi->createBreakType: ', $e->getMessage(), PHP_EOL;
83
// Configure OAuth2 access token for authorization: oauth2
84
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
85
86
+ $apiInstance = new SquareConnect\Api\LaborApi();
87
$body = new \SquareConnect\Model\CreateShiftRequest(); // \SquareConnect\Model\CreateShiftRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
88
89
try {
90
+ $result = $apiInstance->createShift($body);
91
print_r($result);
92
} catch (Exception $e) {
93
echo 'Exception when calling LaborApi->createShift: ', $e->getMessage(), PHP_EOL;
131
// Configure OAuth2 access token for authorization: oauth2
132
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
133
134
+ $apiInstance = new SquareConnect\Api\LaborApi();
135
$id = "id_example"; // string | UUID for the `BreakType` being deleted.
136
137
try {
138
+ $result = $apiInstance->deleteBreakType($id);
139
print_r($result);
140
} catch (Exception $e) {
141
echo 'Exception when calling LaborApi->deleteBreakType: ', $e->getMessage(), PHP_EOL;
179
// Configure OAuth2 access token for authorization: oauth2
180
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
181
182
+ $apiInstance = new SquareConnect\Api\LaborApi();
183
$id = "id_example"; // string | UUID for the `Shift` being deleted.
184
185
try {
186
+ $result = $apiInstance->deleteShift($id);
187
print_r($result);
188
} catch (Exception $e) {
189
echo 'Exception when calling LaborApi->deleteShift: ', $e->getMessage(), PHP_EOL;
227
// Configure OAuth2 access token for authorization: oauth2
228
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
229
230
+ $apiInstance = new SquareConnect\Api\LaborApi();
231
$id = "id_example"; // string | UUID for the `BreakType` being retrieved.
232
233
try {
234
+ $result = $apiInstance->getBreakType($id);
235
print_r($result);
236
} catch (Exception $e) {
237
echo 'Exception when calling LaborApi->getBreakType: ', $e->getMessage(), PHP_EOL;
275
// Configure OAuth2 access token for authorization: oauth2
276
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
277
278
+ $apiInstance = new SquareConnect\Api\LaborApi();
279
$id = "id_example"; // string | UUID for the `EmployeeWage` being retrieved.
280
281
try {
282
+ $result = $apiInstance->getEmployeeWage($id);
283
print_r($result);
284