1: <?php
2:
3: namespace ShippoClient;
4:
5: use ShippoClient\Entity\Refund;
6: use ShippoClient\Http\Request;
7: use ShippoClient\Http\Response\RefundList;
8:
9: class Refunds
10: {
11: private $request;
12:
13: public function __construct(Request $request)
14: {
15: $this->request = $request;
16: }
17:
18: public function create($transactionObjectId)
19: {
20: $responseArray = $this->request->post('refunds', ['transaction' => $transactionObjectId]);
21:
22: return new Refund($responseArray);
23: }
24:
25: public function retrieve($objectId)
26: {
27: $responseArray = $this->request->get("refunds/$objectId");
28:
29: return new Refund($responseArray);
30: }
31:
32: 33: 34: 35:
36: public function getList($results = null)
37: {
38: $responseArray = $this->request->get("refunds", ['results' => $results]);
39:
40: return new RefundList($responseArray);
41: }
42: }
43: