Transaction.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\FinancialConnections;
  4. /**
  5. * A Transaction represents a real transaction that affects a Financial Connections Account balance.
  6. *
  7. * @property string $id Unique identifier for the object.
  8. * @property string $object String representing the object's type. Objects of the same type share the same value.
  9. * @property string $account The ID of the Financial Connections Account this transaction belongs to.
  10. * @property int $amount The amount of this transaction, in cents (or local equivalent).
  11. * @property string $currency Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
  12. * @property string $description The description of this transaction.
  13. * @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.
  14. * @property string $status The status of the transaction.
  15. * @property \Stripe\StripeObject $status_transitions
  16. * @property int $transacted_at Time at which the transaction was transacted. Measured in seconds since the Unix epoch.
  17. * @property string $transaction_refresh The token of the transaction refresh that last updated or created this transaction.
  18. * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch.
  19. */
  20. class Transaction extends \Stripe\ApiResource
  21. {
  22. const OBJECT_NAME = 'financial_connections.transaction';
  23. const STATUS_PENDING = 'pending';
  24. const STATUS_POSTED = 'posted';
  25. const STATUS_VOID = 'void';
  26. /**
  27. * Returns a list of Financial Connections <code>Transaction</code> objects.
  28. *
  29. * @param null|array $params
  30. * @param null|array|string $opts
  31. *
  32. * @throws \Stripe\Exception\ApiErrorException if the request fails
  33. *
  34. * @return \Stripe\Collection<\Stripe\FinancialConnections\Transaction> of ApiResources
  35. */
  36. public static function all($params = null, $opts = null)
  37. {
  38. $url = static::classUrl();
  39. return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
  40. }
  41. /**
  42. * Retrieves the details of a Financial Connections <code>Transaction</code>.
  43. *
  44. * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
  45. * @param null|array|string $opts
  46. *
  47. * @throws \Stripe\Exception\ApiErrorException if the request fails
  48. *
  49. * @return \Stripe\FinancialConnections\Transaction
  50. */
  51. public static function retrieve($id, $opts = null)
  52. {
  53. $opts = \Stripe\Util\RequestOptions::parse($opts);
  54. $instance = new static($id, $opts);
  55. $instance->refresh();
  56. return $instance;
  57. }
  58. }