github.com/stripe/stripe-go/v76@v76.25.0/treasury_inboundtransfer.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // Reason for the failure. 10 type TreasuryInboundTransferFailureDetailsCode string 11 12 // List of values that TreasuryInboundTransferFailureDetailsCode can take 13 const ( 14 TreasuryInboundTransferFailureDetailsCodeAccountClosed TreasuryInboundTransferFailureDetailsCode = "account_closed" 15 TreasuryInboundTransferFailureDetailsCodeAccountFrozen TreasuryInboundTransferFailureDetailsCode = "account_frozen" 16 TreasuryInboundTransferFailureDetailsCodeBankAccountRestricted TreasuryInboundTransferFailureDetailsCode = "bank_account_restricted" 17 TreasuryInboundTransferFailureDetailsCodeBankOwnershipChanged TreasuryInboundTransferFailureDetailsCode = "bank_ownership_changed" 18 TreasuryInboundTransferFailureDetailsCodeDebitNotAuthorized TreasuryInboundTransferFailureDetailsCode = "debit_not_authorized" 19 TreasuryInboundTransferFailureDetailsCodeIncorrectAccountHolderAddress TreasuryInboundTransferFailureDetailsCode = "incorrect_account_holder_address" 20 TreasuryInboundTransferFailureDetailsCodeIncorrectAccountHolderName TreasuryInboundTransferFailureDetailsCode = "incorrect_account_holder_name" 21 TreasuryInboundTransferFailureDetailsCodeIncorrectAccountHolderTaxID TreasuryInboundTransferFailureDetailsCode = "incorrect_account_holder_tax_id" 22 TreasuryInboundTransferFailureDetailsCodeInsufficientFunds TreasuryInboundTransferFailureDetailsCode = "insufficient_funds" 23 TreasuryInboundTransferFailureDetailsCodeInvalidAccountNumber TreasuryInboundTransferFailureDetailsCode = "invalid_account_number" 24 TreasuryInboundTransferFailureDetailsCodeInvalidCurrency TreasuryInboundTransferFailureDetailsCode = "invalid_currency" 25 TreasuryInboundTransferFailureDetailsCodeNoAccount TreasuryInboundTransferFailureDetailsCode = "no_account" 26 TreasuryInboundTransferFailureDetailsCodeOther TreasuryInboundTransferFailureDetailsCode = "other" 27 ) 28 29 // The type of the payment method used in the InboundTransfer. 30 type TreasuryInboundTransferOriginPaymentMethodDetailsType string 31 32 // List of values that TreasuryInboundTransferOriginPaymentMethodDetailsType can take 33 const ( 34 TreasuryInboundTransferOriginPaymentMethodDetailsTypeUSBankAccount TreasuryInboundTransferOriginPaymentMethodDetailsType = "us_bank_account" 35 ) 36 37 // Account holder type: individual or company. 38 type TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountHolderType string 39 40 // List of values that TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountHolderType can take 41 const ( 42 TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountHolderTypeCompany TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountHolderType = "company" 43 TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountHolderTypeIndividual TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountHolderType = "individual" 44 ) 45 46 // Account type: checkings or savings. Defaults to checking if omitted. 47 type TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountType string 48 49 // List of values that TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountType can take 50 const ( 51 TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountTypeChecking TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountType = "checking" 52 TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountTypeSavings TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountType = "savings" 53 ) 54 55 // The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. 56 type TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountNetwork string 57 58 // List of values that TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountNetwork can take 59 const ( 60 TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountNetworkACH TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountNetwork = "ach" 61 ) 62 63 // Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. An InboundTransfer is `processing` if it is created and pending. The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. The status changes to `failed` if the transfer fails. 64 type TreasuryInboundTransferStatus string 65 66 // List of values that TreasuryInboundTransferStatus can take 67 const ( 68 TreasuryInboundTransferStatusCanceled TreasuryInboundTransferStatus = "canceled" 69 TreasuryInboundTransferStatusFailed TreasuryInboundTransferStatus = "failed" 70 TreasuryInboundTransferStatusProcessing TreasuryInboundTransferStatus = "processing" 71 TreasuryInboundTransferStatusSucceeded TreasuryInboundTransferStatus = "succeeded" 72 ) 73 74 // Returns a list of InboundTransfers sent from the specified FinancialAccount. 75 type TreasuryInboundTransferListParams struct { 76 ListParams `form:"*"` 77 // Specifies which fields in the response should be expanded. 78 Expand []*string `form:"expand"` 79 // Returns objects associated with this FinancialAccount. 80 FinancialAccount *string `form:"financial_account"` 81 // Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. 82 Status *string `form:"status"` 83 } 84 85 // AddExpand appends a new field to expand. 86 func (p *TreasuryInboundTransferListParams) AddExpand(f string) { 87 p.Expand = append(p.Expand, &f) 88 } 89 90 // Creates an InboundTransfer. 91 type TreasuryInboundTransferParams struct { 92 Params `form:"*"` 93 // Amount (in cents) to be transferred. 94 Amount *int64 `form:"amount"` 95 // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). 96 Currency *string `form:"currency"` 97 // An arbitrary string attached to the object. Often useful for displaying to users. 98 Description *string `form:"description"` 99 // Specifies which fields in the response should be expanded. 100 Expand []*string `form:"expand"` 101 // The FinancialAccount to send funds to. 102 FinancialAccount *string `form:"financial_account"` 103 // 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. 104 Metadata map[string]string `form:"metadata"` 105 // The origin payment method to be debited for the InboundTransfer. 106 OriginPaymentMethod *string `form:"origin_payment_method"` 107 // The complete description that appears on your customers' statements. Maximum 10 characters. 108 StatementDescriptor *string `form:"statement_descriptor"` 109 } 110 111 // AddExpand appends a new field to expand. 112 func (p *TreasuryInboundTransferParams) AddExpand(f string) { 113 p.Expand = append(p.Expand, &f) 114 } 115 116 // AddMetadata adds a new key-value pair to the Metadata. 117 func (p *TreasuryInboundTransferParams) AddMetadata(key string, value string) { 118 if p.Metadata == nil { 119 p.Metadata = make(map[string]string) 120 } 121 122 p.Metadata[key] = value 123 } 124 125 // Cancels an InboundTransfer. 126 type TreasuryInboundTransferCancelParams struct { 127 Params `form:"*"` 128 // Specifies which fields in the response should be expanded. 129 Expand []*string `form:"expand"` 130 } 131 132 // AddExpand appends a new field to expand. 133 func (p *TreasuryInboundTransferCancelParams) AddExpand(f string) { 134 p.Expand = append(p.Expand, &f) 135 } 136 137 // Details about this InboundTransfer's failure. Only set when status is `failed`. 138 type TreasuryInboundTransferFailureDetails struct { 139 // Reason for the failure. 140 Code TreasuryInboundTransferFailureDetailsCode `json:"code"` 141 } 142 type TreasuryInboundTransferLinkedFlows struct { 143 // If funds for this flow were returned after the flow went to the `succeeded` state, this field contains a reference to the ReceivedDebit return. 144 ReceivedDebit string `json:"received_debit"` 145 } 146 type TreasuryInboundTransferOriginPaymentMethodDetailsBillingDetails struct { 147 Address *Address `json:"address"` 148 // Email address. 149 Email string `json:"email"` 150 // Full name. 151 Name string `json:"name"` 152 } 153 type TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccount struct { 154 // Account holder type: individual or company. 155 AccountHolderType TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountHolderType `json:"account_holder_type"` 156 // Account type: checkings or savings. Defaults to checking if omitted. 157 AccountType TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountAccountType `json:"account_type"` 158 // Name of the bank associated with the bank account. 159 BankName string `json:"bank_name"` 160 // Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. 161 Fingerprint string `json:"fingerprint"` 162 // Last four digits of the bank account number. 163 Last4 string `json:"last4"` 164 // ID of the mandate used to make this payment. 165 Mandate *Mandate `json:"mandate"` 166 // The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. 167 Network TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccountNetwork `json:"network"` 168 // Routing number of the bank account. 169 RoutingNumber string `json:"routing_number"` 170 } 171 172 // Details about the PaymentMethod for an InboundTransfer. 173 type TreasuryInboundTransferOriginPaymentMethodDetails struct { 174 BillingDetails *TreasuryInboundTransferOriginPaymentMethodDetailsBillingDetails `json:"billing_details"` 175 // The type of the payment method used in the InboundTransfer. 176 Type TreasuryInboundTransferOriginPaymentMethodDetailsType `json:"type"` 177 USBankAccount *TreasuryInboundTransferOriginPaymentMethodDetailsUSBankAccount `json:"us_bank_account"` 178 } 179 type TreasuryInboundTransferStatusTransitions struct { 180 // Timestamp describing when an InboundTransfer changed status to `canceled`. 181 CanceledAt int64 `json:"canceled_at"` 182 // Timestamp describing when an InboundTransfer changed status to `failed`. 183 FailedAt int64 `json:"failed_at"` 184 // Timestamp describing when an InboundTransfer changed status to `succeeded`. 185 SucceededAt int64 `json:"succeeded_at"` 186 } 187 188 // Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. 189 type TreasuryInboundTransfer struct { 190 APIResource 191 // Amount (in cents) transferred. 192 Amount int64 `json:"amount"` 193 // Returns `true` if the InboundTransfer is able to be canceled. 194 Cancelable bool `json:"cancelable"` 195 // Time at which the object was created. Measured in seconds since the Unix epoch. 196 Created int64 `json:"created"` 197 // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). 198 Currency Currency `json:"currency"` 199 // An arbitrary string attached to the object. Often useful for displaying to users. 200 Description string `json:"description"` 201 // Details about this InboundTransfer's failure. Only set when status is `failed`. 202 FailureDetails *TreasuryInboundTransferFailureDetails `json:"failure_details"` 203 // The FinancialAccount that received the funds. 204 FinancialAccount string `json:"financial_account"` 205 // A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. 206 HostedRegulatoryReceiptURL string `json:"hosted_regulatory_receipt_url"` 207 // Unique identifier for the object. 208 ID string `json:"id"` 209 LinkedFlows *TreasuryInboundTransferLinkedFlows `json:"linked_flows"` 210 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 211 Livemode bool `json:"livemode"` 212 // 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. 213 Metadata map[string]string `json:"metadata"` 214 // String representing the object's type. Objects of the same type share the same value. 215 Object string `json:"object"` 216 // The origin payment method to be debited for an InboundTransfer. 217 OriginPaymentMethod string `json:"origin_payment_method"` 218 // Details about the PaymentMethod for an InboundTransfer. 219 OriginPaymentMethodDetails *TreasuryInboundTransferOriginPaymentMethodDetails `json:"origin_payment_method_details"` 220 // Returns `true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state. 221 Returned bool `json:"returned"` 222 // Statement descriptor shown when funds are debited from the source. Not all payment networks support `statement_descriptor`. 223 StatementDescriptor string `json:"statement_descriptor"` 224 // Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. An InboundTransfer is `processing` if it is created and pending. The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. The status changes to `failed` if the transfer fails. 225 Status TreasuryInboundTransferStatus `json:"status"` 226 StatusTransitions *TreasuryInboundTransferStatusTransitions `json:"status_transitions"` 227 // The Transaction associated with this object. 228 Transaction *TreasuryTransaction `json:"transaction"` 229 } 230 231 // TreasuryInboundTransferList is a list of InboundTransfers as retrieved from a list endpoint. 232 type TreasuryInboundTransferList struct { 233 APIResource 234 ListMeta 235 Data []*TreasuryInboundTransfer `json:"data"` 236 }