github.com/stripe/stripe-go/v76@v76.25.0/treasury_debitreversal.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // The rails used to reverse the funds. 10 type TreasuryDebitReversalNetwork string 11 12 // List of values that TreasuryDebitReversalNetwork can take 13 const ( 14 TreasuryDebitReversalNetworkACH TreasuryDebitReversalNetwork = "ach" 15 TreasuryDebitReversalNetworkCard TreasuryDebitReversalNetwork = "card" 16 ) 17 18 // Status of the DebitReversal 19 type TreasuryDebitReversalStatus string 20 21 // List of values that TreasuryDebitReversalStatus can take 22 const ( 23 TreasuryDebitReversalStatusFailed TreasuryDebitReversalStatus = "failed" 24 TreasuryDebitReversalStatusProcessing TreasuryDebitReversalStatus = "processing" 25 TreasuryDebitReversalStatusSucceeded TreasuryDebitReversalStatus = "succeeded" 26 ) 27 28 // Returns a list of DebitReversals. 29 type TreasuryDebitReversalListParams struct { 30 ListParams `form:"*"` 31 // Specifies which fields in the response should be expanded. 32 Expand []*string `form:"expand"` 33 // Returns objects associated with this FinancialAccount. 34 FinancialAccount *string `form:"financial_account"` 35 // Only return DebitReversals for the ReceivedDebit ID. 36 ReceivedDebit *string `form:"received_debit"` 37 // Only return DebitReversals for a given resolution. 38 Resolution *string `form:"resolution"` 39 // Only return DebitReversals for a given status. 40 Status *string `form:"status"` 41 } 42 43 // AddExpand appends a new field to expand. 44 func (p *TreasuryDebitReversalListParams) AddExpand(f string) { 45 p.Expand = append(p.Expand, &f) 46 } 47 48 // Reverses a ReceivedDebit and creates a DebitReversal object. 49 type TreasuryDebitReversalParams struct { 50 Params `form:"*"` 51 // Specifies which fields in the response should be expanded. 52 Expand []*string `form:"expand"` 53 // 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`. 54 Metadata map[string]string `form:"metadata"` 55 // The ReceivedDebit to reverse. 56 ReceivedDebit *string `form:"received_debit"` 57 } 58 59 // AddExpand appends a new field to expand. 60 func (p *TreasuryDebitReversalParams) AddExpand(f string) { 61 p.Expand = append(p.Expand, &f) 62 } 63 64 // AddMetadata adds a new key-value pair to the Metadata. 65 func (p *TreasuryDebitReversalParams) AddMetadata(key string, value string) { 66 if p.Metadata == nil { 67 p.Metadata = make(map[string]string) 68 } 69 70 p.Metadata[key] = value 71 } 72 73 // Other flows linked to a DebitReversal. 74 type TreasuryDebitReversalLinkedFlows struct { 75 // Set if there is an Issuing dispute associated with the DebitReversal. 76 IssuingDispute string `json:"issuing_dispute"` 77 } 78 type TreasuryDebitReversalStatusTransitions struct { 79 // Timestamp describing when the DebitReversal changed status to `completed`. 80 CompletedAt int64 `json:"completed_at"` 81 } 82 83 // You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. 84 type TreasuryDebitReversal struct { 85 APIResource 86 // Amount (in cents) transferred. 87 Amount int64 `json:"amount"` 88 // Time at which the object was created. Measured in seconds since the Unix epoch. 89 Created int64 `json:"created"` 90 // 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). 91 Currency Currency `json:"currency"` 92 // The FinancialAccount to reverse funds from. 93 FinancialAccount string `json:"financial_account"` 94 // 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. 95 HostedRegulatoryReceiptURL string `json:"hosted_regulatory_receipt_url"` 96 // Unique identifier for the object. 97 ID string `json:"id"` 98 // Other flows linked to a DebitReversal. 99 LinkedFlows *TreasuryDebitReversalLinkedFlows `json:"linked_flows"` 100 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 101 Livemode bool `json:"livemode"` 102 // 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. 103 Metadata map[string]string `json:"metadata"` 104 // The rails used to reverse the funds. 105 Network TreasuryDebitReversalNetwork `json:"network"` 106 // String representing the object's type. Objects of the same type share the same value. 107 Object string `json:"object"` 108 // The ReceivedDebit being reversed. 109 ReceivedDebit string `json:"received_debit"` 110 // Status of the DebitReversal 111 Status TreasuryDebitReversalStatus `json:"status"` 112 StatusTransitions *TreasuryDebitReversalStatusTransitions `json:"status_transitions"` 113 // The Transaction associated with this object. 114 Transaction *TreasuryTransaction `json:"transaction"` 115 } 116 117 // TreasuryDebitReversalList is a list of DebitReversals as retrieved from a list endpoint. 118 type TreasuryDebitReversalList struct { 119 APIResource 120 ListMeta 121 Data []*TreasuryDebitReversal `json:"data"` 122 }