This commit is contained in:
Xes
2025-08-14 22:41:49 +02:00
parent 2de81ccc46
commit 8ce45119b6
39774 changed files with 4309466 additions and 0 deletions

View File

@@ -0,0 +1,95 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* You can reverse some <a href="https://stripe.com/docs/api#received_credits">ReceivedCredits</a> depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount Amount (in cents) transferred.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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>.
* @property string $financial_account The FinancialAccount to reverse funds from.
* @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.
* @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.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property string $network The rails used to reverse the funds.
* @property string $received_credit The ReceivedCredit being reversed.
* @property string $status Status of the CreditReversal
* @property (object{posted_at: null|int}&\Stripe\StripeObject) $status_transitions
* @property null|string|Transaction $transaction The Transaction associated with this object.
*/
class CreditReversal extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.credit_reversal';
const NETWORK_ACH = 'ach';
const NETWORK_STRIPE = 'stripe';
const STATUS_CANCELED = 'canceled';
const STATUS_POSTED = 'posted';
const STATUS_PROCESSING = 'processing';
/**
* Reverses a ReceivedCredit and creates a CreditReversal object.
*
* @param null|array{expand?: string[], metadata?: array<string, string>, received_credit: string} $params
* @param null|array|string $options
*
* @return CreditReversal the created resource
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* Returns a list of CreditReversals.
*
* @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, received_credit?: string, starting_after?: string, status?: string} $params
* @param null|array|string $opts
*
* @return \Stripe\Collection<CreditReversal> of ApiResources
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}
/**
* Retrieves the details of an existing CreditReversal by passing the unique
* CreditReversal ID from either the CreditReversal creation request or
* CreditReversal list.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return CreditReversal
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
}

View File

@@ -0,0 +1,94 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* You can reverse some <a href="https://stripe.com/docs/api#received_debits">ReceivedDebits</a> depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount Amount (in cents) transferred.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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>.
* @property null|string $financial_account The FinancialAccount to reverse funds from.
* @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.
* @property null|(object{issuing_dispute: null|string}&\Stripe\StripeObject) $linked_flows Other flows linked to a DebitReversal.
* @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.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property string $network The rails used to reverse the funds.
* @property string $received_debit The ReceivedDebit being reversed.
* @property string $status Status of the DebitReversal
* @property (object{completed_at: null|int}&\Stripe\StripeObject) $status_transitions
* @property null|string|Transaction $transaction The Transaction associated with this object.
*/
class DebitReversal extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.debit_reversal';
const NETWORK_ACH = 'ach';
const NETWORK_CARD = 'card';
const STATUS_FAILED = 'failed';
const STATUS_PROCESSING = 'processing';
const STATUS_SUCCEEDED = 'succeeded';
/**
* Reverses a ReceivedDebit and creates a DebitReversal object.
*
* @param null|array{expand?: string[], metadata?: array<string, string>, received_debit: string} $params
* @param null|array|string $options
*
* @return DebitReversal the created resource
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* Returns a list of DebitReversals.
*
* @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, received_debit?: string, resolution?: string, starting_after?: string, status?: string} $params
* @param null|array|string $opts
*
* @return \Stripe\Collection<DebitReversal> of ApiResources
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}
/**
* Retrieves a DebitReversal object.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return DebitReversal
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
}

View File

@@ -0,0 +1,172 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance.
* FinancialAccounts serve as the source and destination of Treasurys money movement APIs.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property null|string[] $active_features The array of paths to active Features in the Features hash.
* @property (object{cash: \Stripe\StripeObject, inbound_pending: \Stripe\StripeObject, outbound_pending: \Stripe\StripeObject}&\Stripe\StripeObject) $balance Balance information for the FinancialAccount
* @property string $country Two-letter country code (<a href="https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">ISO 3166-1 alpha-2</a>).
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @property null|FinancialAccountFeatures $features Encodes whether a FinancialAccount has access to a particular Feature, with a <code>status</code> enum and associated <code>status_details</code>. Stripe or the platform can control Features via the requested field.
* @property ((object{aba?: (object{account_holder_name: string, account_number?: null|string, account_number_last4: string, bank_name: string, routing_number: string}&\Stripe\StripeObject), supported_networks?: string[], type: string}&\Stripe\StripeObject))[] $financial_addresses The set of credentials that resolve to a FinancialAccount.
* @property null|bool $is_default
* @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.
* @property null|\Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|string $nickname The nickname for the FinancialAccount.
* @property null|string[] $pending_features The array of paths to pending Features in the Features hash.
* @property null|(object{inbound_flows: null|string, outbound_flows: null|string}&\Stripe\StripeObject) $platform_restrictions The set of functionalities that the platform can restrict on the FinancialAccount.
* @property null|string[] $restricted_features The array of paths to restricted Features in the Features hash.
* @property string $status Status of this FinancialAccount.
* @property (object{closed: null|(object{reasons: string[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $status_details
* @property string[] $supported_currencies The currencies the FinancialAccount can hold a balance in. Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>, in lowercase.
*/
class FinancialAccount extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.financial_account';
use \Stripe\ApiOperations\Update;
const STATUS_CLOSED = 'closed';
const STATUS_OPEN = 'open';
/**
* Creates a new FinancialAccount. Each connected account can have up to three
* FinancialAccounts by default.
*
* @param null|array{expand?: string[], features?: array{card_issuing?: array{requested: bool}, deposit_insurance?: array{requested: bool}, financial_addresses?: array{aba?: array{requested: bool}}, inbound_transfers?: array{ach?: array{requested: bool}}, intra_stripe_flows?: array{requested: bool}, outbound_payments?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}, outbound_transfers?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}}, metadata?: array<string, string>, nickname?: null|string, platform_restrictions?: array{inbound_flows?: string, outbound_flows?: string}, supported_currencies: string[]} $params
* @param null|array|string $options
*
* @return FinancialAccount the created resource
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* Returns a list of FinancialAccounts.
*
* @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
* @param null|array|string $opts
*
* @return \Stripe\Collection<FinancialAccount> of ApiResources
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}
/**
* Retrieves the details of a FinancialAccount.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return FinancialAccount
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
/**
* Updates the details of a FinancialAccount.
*
* @param string $id the ID of the resource to update
* @param null|array{expand?: string[], features?: array{card_issuing?: array{requested: bool}, deposit_insurance?: array{requested: bool}, financial_addresses?: array{aba?: array{requested: bool}}, inbound_transfers?: array{ach?: array{requested: bool}}, intra_stripe_flows?: array{requested: bool}, outbound_payments?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}, outbound_transfers?: array{ach?: array{requested: bool}, us_domestic_wire?: array{requested: bool}}}, forwarding_settings?: array{financial_account?: string, payment_method?: string, type: string}, metadata?: array<string, string>, nickname?: null|string, platform_restrictions?: array{inbound_flows?: string, outbound_flows?: string}} $params
* @param null|array|string $opts
*
* @return FinancialAccount the updated resource
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function update($id, $params = null, $opts = null)
{
self::_validateParams($params);
$url = static::resourceUrl($id);
list($response, $opts) = static::_staticRequest('post', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* @param null|array $params
* @param null|array|string $opts
*
* @return FinancialAccount the closed financial account
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function close($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/close';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
/**
* @param null|array $params
* @param null|array|string $opts
*
* @return FinancialAccountFeatures the retrieved financial account features
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function retrieveFeatures($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/features';
list($response, $opts) = $this->_request('get', $url, $params, $opts);
$obj = \Stripe\Util\Util::convertToStripeObject($response, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* @param null|array $params
* @param null|array|string $opts
*
* @return FinancialAccountFeatures the updated financial account features
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function updateFeatures($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/features';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@@ -0,0 +1,23 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* Encodes whether a FinancialAccount has access to a particular Feature, with a <code>status</code> enum and associated <code>status_details</code>.
* Stripe or the platform can control Features via the requested field.
*
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property null|(object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject) $card_issuing Toggle settings for enabling/disabling a feature
* @property null|(object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject) $deposit_insurance Toggle settings for enabling/disabling a feature
* @property null|(object{aba?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $financial_addresses Settings related to Financial Addresses features on a Financial Account
* @property null|(object{ach?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $inbound_transfers InboundTransfers contains inbound transfers features for a FinancialAccount.
* @property null|(object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject) $intra_stripe_flows Toggle settings for enabling/disabling a feature
* @property null|(object{ach?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject), us_domestic_wire?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $outbound_payments Settings related to Outbound Payments features on a Financial Account
* @property null|(object{ach?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject), us_domestic_wire?: (object{requested: bool, status: string, status_details: ((object{code: string, resolution: null|string, restriction?: string}&\Stripe\StripeObject))[]}&\Stripe\StripeObject)}&\Stripe\StripeObject) $outbound_transfers OutboundTransfers contains outbound transfers features for a FinancialAccount.
*/
class FinancialAccountFeatures extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.financial_account_features';
}

View File

@@ -0,0 +1,116 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* Use <a href="https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers">InboundTransfers</a> to add funds to your <a href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a> via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.
*
* Related guide: <a href="https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers">Moving money with Treasury using InboundTransfer objects</a>
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount Amount (in cents) transferred.
* @property bool $cancelable Returns <code>true</code> if the InboundTransfer is able to be canceled.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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>.
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property null|(object{code: string}&\Stripe\StripeObject) $failure_details Details about this InboundTransfer's failure. Only set when status is <code>failed</code>.
* @property string $financial_account The FinancialAccount that received the funds.
* @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.
* @property (object{received_debit: null|string}&\Stripe\StripeObject) $linked_flows
* @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.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|string $origin_payment_method The origin payment method to be debited for an InboundTransfer.
* @property null|(object{billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, fingerprint: null|string, last4: null|string, mandate?: string|\Stripe\Mandate, network: string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $origin_payment_method_details Details about the PaymentMethod for an InboundTransfer.
* @property null|bool $returned Returns <code>true</code> if the funds for an InboundTransfer were returned after the InboundTransfer went to the <code>succeeded</code> state.
* @property string $statement_descriptor Statement descriptor shown when funds are debited from the source. Not all payment networks support <code>statement_descriptor</code>.
* @property string $status Status of the InboundTransfer: <code>processing</code>, <code>succeeded</code>, <code>failed</code>, and <code>canceled</code>. An InboundTransfer is <code>processing</code> if it is created and pending. The status changes to <code>succeeded</code> once the funds have been &quot;confirmed&quot; and a <code>transaction</code> is created and posted. The status changes to <code>failed</code> if the transfer fails.
* @property (object{canceled_at?: null|int, failed_at: null|int, succeeded_at: null|int}&\Stripe\StripeObject) $status_transitions
* @property null|string|Transaction $transaction The Transaction associated with this object.
*/
class InboundTransfer extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.inbound_transfer';
const STATUS_CANCELED = 'canceled';
const STATUS_FAILED = 'failed';
const STATUS_PROCESSING = 'processing';
const STATUS_SUCCEEDED = 'succeeded';
/**
* Creates an InboundTransfer.
*
* @param null|array{amount: int, currency: string, description?: string, expand?: string[], financial_account: string, metadata?: array<string, string>, origin_payment_method: string, statement_descriptor?: string} $params
* @param null|array|string $options
*
* @return InboundTransfer the created resource
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* Returns a list of InboundTransfers sent from the specified FinancialAccount.
*
* @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params
* @param null|array|string $opts
*
* @return \Stripe\Collection<InboundTransfer> of ApiResources
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}
/**
* Retrieves the details of an existing InboundTransfer.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return InboundTransfer
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
/**
* @param null|array $params
* @param null|array|string $opts
*
* @return InboundTransfer the canceled inbound transfer
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function cancel($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/cancel';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@@ -0,0 +1,123 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* Use <a href="https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments">OutboundPayments</a> to send funds to another party's external bank account or <a href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a>. To send money to an account belonging to the same user, use an <a href="https://stripe.com/docs/api#outbound_transfers">OutboundTransfer</a>.
*
* Simulate OutboundPayment state changes with the <code>/v1/test_helpers/treasury/outbound_payments</code> endpoints. These methods can only be called on test mode objects.
*
* Related guide: <a href="https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments">Moving money with Treasury using OutboundPayment objects</a>
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount Amount (in cents) transferred.
* @property bool $cancelable Returns <code>true</code> if the object can be canceled, and <code>false</code> otherwise.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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>.
* @property null|string $customer ID of the <a href="https://stripe.com/docs/api/customers">customer</a> to whom an OutboundPayment is sent.
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property null|string $destination_payment_method The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using <code>destination_payment_method_data</code>.
* @property null|(object{billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), financial_account?: (object{id: string, network: string}&\Stripe\StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, fingerprint: null|string, last4: null|string, mandate?: string|\Stripe\Mandate, network: string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $destination_payment_method_details Details about the PaymentMethod for an OutboundPayment.
* @property null|(object{ip_address: null|string, present: bool}&\Stripe\StripeObject) $end_user_details Details about the end user.
* @property int $expected_arrival_date The date when funds are expected to arrive in the destination account.
* @property string $financial_account The FinancialAccount that funds were pulled from.
* @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.
* @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.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|(object{code: string, transaction: string|Transaction}&\Stripe\StripeObject) $returned_details Details about a returned OutboundPayment. Only set when the status is <code>returned</code>.
* @property string $statement_descriptor The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer).
* @property string $status Current status of the OutboundPayment: <code>processing</code>, <code>failed</code>, <code>posted</code>, <code>returned</code>, <code>canceled</code>. An OutboundPayment is <code>processing</code> if it has been created and is pending. The status changes to <code>posted</code> once the OutboundPayment has been &quot;confirmed&quot; and funds have left the account, or to <code>failed</code> or <code>canceled</code>. If an OutboundPayment fails to arrive at its destination, its status will change to <code>returned</code>.
* @property (object{canceled_at: null|int, failed_at: null|int, posted_at: null|int, returned_at: null|int}&\Stripe\StripeObject) $status_transitions
* @property null|(object{ach?: (object{trace_id: string}&\Stripe\StripeObject), type: string, us_domestic_wire?: (object{chips: null|string, imad: null|string, omad: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $tracking_details Details about network-specific tracking information if available.
* @property string|Transaction $transaction The Transaction associated with this object.
*/
class OutboundPayment extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.outbound_payment';
const STATUS_CANCELED = 'canceled';
const STATUS_FAILED = 'failed';
const STATUS_POSTED = 'posted';
const STATUS_PROCESSING = 'processing';
const STATUS_RETURNED = 'returned';
/**
* Creates an OutboundPayment.
*
* @param null|array{amount: int, currency: string, customer?: string, description?: string, destination_payment_method?: string, destination_payment_method_data?: array{billing_details?: array{address?: null|array{city?: string, country?: string, line1?: string, line2?: string, postal_code?: string, state?: string}, email?: null|string, name?: null|string, phone?: null|string}, financial_account?: string, metadata?: array<string, string>, type: string, us_bank_account?: array{account_holder_type?: string, account_number?: string, account_type?: string, financial_connections_account?: string, routing_number?: string}}, destination_payment_method_options?: array{us_bank_account?: null|array{network?: string}}, end_user_details?: array{ip_address?: string, present: bool}, expand?: string[], financial_account: string, metadata?: array<string, string>, statement_descriptor?: string} $params
* @param null|array|string $options
*
* @return OutboundPayment the created resource
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* Returns a list of OutboundPayments sent from the specified FinancialAccount.
*
* @param null|array{created?: array|int, customer?: string, ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params
* @param null|array|string $opts
*
* @return \Stripe\Collection<OutboundPayment> of ApiResources
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}
/**
* Retrieves the details of an existing OutboundPayment by passing the unique
* OutboundPayment ID from either the OutboundPayment creation request or
* OutboundPayment list.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return OutboundPayment
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
/**
* @param null|array $params
* @param null|array|string $opts
*
* @return OutboundPayment the canceled outbound payment
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function cancel($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/cancel';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@@ -0,0 +1,121 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* Use <a href="https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers">OutboundTransfers</a> to transfer funds from a <a href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a> to a PaymentMethod belonging to the same entity. To send funds to a different party, use <a href="https://stripe.com/docs/api#outbound_payments">OutboundPayments</a> instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.
*
* Simulate OutboundTransfer state changes with the <code>/v1/test_helpers/treasury/outbound_transfers</code> endpoints. These methods can only be called on test mode objects.
*
* Related guide: <a href="https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers">Moving money with Treasury using OutboundTransfer objects</a>
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount Amount (in cents) transferred.
* @property bool $cancelable Returns <code>true</code> if the object can be canceled, and <code>false</code> otherwise.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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>.
* @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property null|string $destination_payment_method The PaymentMethod used as the payment instrument for an OutboundTransfer.
* @property (object{billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), financial_account?: (object{id: string, network: string}&\Stripe\StripeObject), type: string, us_bank_account?: (object{account_holder_type: null|string, account_type: null|string, bank_name: null|string, fingerprint: null|string, last4: null|string, mandate?: string|\Stripe\Mandate, network: string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $destination_payment_method_details
* @property int $expected_arrival_date The date when funds are expected to arrive in the destination account.
* @property string $financial_account The FinancialAccount that funds were pulled from.
* @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.
* @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.
* @property \Stripe\StripeObject $metadata Set of <a href="https://stripe.com/docs/api/metadata">key-value pairs</a> that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
* @property null|(object{code: string, transaction: string|Transaction}&\Stripe\StripeObject) $returned_details Details about a returned OutboundTransfer. Only set when the status is <code>returned</code>.
* @property string $statement_descriptor Information about the OutboundTransfer to be sent to the recipient account.
* @property string $status Current status of the OutboundTransfer: <code>processing</code>, <code>failed</code>, <code>canceled</code>, <code>posted</code>, <code>returned</code>. An OutboundTransfer is <code>processing</code> if it has been created and is pending. The status changes to <code>posted</code> once the OutboundTransfer has been &quot;confirmed&quot; and funds have left the account, or to <code>failed</code> or <code>canceled</code>. If an OutboundTransfer fails to arrive at its destination, its status will change to <code>returned</code>.
* @property (object{canceled_at: null|int, failed_at: null|int, posted_at: null|int, returned_at: null|int}&\Stripe\StripeObject) $status_transitions
* @property null|(object{ach?: (object{trace_id: string}&\Stripe\StripeObject), type: string, us_domestic_wire?: (object{chips: null|string, imad: null|string, omad: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $tracking_details Details about network-specific tracking information if available.
* @property string|Transaction $transaction The Transaction associated with this object.
*/
class OutboundTransfer extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.outbound_transfer';
const STATUS_CANCELED = 'canceled';
const STATUS_FAILED = 'failed';
const STATUS_POSTED = 'posted';
const STATUS_PROCESSING = 'processing';
const STATUS_RETURNED = 'returned';
/**
* Creates an OutboundTransfer.
*
* @param null|array{amount: int, currency: string, description?: string, destination_payment_method?: string, destination_payment_method_data?: array{financial_account?: string, type: string}, destination_payment_method_options?: array{us_bank_account?: null|array{network?: string}}, expand?: string[], financial_account: string, metadata?: array<string, string>, statement_descriptor?: string} $params
* @param null|array|string $options
*
* @return OutboundTransfer the created resource
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function create($params = null, $options = null)
{
self::_validateParams($params);
$url = static::classUrl();
list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
$obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts);
$obj->setLastResponse($response);
return $obj;
}
/**
* Returns a list of OutboundTransfers sent from the specified FinancialAccount.
*
* @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params
* @param null|array|string $opts
*
* @return \Stripe\Collection<OutboundTransfer> of ApiResources
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}
/**
* Retrieves the details of an existing OutboundTransfer by passing the unique
* OutboundTransfer ID from either the OutboundTransfer creation request or
* OutboundTransfer list.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return OutboundTransfer
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
/**
* @param null|array $params
* @param null|array|string $opts
*
* @return OutboundTransfer the canceled outbound transfer
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public function cancel($params = null, $opts = null)
{
$url = $this->instanceUrl() . '/cancel';
list($response, $opts) = $this->_request('post', $url, $params, $opts);
$this->refreshFrom($response, $opts);
return $this;
}
}

View File

@@ -0,0 +1,80 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* ReceivedCredits represent funds sent to a <a href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a> (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount Amount (in cents) transferred.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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>.
* @property string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property null|string $failure_code Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen.
* @property null|string $financial_account The FinancialAccount that received the funds.
* @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.
* @property (object{balance?: string, billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), financial_account?: (object{id: string, network: string}&\Stripe\StripeObject), issuing_card?: string, type: string, us_bank_account?: (object{bank_name: null|string, last4: null|string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $initiating_payment_method_details
* @property (object{credit_reversal: null|string, issuing_authorization: null|string, issuing_transaction: null|string, source_flow: null|string, source_flow_details?: null|(object{credit_reversal?: CreditReversal, outbound_payment?: OutboundPayment, outbound_transfer?: OutboundTransfer, payout?: \Stripe\Payout, type: string}&\Stripe\StripeObject), source_flow_type: null|string}&\Stripe\StripeObject) $linked_flows
* @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.
* @property string $network The rails used to send the funds.
* @property null|(object{deadline: null|int, restricted_reason: null|string}&\Stripe\StripeObject) $reversal_details Details describing when a ReceivedCredit may be reversed.
* @property string $status Status of the ReceivedCredit. ReceivedCredits are created either <code>succeeded</code> (approved) or <code>failed</code> (declined). If a ReceivedCredit is declined, the failure reason can be found in the <code>failure_code</code> field.
* @property null|string|Transaction $transaction The Transaction associated with this object.
*/
class ReceivedCredit extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.received_credit';
const FAILURE_CODE_ACCOUNT_CLOSED = 'account_closed';
const FAILURE_CODE_ACCOUNT_FROZEN = 'account_frozen';
const FAILURE_CODE_INTERNATIONAL_TRANSACTION = 'international_transaction';
const FAILURE_CODE_OTHER = 'other';
const NETWORK_ACH = 'ach';
const NETWORK_CARD = 'card';
const NETWORK_STRIPE = 'stripe';
const NETWORK_US_DOMESTIC_WIRE = 'us_domestic_wire';
const STATUS_FAILED = 'failed';
const STATUS_SUCCEEDED = 'succeeded';
/**
* Returns a list of ReceivedCredits.
*
* @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, linked_flows?: array{source_flow_type: string}, starting_after?: string, status?: string} $params
* @param null|array|string $opts
*
* @return \Stripe\Collection<ReceivedCredit> of ApiResources
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}
/**
* Retrieves the details of an existing ReceivedCredit by passing the unique
* ReceivedCredit ID from the ReceivedCredit list.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return ReceivedCredit
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
}

View File

@@ -0,0 +1,80 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* ReceivedDebits represent funds pulled from a <a href="https://stripe.com/docs/api#financial_accounts">FinancialAccount</a>. These are not initiated from the FinancialAccount.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount Amount (in cents) transferred.
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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>.
* @property string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @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.
* @property null|string $financial_account The FinancialAccount that funds were pulled from.
* @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.
* @property null|(object{balance?: string, billing_details: (object{address: (object{city: null|string, country: null|string, line1: null|string, line2: null|string, postal_code: null|string, state: null|string}&\Stripe\StripeObject), email: null|string, name: null|string}&\Stripe\StripeObject), financial_account?: (object{id: string, network: string}&\Stripe\StripeObject), issuing_card?: string, type: string, us_bank_account?: (object{bank_name: null|string, last4: null|string, routing_number: null|string}&\Stripe\StripeObject)}&\Stripe\StripeObject) $initiating_payment_method_details
* @property (object{debit_reversal: null|string, inbound_transfer: null|string, issuing_authorization: null|string, issuing_transaction: null|string, payout: null|string}&\Stripe\StripeObject) $linked_flows
* @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.
* @property string $network The network used for the ReceivedDebit.
* @property null|(object{deadline: null|int, restricted_reason: null|string}&\Stripe\StripeObject) $reversal_details Details describing when a ReceivedDebit might be reversed.
* @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>.
* @property null|string|Transaction $transaction The Transaction associated with this object.
*/
class ReceivedDebit extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.received_debit';
const FAILURE_CODE_ACCOUNT_CLOSED = 'account_closed';
const FAILURE_CODE_ACCOUNT_FROZEN = 'account_frozen';
const FAILURE_CODE_INSUFFICIENT_FUNDS = 'insufficient_funds';
const FAILURE_CODE_INTERNATIONAL_TRANSACTION = 'international_transaction';
const FAILURE_CODE_OTHER = 'other';
const NETWORK_ACH = 'ach';
const NETWORK_CARD = 'card';
const NETWORK_STRIPE = 'stripe';
const STATUS_FAILED = 'failed';
const STATUS_SUCCEEDED = 'succeeded';
/**
* Returns a list of ReceivedDebits.
*
* @param null|array{ending_before?: string, expand?: string[], financial_account: string, limit?: int, starting_after?: string, status?: string} $params
* @param null|array|string $opts
*
* @return \Stripe\Collection<ReceivedDebit> of ApiResources
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}
/**
* Retrieves the details of an existing ReceivedDebit by passing the unique
* ReceivedDebit ID from the ReceivedDebit list.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return ReceivedDebit
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
}

View File

@@ -0,0 +1,79 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* Transactions represent changes to a <a href="https://stripe.com/docs/api#financial_accounts">FinancialAccount's</a> balance.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property int $amount Amount (in cents) transferred.
* @property (object{cash: int, inbound_pending: int, outbound_pending: int}&\Stripe\StripeObject) $balance_impact Change to a FinancialAccount's balance
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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>.
* @property string $description An arbitrary string attached to the object. Often useful for displaying to users.
* @property null|\Stripe\Collection<TransactionEntry> $entries A list of TransactionEntries that are part of this Transaction. This cannot be expanded in any list endpoints.
* @property string $financial_account The FinancialAccount associated with this object.
* @property null|string $flow ID of the flow that created the Transaction.
* @property null|(object{credit_reversal?: CreditReversal, debit_reversal?: DebitReversal, inbound_transfer?: InboundTransfer, issuing_authorization?: \Stripe\Issuing\Authorization, outbound_payment?: OutboundPayment, outbound_transfer?: OutboundTransfer, received_credit?: ReceivedCredit, received_debit?: ReceivedDebit, type: string}&\Stripe\StripeObject) $flow_details Details of the flow that created the Transaction.
* @property string $flow_type Type of the flow that created the Transaction.
* @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.
* @property string $status Status of the Transaction.
* @property (object{posted_at: null|int, void_at: null|int}&\Stripe\StripeObject) $status_transitions
*/
class Transaction extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.transaction';
const FLOW_TYPE_CREDIT_REVERSAL = 'credit_reversal';
const FLOW_TYPE_DEBIT_REVERSAL = 'debit_reversal';
const FLOW_TYPE_INBOUND_TRANSFER = 'inbound_transfer';
const FLOW_TYPE_ISSUING_AUTHORIZATION = 'issuing_authorization';
const FLOW_TYPE_OTHER = 'other';
const FLOW_TYPE_OUTBOUND_PAYMENT = 'outbound_payment';
const FLOW_TYPE_OUTBOUND_TRANSFER = 'outbound_transfer';
const FLOW_TYPE_RECEIVED_CREDIT = 'received_credit';
const FLOW_TYPE_RECEIVED_DEBIT = 'received_debit';
const STATUS_OPEN = 'open';
const STATUS_POSTED = 'posted';
const STATUS_VOID = 'void';
/**
* Retrieves a list of Transaction objects.
*
* @param null|array{created?: array|int, ending_before?: string, expand?: string[], financial_account: string, limit?: int, order_by?: string, starting_after?: string, status?: string, status_transitions?: array{posted_at?: array|int}} $params
* @param null|array|string $opts
*
* @return \Stripe\Collection<Transaction> of ApiResources
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}
/**
* Retrieves the details of an existing Transaction.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return Transaction
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
}

View File

@@ -0,0 +1,94 @@
<?php
// File generated from our OpenAPI spec
namespace Stripe\Treasury;
/**
* TransactionEntries represent individual units of money movements within a single <a href="https://stripe.com/docs/api#transactions">Transaction</a>.
*
* @property string $id Unique identifier for the object.
* @property string $object String representing the object's type. Objects of the same type share the same value.
* @property (object{cash: int, inbound_pending: int, outbound_pending: int}&\Stripe\StripeObject) $balance_impact Change to a FinancialAccount's balance
* @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
* @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>.
* @property int $effective_at When the TransactionEntry will impact the FinancialAccount's balance.
* @property string $financial_account The FinancialAccount associated with this object.
* @property null|string $flow Token of the flow associated with the TransactionEntry.
* @property null|(object{credit_reversal?: CreditReversal, debit_reversal?: DebitReversal, inbound_transfer?: InboundTransfer, issuing_authorization?: \Stripe\Issuing\Authorization, outbound_payment?: OutboundPayment, outbound_transfer?: OutboundTransfer, received_credit?: ReceivedCredit, received_debit?: ReceivedDebit, type: string}&\Stripe\StripeObject) $flow_details Details of the flow associated with the TransactionEntry.
* @property string $flow_type Type of the flow associated with the TransactionEntry.
* @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.
* @property string|Transaction $transaction The Transaction associated with this object.
* @property string $type The specific money movement that generated the TransactionEntry.
*/
class TransactionEntry extends \Stripe\ApiResource
{
const OBJECT_NAME = 'treasury.transaction_entry';
const FLOW_TYPE_CREDIT_REVERSAL = 'credit_reversal';
const FLOW_TYPE_DEBIT_REVERSAL = 'debit_reversal';
const FLOW_TYPE_INBOUND_TRANSFER = 'inbound_transfer';
const FLOW_TYPE_ISSUING_AUTHORIZATION = 'issuing_authorization';
const FLOW_TYPE_OTHER = 'other';
const FLOW_TYPE_OUTBOUND_PAYMENT = 'outbound_payment';
const FLOW_TYPE_OUTBOUND_TRANSFER = 'outbound_transfer';
const FLOW_TYPE_RECEIVED_CREDIT = 'received_credit';
const FLOW_TYPE_RECEIVED_DEBIT = 'received_debit';
const TYPE_CREDIT_REVERSAL = 'credit_reversal';
const TYPE_CREDIT_REVERSAL_POSTING = 'credit_reversal_posting';
const TYPE_DEBIT_REVERSAL = 'debit_reversal';
const TYPE_INBOUND_TRANSFER = 'inbound_transfer';
const TYPE_INBOUND_TRANSFER_RETURN = 'inbound_transfer_return';
const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold';
const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release';
const TYPE_OTHER = 'other';
const TYPE_OUTBOUND_PAYMENT = 'outbound_payment';
const TYPE_OUTBOUND_PAYMENT_CANCELLATION = 'outbound_payment_cancellation';
const TYPE_OUTBOUND_PAYMENT_FAILURE = 'outbound_payment_failure';
const TYPE_OUTBOUND_PAYMENT_POSTING = 'outbound_payment_posting';
const TYPE_OUTBOUND_PAYMENT_RETURN = 'outbound_payment_return';
const TYPE_OUTBOUND_TRANSFER = 'outbound_transfer';
const TYPE_OUTBOUND_TRANSFER_CANCELLATION = 'outbound_transfer_cancellation';
const TYPE_OUTBOUND_TRANSFER_FAILURE = 'outbound_transfer_failure';
const TYPE_OUTBOUND_TRANSFER_POSTING = 'outbound_transfer_posting';
const TYPE_OUTBOUND_TRANSFER_RETURN = 'outbound_transfer_return';
const TYPE_RECEIVED_CREDIT = 'received_credit';
const TYPE_RECEIVED_DEBIT = 'received_debit';
/**
* Retrieves a list of TransactionEntry objects.
*
* @param null|array{created?: array|int, effective_at?: array|int, ending_before?: string, expand?: string[], financial_account: string, limit?: int, order_by?: string, starting_after?: string, transaction?: string} $params
* @param null|array|string $opts
*
* @return \Stripe\Collection<TransactionEntry> of ApiResources
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function all($params = null, $opts = null)
{
$url = static::classUrl();
return static::_requestPage($url, \Stripe\Collection::class, $params, $opts);
}
/**
* Retrieves a TransactionEntry object.
*
* @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
* @param null|array|string $opts
*
* @return TransactionEntry
*
* @throws \Stripe\Exception\ApiErrorException if the request fails
*/
public static function retrieve($id, $opts = null)
{
$opts = \Stripe\Util\RequestOptions::parse($opts);
$instance = new static($id, $opts);
$instance->refresh();
return $instance;
}
}