1010use Piggy \Api \Models \Shops \Shop ;
1111use Piggy \Api \StaticMappers \Orders \OrderMapper ;
1212use Piggy \Api \StaticMappers \Orders \OrdersMapper ;
13+ use stdClass ;
1314
1415class Order
1516{
@@ -73,6 +74,11 @@ class Order
7374 */
7475 protected $ paidAt ;
7576
77+ /**
78+ * @var string|null
79+ */
80+ protected $ completedAt ;
81+
7682 /**
7783 * @var string
7884 */
@@ -131,6 +137,7 @@ public function __construct(
131137 int $ totalDiscountAmount ,
132138 int $ totalOrderAmount ,
133139 ?string $ paidAt ,
140+ ?string $ completedAt ,
134141 string $ createdAt ,
135142 string $ updatedAt ,
136143 ?Contact $ contact ,
@@ -151,6 +158,7 @@ public function __construct(
151158 $ this ->totalDiscountAmount = $ totalDiscountAmount ;
152159 $ this ->totalOrderAmount = $ totalOrderAmount ;
153160 $ this ->paidAt = $ paidAt ;
161+ $ this ->completedAt = $ completedAt ;
154162 $ this ->createdAt = $ createdAt ;
155163 $ this ->updatedAt = $ updatedAt ;
156164 $ this ->contact = $ contact ;
@@ -220,6 +228,11 @@ public function getPaidAt(): ?string
220228 return $ this ->paidAt ;
221229 }
222230
231+ public function getCompletedAt (): ?string
232+ {
233+ return $ this ->completedAt ;
234+ }
235+
223236 public function getCreatedAt (): string
224237 {
225238 return $ this ->createdAt ;
@@ -259,7 +272,7 @@ public function getAppliedDiscounts(): array
259272 /**
260273 * @return Charge[]
261274 */
262- public function charges (): array
275+ public function getCharges (): array
263276 {
264277 return $ this ->charges ;
265278 }
@@ -325,11 +338,11 @@ public static function create(array $body): Order
325338 * @param string $uuid
326339 * @param array<string, mixed> $body
327340 *
328- * @return array<string, mixed>
341+ * @return stdClass
329342 *
330343 * @throws GuzzleException|MaintenanceModeException|PiggyRequestException
331344 */
332- public static function process (string $ uuid , array $ body ): array
345+ public static function process (string $ uuid , array $ body = [] ): stdClass
333346 {
334347 $ response = ApiClient::post (self ::resourceUri."$ uuid/process " , $ body );
335348
@@ -356,11 +369,11 @@ public static function createAndProcess(array $body): array
356369 /**
357370 * @param array<string, mixed> $body
358371 *
359- * @return array<string, mixed>
372+ * @return stdClass
360373 *
361374 * @throws GuzzleException|MaintenanceModeException|PiggyRequestException
362375 */
363- public static function calculate (array $ body ): array
376+ public static function calculate (array $ body ): stdClass
364377 {
365378 $ response = ApiClient::post (self ::resourceUri."/calculate " , $ body );
366379
0 commit comments