Balance.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe;
  4. /**
  5. * This is an object representing your Stripe balance. You can retrieve it to see
  6. * the balance currently on your Stripe account.
  7. *
  8. * You can also retrieve the balance history, which contains a list of
  9. * <a href="https://stripe.com/docs/reporting/balance-transaction-types">transactions</a> that contributed to the balance
  10. * (charges, payouts, and so forth).
  11. *
  12. * The available and pending amounts for each currency are broken down further by
  13. * payment source types.
  14. *
  15. * Related guide: <a href="https://stripe.com/docs/connect/account-balances">Understanding Connect account balances</a>
  16. *
  17. * @property string $object String representing the object's type. Objects of the same type share the same value.
  18. * @property \Stripe\StripeObject[] $available Available funds that you can transfer or pay out automatically by Stripe or explicitly through the <a href="https://stripe.com/docs/api#transfers">Transfers API</a> or <a href="https://stripe.com/docs/api#payouts">Payouts API</a>. You can find the available balance for each currency and payment type in the <code>source_types</code> property.
  19. * @property null|\Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected accounts where <a href="/api/accounts/object#account_object-controller-requirement_collection">account.controller.requirement_collection</a> is <code>application</code>, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the <code>source_types</code> property.
  20. * @property null|\Stripe\StripeObject[] $instant_available Funds that you can pay out using Instant Payouts.
  21. * @property null|\Stripe\StripeObject $issuing
  22. * @property bool $livemode Has the value <code>true</code> if the object exists in live mode or the value <code>false</code> if the object exists in test mode.
  23. * @property \Stripe\StripeObject[] $pending Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the <code>source_types</code> property.
  24. */
  25. class Balance extends SingletonApiResource
  26. {
  27. const OBJECT_NAME = 'balance';
  28. /**
  29. * Retrieves the current account balance, based on the authentication that was used
  30. * to make the request. For a sample request, see <a
  31. * href="/docs/connect/account-balances#accounting-for-negative-balances">Accounting
  32. * for negative balances</a>.
  33. *
  34. * @param null|array|string $opts
  35. *
  36. * @throws \Stripe\Exception\ApiErrorException if the request fails
  37. *
  38. * @return \Stripe\Balance
  39. */
  40. public static function retrieve($opts = null)
  41. {
  42. $opts = \Stripe\Util\RequestOptions::parse($opts);
  43. $instance = new static(null, $opts);
  44. $instance->refresh();
  45. return $instance;
  46. }
  47. }