| @@ 23-54 (lines=32) @@ | ||
| 20 | * |
|
| 21 | * @see https://www.omise.co/receipt-api |
|
| 22 | */ |
|
| 23 | final class Receipt extends Api |
|
| 24 | { |
|
| 25 | /** |
|
| 26 | * @param array $parameters |
|
| 27 | * |
|
| 28 | * @return Pagination |
|
| 29 | */ |
|
| 30 | public function all(array $parameters = []) |
|
| 31 | { |
|
| 32 | return $this->doRequest('GET', '/receipts', $parameters); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @param string $id |
|
| 37 | * |
|
| 38 | * @return Domain |
|
| 39 | */ |
|
| 40 | public function find($id) |
|
| 41 | { |
|
| 42 | self::assertNotEmpty($id); |
|
| 43 | ||
| 44 | return $this->doRequest('GET', '/receipts/'.$id); |
|
| 45 | } |
|
| 46 | ||
| 47 | /** |
|
| 48 | * @param Domain $receipt |
|
| 49 | */ |
|
| 50 | public function refresh(Domain $receipt ) |
|
| 51 | { |
|
| 52 | $receipt->updateStore($this->find($receipt->id)->toArray()); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||
| @@ 23-54 (lines=32) @@ | ||
| 20 | * |
|
| 21 | * @see https://www.omise.co/transactions-api |
|
| 22 | */ |
|
| 23 | final class Transaction extends Api |
|
| 24 | { |
|
| 25 | /** |
|
| 26 | * @param array $parameters |
|
| 27 | * |
|
| 28 | * @return Pagination |
|
| 29 | */ |
|
| 30 | public function all(array $parameters = []) |
|
| 31 | { |
|
| 32 | return $this->doRequest('GET', '/transactions', $parameters); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @param string $id |
|
| 37 | * |
|
| 38 | * @return Domain |
|
| 39 | */ |
|
| 40 | public function find($id) |
|
| 41 | { |
|
| 42 | self::assertNotEmpty($id); |
|
| 43 | ||
| 44 | return $this->doRequest('GET', '/transactions/'.$id); |
|
| 45 | } |
|
| 46 | ||
| 47 | /** |
|
| 48 | * @param Domain $transaction |
|
| 49 | */ |
|
| 50 | public function refresh(Domain $transaction) |
|
| 51 | { |
|
| 52 | $transaction->updateStore($this->find($transaction->id)->toArray()); |
|
| 53 | } |
|
| 54 | } |
|
| 55 | ||