| Total Complexity | 4 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait Transactions |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * List transactions for a ChargifyClient site. |
||
| 9 | * |
||
| 10 | * @param int $page |
||
| 11 | * @param int $per_page |
||
| 12 | * @param string $order_by |
||
| 13 | * |
||
| 14 | * @return array |
||
| 15 | */ |
||
| 16 | public function transactions_for_site($page = 1, $per_page = 200, $order_by = 'created_at'): array |
||
| 17 | { |
||
| 18 | $this->apiEndPoint = "/transactions.json?page={$page}&per_page={$per_page}&order_by={$order_by}"; |
||
| 19 | |||
| 20 | $this->verb = 'get'; |
||
| 21 | |||
| 22 | return $this->doChargifyRequest(); |
||
|
|
|||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * List details for a transactions. |
||
| 27 | * |
||
| 28 | * @param int $transaction_id |
||
| 29 | * @param int $page |
||
| 30 | * @param int $per_page |
||
| 31 | * |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | public function transaction_details($transaction_id, $page = 1, $per_page = 200): array |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * List transactions for a subscription. |
||
| 45 | * |
||
| 46 | * @param int $subscription_id |
||
| 47 | * @param int $page |
||
| 48 | * @param int $per_page |
||
| 49 | * |
||
| 50 | * @return array |
||
| 51 | */ |
||
| 52 | public function transactions_for_subscription($subscription_id, $page = 1, $per_page = 200): array |
||
| 53 | { |
||
| 54 | $this->apiEndPoint = "/subscriptions/{$subscription_id}/transactions.json?page={$page}&per_page={$per_page}"; |
||
| 55 | |||
| 56 | $this->verb = 'get'; |
||
| 57 | |||
| 58 | return $this->doChargifyRequest(); |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * List transactions for a ChargifyClient site. |
||
| 63 | * |
||
| 64 | * @return array |
||
| 65 | */ |
||
| 66 | public function transactions_count(): array |
||
| 73 | } |
||
| 74 | } |
||
| 75 |