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