1 | <?php namespace Arcanedev\Stripe\Resources; |
||
47 | class Invoice extends StripeResource implements InvoiceContract |
||
48 | { |
||
49 | /* ------------------------------------------------------------------------------------------------ |
||
50 | | Main Functions |
||
51 | | ------------------------------------------------------------------------------------------------ |
||
52 | */ |
||
53 | /** |
||
54 | * List of all Invoices. |
||
55 | * @link https://stripe.com/docs/api/php#list_customer_invoices |
||
56 | * |
||
57 | * @param array|null $params |
||
58 | * @param array|string|null $options |
||
59 | * |
||
60 | * @return \Arcanedev\Stripe\Collection|array |
||
61 | */ |
||
62 | 4 | public static function all($params = [], $options = null) |
|
66 | |||
67 | /** |
||
68 | * Retrieving an Invoice |
||
69 | * @link https://stripe.com/docs/api/php#retrieve_invoice |
||
70 | * |
||
71 | * @param string $id |
||
72 | * @param array|string|null $options |
||
73 | * |
||
74 | * @return self |
||
75 | */ |
||
76 | 6 | public static function retrieve($id, $options = null) |
|
80 | |||
81 | /** |
||
82 | * Create an Invoice. |
||
83 | * @link https://stripe.com/docs/api/php#create_invoice |
||
84 | * |
||
85 | * @param array|null $params |
||
86 | * @param array|string|null $options |
||
87 | * |
||
88 | * @return self|array |
||
89 | */ |
||
90 | 10 | public static function create($params = [], $options = null) |
|
94 | |||
95 | /** |
||
96 | * Update an invoice. |
||
97 | * @link https://stripe.com/docs/api/php#update_invoice |
||
98 | * |
||
99 | * @param string $id |
||
100 | * @param array|null $params |
||
101 | * @param array|string|null $options |
||
102 | * |
||
103 | * @return self |
||
104 | */ |
||
105 | 2 | public static function update($id, $params = [], $options = null) |
|
109 | |||
110 | /** |
||
111 | * Update/Save an invoice. |
||
112 | * @link https://stripe.com/docs/api/php#update_invoice |
||
113 | * |
||
114 | * @param array|string|null $options |
||
115 | * |
||
116 | * @return self |
||
117 | */ |
||
118 | 2 | public function save($options = null) |
|
122 | |||
123 | /** |
||
124 | * Retrieve Upcoming Invoice. |
||
125 | * @link https://stripe.com/docs/api/php#retrieve_customer_invoice |
||
126 | * |
||
127 | * @param array|null $params |
||
128 | * @param array|string|null $options |
||
129 | * |
||
130 | * @return self|array |
||
131 | */ |
||
132 | 4 | public static function upcoming($params = [], $options = null) |
|
133 | { |
||
134 | /** @var \Arcanedev\Stripe\Http\Response $response */ |
||
135 | 4 | list($response, $opts) = self::staticRequest( |
|
136 | 4 | 'get', self::classUrl(get_class()).'/upcoming', $params, $options |
|
137 | ); |
||
138 | |||
139 | 4 | $object = Util::convertToStripeObject($response->getJson(), $opts); |
|
140 | 4 | $object->setLastResponse($response); |
|
141 | |||
142 | 4 | return $object; |
|
143 | } |
||
144 | |||
145 | /** |
||
146 | * Pay an Invoice. |
||
147 | * @link https://stripe.com/docs/api/php#pay_invoice |
||
148 | * |
||
149 | * @param array|null $params |
||
150 | * @param array|string|null $options |
||
151 | * |
||
152 | * @return self |
||
153 | */ |
||
154 | 4 | public function pay($params = [], $options = null) |
|
163 | } |
||
164 |