TransactionEntry.php 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Treasury;
  4. /**
  5. * TransactionEntries represent individual units of money movements within a single <a href="https://stripe.com/docs/api#transactions">Transaction</a>.
  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 \Stripe\StripeObject $balance_impact Change to a FinancialAccount's balance
  10. * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
  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 int $effective_at When the TransactionEntry will impact the FinancialAccount's balance.
  13. * @property string $financial_account The FinancialAccount associated with this object.
  14. * @property null|string $flow Token of the flow associated with the TransactionEntry.
  15. * @property null|\Stripe\StripeObject $flow_details Details of the flow associated with the TransactionEntry.
  16. * @property string $flow_type Type of the flow associated with the TransactionEntry.
  17. * @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.
  18. * @property string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object.
  19. * @property string $type The specific money movement that generated the TransactionEntry.
  20. */
  21. class TransactionEntry extends \Stripe\ApiResource
  22. {
  23. const OBJECT_NAME = 'treasury.transaction_entry';
  24. const FLOW_TYPE_CREDIT_REVERSAL = 'credit_reversal';
  25. const FLOW_TYPE_DEBIT_REVERSAL = 'debit_reversal';
  26. const FLOW_TYPE_INBOUND_TRANSFER = 'inbound_transfer';
  27. const FLOW_TYPE_ISSUING_AUTHORIZATION = 'issuing_authorization';
  28. const FLOW_TYPE_OTHER = 'other';
  29. const FLOW_TYPE_OUTBOUND_PAYMENT = 'outbound_payment';
  30. const FLOW_TYPE_OUTBOUND_TRANSFER = 'outbound_transfer';
  31. const FLOW_TYPE_RECEIVED_CREDIT = 'received_credit';
  32. const FLOW_TYPE_RECEIVED_DEBIT = 'received_debit';
  33. const TYPE_CREDIT_REVERSAL = 'credit_reversal';
  34. const TYPE_CREDIT_REVERSAL_POSTING = 'credit_reversal_posting';
  35. const TYPE_DEBIT_REVERSAL = 'debit_reversal';
  36. const TYPE_INBOUND_TRANSFER = 'inbound_transfer';
  37. const TYPE_INBOUND_TRANSFER_RETURN = 'inbound_transfer_return';
  38. const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold';
  39. const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release';
  40. const TYPE_OTHER = 'other';
  41. const TYPE_OUTBOUND_PAYMENT = 'outbound_payment';
  42. const TYPE_OUTBOUND_PAYMENT_CANCELLATION = 'outbound_payment_cancellation';
  43. const TYPE_OUTBOUND_PAYMENT_FAILURE = 'outbound_payment_failure';
  44. const TYPE_OUTBOUND_PAYMENT_POSTING = 'outbound_payment_posting';
  45. const TYPE_OUTBOUND_PAYMENT_RETURN = 'outbound_payment_return';
  46. const TYPE_OUTBOUND_TRANSFER = 'outbound_transfer';
  47. const TYPE_OUTBOUND_TRANSFER_CANCELLATION = 'outbound_transfer_cancellation';
  48. const TYPE_OUTBOUND_TRANSFER_FAILURE = 'outbound_transfer_failure';
  49. const TYPE_OUTBOUND_TRANSFER_POSTING = 'outbound_transfer_posting';
  50. const TYPE_OUTBOUND_TRANSFER_RETURN = 'outbound_transfer_return';
  51. const TYPE_RECEIVED_CREDIT = 'received_credit';
  52. const TYPE_RECEIVED_DEBIT = 'received_debit';
  53. /**
  54. * Retrieves a list of TransactionEntry objects.
  55. *
  56. * @param null|array $params
  57. * @param null|array|string $opts
  58. *
  59. * @throws \Stripe\Exception\ApiErrorException if the request fails
  60. *
  61. * @return \Stripe\Collection<\Stripe\Treasury\TransactionEntry> of ApiResources
  62. */
  63. public static function all($params = null, $opts = null)
  64. {
  65. $url = static::classUrl();
  66. return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
  67. }
  68. /**
  69. * Retrieves a TransactionEntry object.
  70. *
  71. * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
  72. * @param null|array|string $opts
  73. *
  74. * @throws \Stripe\Exception\ApiErrorException if the request fails
  75. *
  76. * @return \Stripe\Treasury\TransactionEntry
  77. */
  78. public static function retrieve($id, $opts = null)
  79. {
  80. $opts = \Stripe\Util\RequestOptions::parse($opts);
  81. $instance = new static($id, $opts);
  82. $instance->refresh();
  83. return $instance;
  84. }
  85. }