<?php
 declare(strict_types=1); namespace Shopify\Rest\Admin2023_10; use Shopify\Auth\Session; use Shopify\Rest\Base; class Refund extends Base { public static string $API_VERSION = "2023-10"; protected static array $HAS_ONE = []; protected static array $HAS_MANY = [ "transactions" => Transaction::class ]; protected static array $PATHS = [ ["http_method" => "get", "operation" => "get", "ids" => ["order_id"], "path" => "orders/<order_id>/refunds.json"], ["http_method" => "get", "operation" => "get", "ids" => ["order_id", "id"], "path" => "orders/<order_id>/refunds/<id>.json"], ["http_method" => "post", "operation" => "calculate", "ids" => ["order_id"], "path" => "orders/<order_id>/refunds/calculate.json"], ["http_method" => "post", "operation" => "post", "ids" => ["order_id"], "path" => "orders/<order_id>/refunds.json"] ]; public static function find( Session $session, $id, array $urlIds = [], array $params = [] ): ?Refund { $result = parent::baseFind( $session, array_merge(["id" => $id], $urlIds), $params, ); return !empty($result) ? $result[0] : null; } public static function all( Session $session, array $urlIds = [], array $params = [] ): array { return parent::baseFind( $session, $urlIds, $params, ); } public function calculate( array $params = [], $body = [] ): ?array { $response = parent::request( "post", "calculate", $this->session, ["order_id" => $this->order_id], $params, $body, $this, ); return $response->getDecodedBody(); } } 