ReceivedDebit.php 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Treasury;
  4. /**
  5. * ReceivedDebits represent funds pulled from a <a href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a>. These are not initiated from the FinancialAccount.
  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 int $amount Amount (in cents) transferred.
  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 string $description An arbitrary string attached to the object. Often useful for displaying to users.
  13. * @property null|string $failure_code Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen.
  14. * @property null|string $financial_account The FinancialAccount that funds were pulled from.
  15. * @property null|string $hosted_regulatory_receipt_url A <a href="https://stripe.com/docs/treasury/moving-money/regulatory-receipts">hosted transaction receipt</a> URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
  16. * @property null|\Stripe\StripeObject $initiating_payment_method_details
  17. * @property \Stripe\StripeObject $linked_flows
  18. * @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.
  19. * @property string $network The network used for the ReceivedDebit.
  20. * @property null|\Stripe\StripeObject $reversal_details Details describing when a ReceivedDebit might be reversed.
  21. * @property string $status Status of the ReceivedDebit. ReceivedDebits are created with a status of either <code>succeeded</code> (approved) or <code>failed</code> (declined). The failure reason can be found under the <code>failure_code</code>.
  22. * @property null|string|\Stripe\Treasury\Transaction $transaction The Transaction associated with this object.
  23. */
  24. class ReceivedDebit extends \Stripe\ApiResource
  25. {
  26. const OBJECT_NAME = 'treasury.received_debit';
  27. const FAILURE_CODE_ACCOUNT_CLOSED = 'account_closed';
  28. const FAILURE_CODE_ACCOUNT_FROZEN = 'account_frozen';
  29. const FAILURE_CODE_INSUFFICIENT_FUNDS = 'insufficient_funds';
  30. const FAILURE_CODE_OTHER = 'other';
  31. const NETWORK_ACH = 'ach';
  32. const NETWORK_CARD = 'card';
  33. const NETWORK_STRIPE = 'stripe';
  34. const STATUS_FAILED = 'failed';
  35. const STATUS_SUCCEEDED = 'succeeded';
  36. /**
  37. * Returns a list of ReceivedDebits.
  38. *
  39. * @param null|array $params
  40. * @param null|array|string $opts
  41. *
  42. * @throws \Stripe\Exception\ApiErrorException if the request fails
  43. *
  44. * @return \Stripe\Collection<\Stripe\Treasury\ReceivedDebit> of ApiResources
  45. */
  46. public static function all($params = null, $opts = null)
  47. {
  48. $url = static::classUrl();
  49. return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
  50. }
  51. /**
  52. * Retrieves the details of an existing ReceivedDebit by passing the unique
  53. * ReceivedDebit ID from the ReceivedDebit list.
  54. *
  55. * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
  56. * @param null|array|string $opts
  57. *
  58. * @throws \Stripe\Exception\ApiErrorException if the request fails
  59. *
  60. * @return \Stripe\Treasury\ReceivedDebit
  61. */
  62. public static function retrieve($id, $opts = null)
  63. {
  64. $opts = \Stripe\Util\RequestOptions::parse($opts);
  65. $instance = new static($id, $opts);
  66. $instance->refresh();
  67. return $instance;
  68. }
  69. }