github.com/stripe/stripe-go/v76@v76.25.0/treasury_receiveddebit.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. 10 type TreasuryReceivedDebitFailureCode string 11 12 // List of values that TreasuryReceivedDebitFailureCode can take 13 const ( 14 TreasuryReceivedDebitFailureCodeAccountClosed TreasuryReceivedDebitFailureCode = "account_closed" 15 TreasuryReceivedDebitFailureCodeAccountFrozen TreasuryReceivedDebitFailureCode = "account_frozen" 16 TreasuryReceivedDebitFailureCodeInsufficientFunds TreasuryReceivedDebitFailureCode = "insufficient_funds" 17 TreasuryReceivedDebitFailureCodeOther TreasuryReceivedDebitFailureCode = "other" 18 ) 19 20 // Set when `type` is `balance`. 21 type TreasuryReceivedDebitInitiatingPaymentMethodDetailsBalance string 22 23 // List of values that TreasuryReceivedDebitInitiatingPaymentMethodDetailsBalance can take 24 const ( 25 TreasuryReceivedDebitInitiatingPaymentMethodDetailsBalancePayments TreasuryReceivedDebitInitiatingPaymentMethodDetailsBalance = "payments" 26 ) 27 28 // The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. 29 type TreasuryReceivedDebitInitiatingPaymentMethodDetailsFinancialAccountNetwork string 30 31 // List of values that TreasuryReceivedDebitInitiatingPaymentMethodDetailsFinancialAccountNetwork can take 32 const ( 33 TreasuryReceivedDebitInitiatingPaymentMethodDetailsFinancialAccountNetworkStripe TreasuryReceivedDebitInitiatingPaymentMethodDetailsFinancialAccountNetwork = "stripe" 34 ) 35 36 // Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. 37 type TreasuryReceivedDebitInitiatingPaymentMethodDetailsType string 38 39 // List of values that TreasuryReceivedDebitInitiatingPaymentMethodDetailsType can take 40 const ( 41 TreasuryReceivedDebitInitiatingPaymentMethodDetailsTypeBalance TreasuryReceivedDebitInitiatingPaymentMethodDetailsType = "balance" 42 TreasuryReceivedDebitInitiatingPaymentMethodDetailsTypeFinancialAccount TreasuryReceivedDebitInitiatingPaymentMethodDetailsType = "financial_account" 43 TreasuryReceivedDebitInitiatingPaymentMethodDetailsTypeIssuingCard TreasuryReceivedDebitInitiatingPaymentMethodDetailsType = "issuing_card" 44 TreasuryReceivedDebitInitiatingPaymentMethodDetailsTypeStripe TreasuryReceivedDebitInitiatingPaymentMethodDetailsType = "stripe" 45 TreasuryReceivedDebitInitiatingPaymentMethodDetailsTypeUSBankAccount TreasuryReceivedDebitInitiatingPaymentMethodDetailsType = "us_bank_account" 46 ) 47 48 // The network used for the ReceivedDebit. 49 type TreasuryReceivedDebitNetwork string 50 51 // List of values that TreasuryReceivedDebitNetwork can take 52 const ( 53 TreasuryReceivedDebitNetworkACH TreasuryReceivedDebitNetwork = "ach" 54 TreasuryReceivedDebitNetworkCard TreasuryReceivedDebitNetwork = "card" 55 TreasuryReceivedDebitNetworkStripe TreasuryReceivedDebitNetwork = "stripe" 56 ) 57 58 // Set if a ReceivedDebit can't be reversed. 59 type TreasuryReceivedDebitReversalDetailsRestrictedReason string 60 61 // List of values that TreasuryReceivedDebitReversalDetailsRestrictedReason can take 62 const ( 63 TreasuryReceivedDebitReversalDetailsRestrictedReasonAlreadyReversed TreasuryReceivedDebitReversalDetailsRestrictedReason = "already_reversed" 64 TreasuryReceivedDebitReversalDetailsRestrictedReasonDeadlinePassed TreasuryReceivedDebitReversalDetailsRestrictedReason = "deadline_passed" 65 TreasuryReceivedDebitReversalDetailsRestrictedReasonNetworkRestricted TreasuryReceivedDebitReversalDetailsRestrictedReason = "network_restricted" 66 TreasuryReceivedDebitReversalDetailsRestrictedReasonOther TreasuryReceivedDebitReversalDetailsRestrictedReason = "other" 67 TreasuryReceivedDebitReversalDetailsRestrictedReasonSourceFlowRestricted TreasuryReceivedDebitReversalDetailsRestrictedReason = "source_flow_restricted" 68 ) 69 70 // 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`. 71 type TreasuryReceivedDebitStatus string 72 73 // List of values that TreasuryReceivedDebitStatus can take 74 const ( 75 TreasuryReceivedDebitStatusFailed TreasuryReceivedDebitStatus = "failed" 76 TreasuryReceivedDebitStatusSucceeded TreasuryReceivedDebitStatus = "succeeded" 77 ) 78 79 // Returns a list of ReceivedDebits. 80 type TreasuryReceivedDebitListParams struct { 81 ListParams `form:"*"` 82 // Specifies which fields in the response should be expanded. 83 Expand []*string `form:"expand"` 84 // The FinancialAccount that funds were pulled from. 85 FinancialAccount *string `form:"financial_account"` 86 // Only return ReceivedDebits that have the given status: `succeeded` or `failed`. 87 Status *string `form:"status"` 88 } 89 90 // AddExpand appends a new field to expand. 91 func (p *TreasuryReceivedDebitListParams) AddExpand(f string) { 92 p.Expand = append(p.Expand, &f) 93 } 94 95 // Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list 96 type TreasuryReceivedDebitParams struct { 97 Params `form:"*"` 98 // Specifies which fields in the response should be expanded. 99 Expand []*string `form:"expand"` 100 } 101 102 // AddExpand appends a new field to expand. 103 func (p *TreasuryReceivedDebitParams) AddExpand(f string) { 104 p.Expand = append(p.Expand, &f) 105 } 106 107 type TreasuryReceivedDebitInitiatingPaymentMethodDetailsBillingDetails struct { 108 Address *Address `json:"address"` 109 // Email address. 110 Email string `json:"email"` 111 // Full name. 112 Name string `json:"name"` 113 } 114 type TreasuryReceivedDebitInitiatingPaymentMethodDetailsFinancialAccount struct { 115 // The FinancialAccount ID. 116 ID string `json:"id"` 117 // The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. 118 Network TreasuryReceivedDebitInitiatingPaymentMethodDetailsFinancialAccountNetwork `json:"network"` 119 } 120 type TreasuryReceivedDebitInitiatingPaymentMethodDetailsUSBankAccount struct { 121 // Bank name. 122 BankName string `json:"bank_name"` 123 // The last four digits of the bank account number. 124 Last4 string `json:"last4"` 125 // The routing number for the bank account. 126 RoutingNumber string `json:"routing_number"` 127 } 128 type TreasuryReceivedDebitInitiatingPaymentMethodDetails struct { 129 // Set when `type` is `balance`. 130 Balance TreasuryReceivedDebitInitiatingPaymentMethodDetailsBalance `json:"balance"` 131 BillingDetails *TreasuryReceivedDebitInitiatingPaymentMethodDetailsBillingDetails `json:"billing_details"` 132 FinancialAccount *TreasuryReceivedDebitInitiatingPaymentMethodDetailsFinancialAccount `json:"financial_account"` 133 // Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. 134 IssuingCard string `json:"issuing_card"` 135 // Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. 136 Type TreasuryReceivedDebitInitiatingPaymentMethodDetailsType `json:"type"` 137 USBankAccount *TreasuryReceivedDebitInitiatingPaymentMethodDetailsUSBankAccount `json:"us_bank_account"` 138 } 139 type TreasuryReceivedDebitLinkedFlows struct { 140 // The DebitReversal created as a result of this ReceivedDebit being reversed. 141 DebitReversal string `json:"debit_reversal"` 142 // Set if the ReceivedDebit is associated with an InboundTransfer's return of funds. 143 InboundTransfer string `json:"inbound_transfer"` 144 // Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. 145 IssuingAuthorization string `json:"issuing_authorization"` 146 // Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. 147 IssuingTransaction string `json:"issuing_transaction"` 148 // Set if the ReceivedDebit was created due to a [Payout](https://stripe.com/docs/api#payouts) object. 149 Payout string `json:"payout"` 150 } 151 152 // Details describing when a ReceivedDebit might be reversed. 153 type TreasuryReceivedDebitReversalDetails struct { 154 // Time before which a ReceivedDebit can be reversed. 155 Deadline int64 `json:"deadline"` 156 // Set if a ReceivedDebit can't be reversed. 157 RestrictedReason TreasuryReceivedDebitReversalDetailsRestrictedReason `json:"restricted_reason"` 158 } 159 160 // ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. 161 type TreasuryReceivedDebit struct { 162 APIResource 163 // Amount (in cents) transferred. 164 Amount int64 `json:"amount"` 165 // Time at which the object was created. Measured in seconds since the Unix epoch. 166 Created int64 `json:"created"` 167 // 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). 168 Currency Currency `json:"currency"` 169 // An arbitrary string attached to the object. Often useful for displaying to users. 170 Description string `json:"description"` 171 // Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. 172 FailureCode TreasuryReceivedDebitFailureCode `json:"failure_code"` 173 // The FinancialAccount that funds were pulled from. 174 FinancialAccount string `json:"financial_account"` 175 // 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. 176 HostedRegulatoryReceiptURL string `json:"hosted_regulatory_receipt_url"` 177 // Unique identifier for the object. 178 ID string `json:"id"` 179 InitiatingPaymentMethodDetails *TreasuryReceivedDebitInitiatingPaymentMethodDetails `json:"initiating_payment_method_details"` 180 LinkedFlows *TreasuryReceivedDebitLinkedFlows `json:"linked_flows"` 181 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 182 Livemode bool `json:"livemode"` 183 // The network used for the ReceivedDebit. 184 Network TreasuryReceivedDebitNetwork `json:"network"` 185 // String representing the object's type. Objects of the same type share the same value. 186 Object string `json:"object"` 187 // Details describing when a ReceivedDebit might be reversed. 188 ReversalDetails *TreasuryReceivedDebitReversalDetails `json:"reversal_details"` 189 // 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`. 190 Status TreasuryReceivedDebitStatus `json:"status"` 191 // The Transaction associated with this object. 192 Transaction *TreasuryTransaction `json:"transaction"` 193 } 194 195 // TreasuryReceivedDebitList is a list of ReceivedDebits as retrieved from a list endpoint. 196 type TreasuryReceivedDebitList struct { 197 APIResource 198 ListMeta 199 Data []*TreasuryReceivedDebit `json:"data"` 200 }