| @@ 20-42 (lines=23) @@ | ||
| 17 | * @method Payment mapResponse(ApiResponseInterface $response) |
|
| 18 | * @method Payment mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null) |
|
| 19 | */ |
|
| 20 | class PaymentByIdGetRequest extends AbstractByIdGetRequest |
|
| 21 | { |
|
| 22 | protected $resultClass = Payment::class; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @param string $id |
|
| 26 | * @param Context $context |
|
| 27 | */ |
|
| 28 | public function __construct($id, Context $context = null) |
|
| 29 | { |
|
| 30 | parent::__construct(PaymentsEndpoint::endpoint(), $id, $context); |
|
| 31 | } |
|
| 32 | ||
| 33 | /** |
|
| 34 | * @param string $id |
|
| 35 | * @param Context $context |
|
| 36 | * @return static |
|
| 37 | */ |
|
| 38 | public static function ofId($id, Context $context = null) |
|
| 39 | { |
|
| 40 | return new static($id, $context); |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||
| @@ 21-43 (lines=23) @@ | ||
| 18 | * @method Payment mapResponse(ApiResponseInterface $response) |
|
| 19 | * @method Payment mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null) |
|
| 20 | */ |
|
| 21 | class PaymentCreateRequest extends AbstractCreateRequest |
|
| 22 | { |
|
| 23 | protected $resultClass = Payment::class; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @param PaymentDraft $payment |
|
| 27 | * @param Context $context |
|
| 28 | */ |
|
| 29 | public function __construct(PaymentDraft $payment, Context $context = null) |
|
| 30 | { |
|
| 31 | parent::__construct(PaymentsEndpoint::endpoint(), $payment, $context); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @param PaymentDraft $payment |
|
| 36 | * @param Context $context |
|
| 37 | * @return static |
|
| 38 | */ |
|
| 39 | public static function ofDraft(PaymentDraft $payment, Context $context = null) |
|
| 40 | { |
|
| 41 | return new static($payment, $context); |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||
| @@ 20-44 (lines=25) @@ | ||
| 17 | * @method Payment mapResponse(ApiResponseInterface $response) |
|
| 18 | * @method Payment mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null) |
|
| 19 | */ |
|
| 20 | class PaymentDeleteRequest extends AbstractDeleteRequest |
|
| 21 | { |
|
| 22 | protected $resultClass = Payment::class; |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @param string $id |
|
| 26 | * @param int $version |
|
| 27 | * @param Context $context |
|
| 28 | */ |
|
| 29 | public function __construct($id, $version, Context $context = null) |
|
| 30 | { |
|
| 31 | parent::__construct(PaymentsEndpoint::endpoint(), $id, $version, $context); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @param string $id |
|
| 36 | * @param int $version |
|
| 37 | * @param Context $context |
|
| 38 | * @return static |
|
| 39 | */ |
|
| 40 | public static function ofIdAndVersion($id, $version, Context $context = null) |
|
| 41 | { |
|
| 42 | return new static($id, $version, $context); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| @@ 21-43 (lines=23) @@ | ||
| 18 | * @method Payment mapResponse(ApiResponseInterface $response) |
|
| 19 | * @method Payment mapFromResponse(ApiResponseInterface $response, MapperInterface $mapper = null) |
|
| 20 | */ |
|
| 21 | class PaymentByKeyGetRequest extends AbstractByKeyGetRequest |
|
| 22 | { |
|
| 23 | protected $resultClass = Payment::class; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @param string $key |
|
| 27 | * @param Context $context |
|
| 28 | */ |
|
| 29 | public function __construct($key, Context $context = null) |
|
| 30 | { |
|
| 31 | parent::__construct(PaymentsEndpoint::endpoint(), $key, $context); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * @param string $key |
|
| 36 | * @param Context $context |
|
| 37 | * @return static |
|
| 38 | */ |
|
| 39 | public static function ofKey($key, Context $context = null) |
|
| 40 | { |
|
| 41 | return new static($key, $context); |
|
| 42 | } |
|
| 43 | } |
|
| 44 | ||