Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Updates for beta branch #1476

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions testhelperstreasury_receivedcredit.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ type TestHelpersTreasuryReceivedCreditInitiatingPaymentMethodDetailsParams struc
USBankAccount *TestHelpersTreasuryReceivedCreditInitiatingPaymentMethodDetailsUSBankAccountParams `form:"us_bank_account"`
}

// Optional fields for `ach`.
type TestHelpersTreasuryReceivedCreditNetworkDetailsAchParams struct {
// ACH Addenda record
Addenda *string `form:"addenda"`
}

// Details about the network used for the ReceivedCredit.
type TestHelpersTreasuryReceivedCreditNetworkDetailsParams struct {
// Optional fields for `ach`.
Ach *TestHelpersTreasuryReceivedCreditNetworkDetailsAchParams `form:"ach"`
// The type of flow that originated the ReceivedCredit.
Type *string `form:"type"`
}

// Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties.
type TestHelpersTreasuryReceivedCreditParams struct {
Params `form:"*"`
Expand All @@ -39,4 +53,6 @@ type TestHelpersTreasuryReceivedCreditParams struct {
InitiatingPaymentMethodDetails *TestHelpersTreasuryReceivedCreditInitiatingPaymentMethodDetailsParams `form:"initiating_payment_method_details"`
// The rails used for the object.
Network *string `form:"network"`
// Details about the network used for the ReceivedCredit.
NetworkDetails *TestHelpersTreasuryReceivedCreditNetworkDetailsParams `form:"network_details"`
}
16 changes: 16 additions & 0 deletions testhelperstreasury_receiveddebit.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ type TestHelpersTreasuryReceivedDebitInitiatingPaymentMethodDetailsParams struct
USBankAccount *TestHelpersTreasuryReceivedDebitInitiatingPaymentMethodDetailsUSBankAccountParams `form:"us_bank_account"`
}

// Optional fields for `ach`.
type TestHelpersTreasuryReceivedDebitNetworkDetailsAchParams struct {
// Addenda record data associated with this ReceivedDebit.
Addenda *string `form:"addenda"`
}

// Details about the network used for the ReceivedDebit.
type TestHelpersTreasuryReceivedDebitNetworkDetailsParams struct {
// Optional fields for `ach`.
Ach *TestHelpersTreasuryReceivedDebitNetworkDetailsAchParams `form:"ach"`
// The type of flow that originated the ReceivedDebit.
Type *string `form:"type"`
}

// Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties.
type TestHelpersTreasuryReceivedDebitParams struct {
Params `form:"*"`
Expand All @@ -39,4 +53,6 @@ type TestHelpersTreasuryReceivedDebitParams struct {
InitiatingPaymentMethodDetails *TestHelpersTreasuryReceivedDebitInitiatingPaymentMethodDetailsParams `form:"initiating_payment_method_details"`
// The rails used for the object.
Network *string `form:"network"`
// Details about the network used for the ReceivedDebit.
NetworkDetails *TestHelpersTreasuryReceivedDebitNetworkDetailsParams `form:"network_details"`
}
40 changes: 40 additions & 0 deletions treasury_outboundtransfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ const (
TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetworkUSDomesticWire TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccountNetwork = "us_domestic_wire"
)

// The type of flow that originated the OutboundTransfer.
type TreasuryOutboundTransferNetworkDetailsType string

// List of values that TreasuryOutboundTransferNetworkDetailsType can take
const (
TreasuryOutboundTransferNetworkDetailsTypeAch TreasuryOutboundTransferNetworkDetailsType = "ach"
)

// Reason for the return.
type TreasuryOutboundTransferReturnedDetailsCode string

Expand Down Expand Up @@ -82,6 +90,20 @@ type TreasuryOutboundTransferDestinationPaymentMethodOptionsParams struct {
USBankAccount *TreasuryOutboundTransferDestinationPaymentMethodOptionsUSBankAccountParams `form:"us_bank_account"`
}

// Optional fields for `ach`.
type TreasuryOutboundTransferNetworkDetailsAchParams struct {
// Addenda record data associated with this OutboundTransfer.
Addenda *string `form:"addenda"`
}

// Details about the network used for the OutboundTransfer.
type TreasuryOutboundTransferNetworkDetailsParams struct {
// Optional fields for `ach`.
Ach *TreasuryOutboundTransferNetworkDetailsAchParams `form:"ach"`
// The type of flow that originated the OutboundTransfer.
Type *string `form:"type"`
}

// Creates an OutboundTransfer.
type TreasuryOutboundTransferParams struct {
Params `form:"*"`
Expand All @@ -97,6 +119,8 @@ type TreasuryOutboundTransferParams struct {
DestinationPaymentMethodOptions *TreasuryOutboundTransferDestinationPaymentMethodOptionsParams `form:"destination_payment_method_options"`
// The FinancialAccount to pull funds from.
FinancialAccount *string `form:"financial_account"`
// Details about the network used for the OutboundTransfer.
NetworkDetails *TreasuryOutboundTransferNetworkDetailsParams `form:"network_details"`
// Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `wire` transfers. The default value is `transfer`.
StatementDescriptor *string `form:"statement_descriptor"`
}
Expand Down Expand Up @@ -144,6 +168,20 @@ type TreasuryOutboundTransferDestinationPaymentMethodDetails struct {
USBankAccount *TreasuryOutboundTransferDestinationPaymentMethodDetailsUSBankAccount `json:"us_bank_account"`
}

// Details about an ACH transaction.
type TreasuryOutboundTransferNetworkDetailsAch struct {
// ACH Addenda record
Addenda string `json:"addenda"`
}

// Details about the network used for the OutboundTransfer.
type TreasuryOutboundTransferNetworkDetails struct {
// Details about an ACH transaction.
Ach *TreasuryOutboundTransferNetworkDetailsAch `json:"ach"`
// The type of flow that originated the OutboundTransfer.
Type TreasuryOutboundTransferNetworkDetailsType `json:"type"`
}

// Details about a returned OutboundTransfer. Only set when the status is `returned`.
type TreasuryOutboundTransferReturnedDetails struct {
// Reason for the return.
Expand Down Expand Up @@ -192,6 +230,8 @@ type TreasuryOutboundTransfer struct {
Livemode bool `json:"livemode"`
// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
Metadata map[string]string `json:"metadata"`
// Details about the network used for the OutboundTransfer.
NetworkDetails *TreasuryOutboundTransferNetworkDetails `json:"network_details"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
// Details about a returned OutboundTransfer. Only set when the status is `returned`.
Expand Down
24 changes: 24 additions & 0 deletions treasury_receivedcredit.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ const (
TreasuryReceivedCreditNetworkUSDomesticWire TreasuryReceivedCreditNetwork = "us_domestic_wire"
)

// The type of flow that originated the ReceivedCredit.
type TreasuryReceivedCreditNetworkDetailsType string

// List of values that TreasuryReceivedCreditNetworkDetailsType can take
const (
TreasuryReceivedCreditNetworkDetailsTypeAch TreasuryReceivedCreditNetworkDetailsType = "ach"
)

// Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field.
type TreasuryReceivedCreditStatus string

Expand Down Expand Up @@ -164,6 +172,20 @@ type TreasuryReceivedCreditLinkedFlows struct {
SourceFlowType string `json:"source_flow_type"`
}

// Details about an ACH transaction.
type TreasuryReceivedCreditNetworkDetailsAch struct {
// ACH Addenda record
Addenda string `json:"addenda"`
}

// Details specific to the money movement rails.
type TreasuryReceivedCreditNetworkDetails struct {
// Details about an ACH transaction.
Ach *TreasuryReceivedCreditNetworkDetailsAch `json:"ach"`
// The type of flow that originated the ReceivedCredit.
Type TreasuryReceivedCreditNetworkDetailsType `json:"type"`
}

// ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount.
type TreasuryReceivedCredit struct {
APIResource
Expand All @@ -187,6 +209,8 @@ type TreasuryReceivedCredit struct {
Livemode bool `json:"livemode"`
// The rails used to send the funds.
Network TreasuryReceivedCreditNetwork `json:"network"`
// Details specific to the money movement rails.
NetworkDetails *TreasuryReceivedCreditNetworkDetails `json:"network_details"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
// Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field.
Expand Down
26 changes: 26 additions & 0 deletions treasury_receiveddebit.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ const (
TreasuryReceivedDebitNetworkStripe TreasuryReceivedDebitNetwork = "stripe"
)

// The type of flow that originated the ReceivedDebit.
type TreasuryReceivedDebitNetworkDetailsType string

// List of values that TreasuryReceivedDebitNetworkDetailsType can take
const (
TreasuryReceivedDebitNetworkDetailsTypeAch TreasuryReceivedDebitNetworkDetailsType = "ach"
)

// Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`.
type TreasuryReceivedDebitStatus string

Expand Down Expand Up @@ -116,6 +124,22 @@ type TreasuryReceivedDebitLinkedFlows struct {
IssuingAuthorization string `json:"issuing_authorization"`
// Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object.
IssuingTransaction string `json:"issuing_transaction"`
// The ReceivedCredit that Capital withheld from
ReceivedCreditCapitalWithholding string `json:"received_credit_capital_withholding"`
}

// Details about an ACH transaction.
type TreasuryReceivedDebitNetworkDetailsAch struct {
// ACH Addenda record
Addenda string `json:"addenda"`
}

// Details specific to the money movement rails.
type TreasuryReceivedDebitNetworkDetails struct {
// Details about an ACH transaction.
Ach *TreasuryReceivedDebitNetworkDetailsAch `json:"ach"`
// The type of flow that originated the ReceivedDebit.
Type TreasuryReceivedDebitNetworkDetailsType `json:"type"`
}

// ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount.
Expand All @@ -141,6 +165,8 @@ type TreasuryReceivedDebit struct {
Livemode bool `json:"livemode"`
// The network used for the ReceivedDebit.
Network TreasuryReceivedDebitNetwork `json:"network"`
// Details specific to the money movement rails.
NetworkDetails *TreasuryReceivedDebitNetworkDetails `json:"network_details"`
// String representing the object's type. Objects of the same type share the same value.
Object string `json:"object"`
// Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`.
Expand Down