BalanceTransactionService.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service;
  4. class BalanceTransactionService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * Returns a list of transactions that have contributed to the Stripe account
  8. * balance (e.g., charges, transfers, and so forth). The transactions are returned
  9. * in sorted order, with the most recent transactions appearing first.
  10. *
  11. * Note that this endpoint was previously called “Balance history” and used the
  12. * path <code>/v1/balance/history</code>.
  13. *
  14. * @param null|array $params
  15. * @param null|array|\Stripe\Util\RequestOptions $opts
  16. *
  17. * @throws \Stripe\Exception\ApiErrorException if the request fails
  18. *
  19. * @return \Stripe\Collection
  20. */
  21. public function all($params = null, $opts = null)
  22. {
  23. return $this->requestCollection('get', '/v1/balance_transactions', $params, $opts);
  24. }
  25. /**
  26. * Retrieves the balance transaction with the given ID.
  27. *
  28. * Note that this endpoint previously used the path
  29. * <code>/v1/balance/history/:id</code>.
  30. *
  31. * @param string $id
  32. * @param null|array $params
  33. * @param null|array|\Stripe\Util\RequestOptions $opts
  34. *
  35. * @throws \Stripe\Exception\ApiErrorException if the request fails
  36. *
  37. * @return \Stripe\BalanceTransaction
  38. */
  39. public function retrieve($id, $params = null, $opts = null)
  40. {
  41. return $this->request('get', $this->buildPath('/v1/balance_transactions/%s', $id), $params, $opts);
  42. }
  43. }