• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-go / 11296113556

11 Oct 2024 04:42PM UTC coverage: 62.991% (-0.02%) from 63.015%
11296113556

Pull #1934

github

stripe-openapi[bot]
Update generated code for v1291
Pull Request #1934: Update generated code for beta

0 of 8 new or added lines in 2 files covered. (0.0%)

469 existing lines in 20 files now uncovered.

6209 of 9857 relevant lines covered (62.99%)

15.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/issuing_authorization.go
1
//
2
//
3
// File generated from our OpenAPI spec
4
//
5
//
6

7
package stripe
8

9
import "encoding/json"
10

11
// How the card details were provided.
12
type IssuingAuthorizationAuthorizationMethod string
13

14
// List of values that IssuingAuthorizationAuthorizationMethod can take
15
const (
16
        IssuingAuthorizationAuthorizationMethodChip        IssuingAuthorizationAuthorizationMethod = "chip"
17
        IssuingAuthorizationAuthorizationMethodContactless IssuingAuthorizationAuthorizationMethod = "contactless"
18
        IssuingAuthorizationAuthorizationMethodKeyedIn     IssuingAuthorizationAuthorizationMethod = "keyed_in"
19
        IssuingAuthorizationAuthorizationMethodOnline      IssuingAuthorizationAuthorizationMethod = "online"
20
        IssuingAuthorizationAuthorizationMethodSwipe       IssuingAuthorizationAuthorizationMethod = "swipe"
21
)
22

23
// The type of purchase.
24
type IssuingAuthorizationFleetPurchaseType string
25

26
// List of values that IssuingAuthorizationFleetPurchaseType can take
27
const (
28
        IssuingAuthorizationFleetPurchaseTypeFuelAndNonFuelPurchase IssuingAuthorizationFleetPurchaseType = "fuel_and_non_fuel_purchase"
29
        IssuingAuthorizationFleetPurchaseTypeFuelPurchase           IssuingAuthorizationFleetPurchaseType = "fuel_purchase"
30
        IssuingAuthorizationFleetPurchaseTypeNonFuelPurchase        IssuingAuthorizationFleetPurchaseType = "non_fuel_purchase"
31
)
32

33
// The type of fuel service.
34
type IssuingAuthorizationFleetServiceType string
35

36
// List of values that IssuingAuthorizationFleetServiceType can take
37
const (
38
        IssuingAuthorizationFleetServiceTypeFullService        IssuingAuthorizationFleetServiceType = "full_service"
39
        IssuingAuthorizationFleetServiceTypeNonFuelTransaction IssuingAuthorizationFleetServiceType = "non_fuel_transaction"
40
        IssuingAuthorizationFleetServiceTypeSelfService        IssuingAuthorizationFleetServiceType = "self_service"
41
)
42

43
// The type of fuel that was purchased.
44
type IssuingAuthorizationFuelType string
45

46
// List of values that IssuingAuthorizationFuelType can take
47
const (
48
        IssuingAuthorizationFuelTypeDiesel          IssuingAuthorizationFuelType = "diesel"
49
        IssuingAuthorizationFuelTypeOther           IssuingAuthorizationFuelType = "other"
50
        IssuingAuthorizationFuelTypeUnleadedPlus    IssuingAuthorizationFuelType = "unleaded_plus"
51
        IssuingAuthorizationFuelTypeUnleadedRegular IssuingAuthorizationFuelType = "unleaded_regular"
52
        IssuingAuthorizationFuelTypeUnleadedSuper   IssuingAuthorizationFuelType = "unleaded_super"
53
)
54

55
// The units for `quantity_decimal`.
56
type IssuingAuthorizationFuelUnit string
57

58
// List of values that IssuingAuthorizationFuelUnit can take
59
const (
60
        IssuingAuthorizationFuelUnitChargingMinute IssuingAuthorizationFuelUnit = "charging_minute"
61
        IssuingAuthorizationFuelUnitImperialGallon IssuingAuthorizationFuelUnit = "imperial_gallon"
62
        IssuingAuthorizationFuelUnitKilogram       IssuingAuthorizationFuelUnit = "kilogram"
63
        IssuingAuthorizationFuelUnitKilowattHour   IssuingAuthorizationFuelUnit = "kilowatt_hour"
64
        IssuingAuthorizationFuelUnitLiter          IssuingAuthorizationFuelUnit = "liter"
65
        IssuingAuthorizationFuelUnitOther          IssuingAuthorizationFuelUnit = "other"
66
        IssuingAuthorizationFuelUnitPound          IssuingAuthorizationFuelUnit = "pound"
67
        IssuingAuthorizationFuelUnitUSGallon       IssuingAuthorizationFuelUnit = "us_gallon"
68
)
69

70
// When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome.
71
type IssuingAuthorizationRequestHistoryReason string
72

73
// List of values that IssuingAuthorizationRequestHistoryReason can take
74
const (
75
        IssuingAuthorizationRequestHistoryReasonAccountDisabled                IssuingAuthorizationRequestHistoryReason = "account_disabled"
76
        IssuingAuthorizationRequestHistoryReasonCardActive                     IssuingAuthorizationRequestHistoryReason = "card_active"
77
        IssuingAuthorizationRequestHistoryReasonCardCanceled                   IssuingAuthorizationRequestHistoryReason = "card_canceled"
78
        IssuingAuthorizationRequestHistoryReasonCardExpired                    IssuingAuthorizationRequestHistoryReason = "card_expired"
79
        IssuingAuthorizationRequestHistoryReasonCardInactive                   IssuingAuthorizationRequestHistoryReason = "card_inactive"
80
        IssuingAuthorizationRequestHistoryReasonCardholderBlocked              IssuingAuthorizationRequestHistoryReason = "cardholder_blocked"
81
        IssuingAuthorizationRequestHistoryReasonCardholderInactive             IssuingAuthorizationRequestHistoryReason = "cardholder_inactive"
82
        IssuingAuthorizationRequestHistoryReasonCardholderVerificationRequired IssuingAuthorizationRequestHistoryReason = "cardholder_verification_required"
83
        IssuingAuthorizationRequestHistoryReasonInsecureAuthorizationMethod    IssuingAuthorizationRequestHistoryReason = "insecure_authorization_method"
84
        IssuingAuthorizationRequestHistoryReasonInsufficientFunds              IssuingAuthorizationRequestHistoryReason = "insufficient_funds"
85
        IssuingAuthorizationRequestHistoryReasonNotAllowed                     IssuingAuthorizationRequestHistoryReason = "not_allowed"
86
        IssuingAuthorizationRequestHistoryReasonPINBlocked                     IssuingAuthorizationRequestHistoryReason = "pin_blocked"
87
        IssuingAuthorizationRequestHistoryReasonSpendingControls               IssuingAuthorizationRequestHistoryReason = "spending_controls"
88
        IssuingAuthorizationRequestHistoryReasonSuspectedFraud                 IssuingAuthorizationRequestHistoryReason = "suspected_fraud"
89
        IssuingAuthorizationRequestHistoryReasonVerificationFailed             IssuingAuthorizationRequestHistoryReason = "verification_failed"
90
        IssuingAuthorizationRequestHistoryReasonWebhookApproved                IssuingAuthorizationRequestHistoryReason = "webhook_approved"
91
        IssuingAuthorizationRequestHistoryReasonWebhookDeclined                IssuingAuthorizationRequestHistoryReason = "webhook_declined"
92
        IssuingAuthorizationRequestHistoryReasonWebhookError                   IssuingAuthorizationRequestHistoryReason = "webhook_error"
93
        IssuingAuthorizationRequestHistoryReasonWebhookTimeout                 IssuingAuthorizationRequestHistoryReason = "webhook_timeout"
94
)
95

96
// The current status of the authorization in its lifecycle.
97
type IssuingAuthorizationStatus string
98

99
// List of values that IssuingAuthorizationStatus can take
100
const (
101
        IssuingAuthorizationStatusClosed   IssuingAuthorizationStatus = "closed"
102
        IssuingAuthorizationStatusExpired  IssuingAuthorizationStatus = "expired"
103
        IssuingAuthorizationStatusPending  IssuingAuthorizationStatus = "pending"
104
        IssuingAuthorizationStatusReversed IssuingAuthorizationStatus = "reversed"
105
)
106

107
// Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`.
108
type IssuingAuthorizationVerificationDataCheck string
109

110
// List of values that IssuingAuthorizationVerificationDataCheck can take
111
const (
112
        IssuingAuthorizationVerificationDataCheckMatch       IssuingAuthorizationVerificationDataCheck = "match"
113
        IssuingAuthorizationVerificationDataCheckMismatch    IssuingAuthorizationVerificationDataCheck = "mismatch"
114
        IssuingAuthorizationVerificationDataCheckNotProvided IssuingAuthorizationVerificationDataCheck = "not_provided"
115
)
116

117
// The entity that requested the exemption, either the acquiring merchant or the Issuing user.
118
type IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy string
119

120
// List of values that IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy can take
121
const (
122
        IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedByAcquirer IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy = "acquirer"
123
        IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedByIssuer   IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy = "issuer"
124
)
125

126
// The specific exemption claimed for this authorization.
127
type IssuingAuthorizationVerificationDataAuthenticationExemptionType string
128

129
// List of values that IssuingAuthorizationVerificationDataAuthenticationExemptionType can take
130
const (
131
        IssuingAuthorizationVerificationDataAuthenticationExemptionTypeLowValueTransaction     IssuingAuthorizationVerificationDataAuthenticationExemptionType = "low_value_transaction"
132
        IssuingAuthorizationVerificationDataAuthenticationExemptionTypeTransactionRiskAnalysis IssuingAuthorizationVerificationDataAuthenticationExemptionType = "transaction_risk_analysis"
133
        IssuingAuthorizationVerificationDataAuthenticationExemptionTypeUnknown                 IssuingAuthorizationVerificationDataAuthenticationExemptionType = "unknown"
134
)
135

136
// The outcome of the 3D Secure authentication request.
137
type IssuingAuthorizationVerificationDataThreeDSecureResult string
138

139
// List of values that IssuingAuthorizationVerificationDataThreeDSecureResult can take
140
const (
141
        IssuingAuthorizationVerificationDataThreeDSecureResultAttemptAcknowledged IssuingAuthorizationVerificationDataThreeDSecureResult = "attempt_acknowledged"
142
        IssuingAuthorizationVerificationDataThreeDSecureResultAuthenticated       IssuingAuthorizationVerificationDataThreeDSecureResult = "authenticated"
143
        IssuingAuthorizationVerificationDataThreeDSecureResultFailed              IssuingAuthorizationVerificationDataThreeDSecureResult = "failed"
144
        IssuingAuthorizationVerificationDataThreeDSecureResultRequired            IssuingAuthorizationVerificationDataThreeDSecureResult = "required"
145
)
146

147
// The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized.
148
type IssuingAuthorizationWallet string
149

150
// List of values that IssuingAuthorizationWallet can take
151
const (
152
        IssuingAuthorizationWalletApplePay   IssuingAuthorizationWallet = "apple_pay"
153
        IssuingAuthorizationWalletGooglePay  IssuingAuthorizationWallet = "google_pay"
154
        IssuingAuthorizationWalletSamsungPay IssuingAuthorizationWallet = "samsung_pay"
155
)
156

157
// Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
158
type IssuingAuthorizationListParams struct {
159
        ListParams `form:"*"`
160
        // Only return authorizations that belong to the given card.
161
        Card *string `form:"card"`
162
        // Only return authorizations that belong to the given cardholder.
163
        Cardholder *string `form:"cardholder"`
164
        // Only return authorizations that were created during the given date interval.
165
        Created *int64 `form:"created"`
166
        // Only return authorizations that were created during the given date interval.
167
        CreatedRange *RangeQueryParams `form:"created"`
168
        // Specifies which fields in the response should be expanded.
169
        Expand []*string `form:"expand"`
170
        // Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`.
171
        Status *string `form:"status"`
172
}
173

174
// AddExpand appends a new field to expand.
175
func (p *IssuingAuthorizationListParams) AddExpand(f string) {
×
176
        p.Expand = append(p.Expand, &f)
×
UNCOV
177
}
×
178

179
// Retrieves an Issuing Authorization object.
180
type IssuingAuthorizationParams struct {
181
        Params `form:"*"`
182
        // Specifies which fields in the response should be expanded.
183
        Expand []*string `form:"expand"`
184
        // 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`.
185
        Metadata map[string]string `form:"metadata"`
186
}
187

188
// AddExpand appends a new field to expand.
189
func (p *IssuingAuthorizationParams) AddExpand(f string) {
×
190
        p.Expand = append(p.Expand, &f)
×
UNCOV
191
}
×
192

193
// AddMetadata adds a new key-value pair to the Metadata.
194
func (p *IssuingAuthorizationParams) AddMetadata(key string, value string) {
×
195
        if p.Metadata == nil {
×
196
                p.Metadata = make(map[string]string)
×
UNCOV
197
        }
×
198

UNCOV
199
        p.Metadata[key] = value
×
200
}
201

202
// [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
203
// This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
204
type IssuingAuthorizationApproveParams struct {
205
        Params `form:"*"`
206
        // If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request).
207
        Amount *int64 `form:"amount"`
208
        // Specifies which fields in the response should be expanded.
209
        Expand []*string `form:"expand"`
210
        // 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`.
211
        Metadata map[string]string `form:"metadata"`
212
}
213

214
// AddExpand appends a new field to expand.
215
func (p *IssuingAuthorizationApproveParams) AddExpand(f string) {
×
216
        p.Expand = append(p.Expand, &f)
×
UNCOV
217
}
×
218

219
// AddMetadata adds a new key-value pair to the Metadata.
220
func (p *IssuingAuthorizationApproveParams) AddMetadata(key string, value string) {
×
221
        if p.Metadata == nil {
×
222
                p.Metadata = make(map[string]string)
×
UNCOV
223
        }
×
224

UNCOV
225
        p.Metadata[key] = value
×
226
}
227

228
// [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
229
// This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
230
type IssuingAuthorizationDeclineParams struct {
231
        Params `form:"*"`
232
        // Specifies which fields in the response should be expanded.
233
        Expand []*string `form:"expand"`
234
        // 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`.
235
        Metadata map[string]string `form:"metadata"`
236
}
237

238
// AddExpand appends a new field to expand.
239
func (p *IssuingAuthorizationDeclineParams) AddExpand(f string) {
×
240
        p.Expand = append(p.Expand, &f)
×
UNCOV
241
}
×
242

243
// AddMetadata adds a new key-value pair to the Metadata.
244
func (p *IssuingAuthorizationDeclineParams) AddMetadata(key string, value string) {
×
245
        if p.Metadata == nil {
×
246
                p.Metadata = make(map[string]string)
×
UNCOV
247
        }
×
248

UNCOV
249
        p.Metadata[key] = value
×
250
}
251

252
// Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
253
type IssuingAuthorizationAmountDetails struct {
254
        // The fee charged by the ATM for the cash withdrawal.
255
        ATMFee int64 `json:"atm_fee"`
256
        // The amount of cash requested by the cardholder.
257
        CashbackAmount int64 `json:"cashback_amount"`
258
}
259

260
// Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry.
261
type IssuingAuthorizationFleetCardholderPromptData struct {
262
        // [Deprecated] An alphanumeric ID, though typical point of sales only support numeric entry. The card program can be configured to prompt for a vehicle ID, driver ID, or generic ID.
263
        // Deprecated:
264
        AlphanumericID string `json:"alphanumeric_id"`
265
        // Driver ID.
266
        DriverID string `json:"driver_id"`
267
        // Odometer reading.
268
        Odometer int64 `json:"odometer"`
269
        // An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type.
270
        UnspecifiedID string `json:"unspecified_id"`
271
        // User ID.
272
        UserID string `json:"user_id"`
273
        // Vehicle number.
274
        VehicleNumber string `json:"vehicle_number"`
275
}
276

277
// Breakdown of fuel portion of the purchase.
278
type IssuingAuthorizationFleetReportedBreakdownFuel struct {
279
        // Gross fuel amount that should equal Fuel Quantity multiplied by Fuel Unit Cost, inclusive of taxes.
280
        GrossAmountDecimal float64 `json:"gross_amount_decimal,string"`
281
}
282

283
// Breakdown of non-fuel portion of the purchase.
284
type IssuingAuthorizationFleetReportedBreakdownNonFuel struct {
285
        // Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes.
286
        GrossAmountDecimal float64 `json:"gross_amount_decimal,string"`
287
}
288

289
// Information about tax included in this transaction.
290
type IssuingAuthorizationFleetReportedBreakdownTax struct {
291
        // Amount of state or provincial Sales Tax included in the transaction amount. `null` if not reported by merchant or not subject to tax.
292
        LocalAmountDecimal float64 `json:"local_amount_decimal,string"`
293
        // Amount of national Sales Tax or VAT included in the transaction amount. `null` if not reported by merchant or not subject to tax.
294
        NationalAmountDecimal float64 `json:"national_amount_decimal,string"`
295
}
296

297
// More information about the total amount. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. This information is not guaranteed to be accurate as some merchants may provide unreliable data.
298
type IssuingAuthorizationFleetReportedBreakdown struct {
299
        // Breakdown of fuel portion of the purchase.
300
        Fuel *IssuingAuthorizationFleetReportedBreakdownFuel `json:"fuel"`
301
        // Breakdown of non-fuel portion of the purchase.
302
        NonFuel *IssuingAuthorizationFleetReportedBreakdownNonFuel `json:"non_fuel"`
303
        // Information about tax included in this transaction.
304
        Tax *IssuingAuthorizationFleetReportedBreakdownTax `json:"tax"`
305
}
306

307
// Fleet-specific information for authorizations using Fleet cards.
308
type IssuingAuthorizationFleet struct {
309
        // Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry.
310
        CardholderPromptData *IssuingAuthorizationFleetCardholderPromptData `json:"cardholder_prompt_data"`
311
        // The type of purchase.
312
        PurchaseType IssuingAuthorizationFleetPurchaseType `json:"purchase_type"`
313
        // More information about the total amount. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. This information is not guaranteed to be accurate as some merchants may provide unreliable data.
314
        ReportedBreakdown *IssuingAuthorizationFleetReportedBreakdown `json:"reported_breakdown"`
315
        // The type of fuel service.
316
        ServiceType IssuingAuthorizationFleetServiceType `json:"service_type"`
317
}
318

319
// Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed.
320
type IssuingAuthorizationFuel struct {
321
        // [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased.
322
        IndustryProductCode string `json:"industry_product_code"`
323
        // The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places.
324
        QuantityDecimal float64 `json:"quantity_decimal,string"`
325
        // The type of fuel that was purchased.
326
        Type IssuingAuthorizationFuelType `json:"type"`
327
        // The units for `quantity_decimal`.
328
        Unit IssuingAuthorizationFuelUnit `json:"unit"`
329
        // The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places.
330
        UnitCostDecimal float64 `json:"unit_cost_decimal,string"`
331
}
332
type IssuingAuthorizationMerchantData struct {
333
        // A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values.
334
        Category string `json:"category"`
335
        // The merchant category code for the seller's business
336
        CategoryCode string `json:"category_code"`
337
        // City where the seller is located
338
        City string `json:"city"`
339
        // Country where the seller is located
340
        Country string `json:"country"`
341
        // Name of the seller
342
        Name string `json:"name"`
343
        // Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant.
344
        NetworkID string `json:"network_id"`
345
        // Postal code where the seller is located
346
        PostalCode string `json:"postal_code"`
347
        // State where the seller is located
348
        State string `json:"state"`
349
        // An ID assigned by the seller to the location of the sale.
350
        TerminalID string `json:"terminal_id"`
351
        // URL provided by the merchant on a 3DS request
352
        URL string `json:"url"`
353
}
354

355
// Details about the authorization, such as identifiers, set by the card network.
356
type IssuingAuthorizationNetworkData struct {
357
        // Identifier assigned to the acquirer by the card network. Sometimes this value is not provided by the network; in this case, the value will be `null`.
358
        AcquiringInstitutionID string `json:"acquiring_institution_id"`
359
        // The System Trace Audit Number (STAN) is a 6-digit identifier assigned by the acquirer. Prefer `network_data.transaction_id` if present, unless you have special requirements.
360
        SystemTraceAuditNumber string `json:"system_trace_audit_number"`
361
        // Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions.
362
        TransactionID string `json:"transaction_id"`
363
}
364

365
// The pending authorization request. This field will only be non-null during an `issuing_authorization.request` webhook.
366
type IssuingAuthorizationPendingRequest struct {
367
        // The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://stripe.com/docs/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
368
        Amount int64 `json:"amount"`
369
        // Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
370
        AmountDetails *IssuingAuthorizationAmountDetails `json:"amount_details"`
371
        // 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).
372
        Currency Currency `json:"currency"`
373
        // If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization.
374
        IsAmountControllable bool `json:"is_amount_controllable"`
375
        // The amount the merchant is requesting to be authorized in the `merchant_currency`. The amount is in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
376
        MerchantAmount int64 `json:"merchant_amount"`
377
        // The local currency the merchant is requesting to authorize.
378
        MerchantCurrency Currency `json:"merchant_currency"`
379
        // The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99.
380
        NetworkRiskScore int64 `json:"network_risk_score"`
381
}
382

383
// History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined.
384
type IssuingAuthorizationRequestHistory struct {
385
        // The `pending_request.amount` at the time of the request, presented in your card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Stripe held this amount from your account to fund the authorization if the request was approved.
386
        Amount int64 `json:"amount"`
387
        // Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
388
        AmountDetails *IssuingAuthorizationAmountDetails `json:"amount_details"`
389
        // Whether this request was approved.
390
        Approved bool `json:"approved"`
391
        // A code created by Stripe which is shared with the merchant to validate the authorization. This field will be populated if the authorization message was approved. The code typically starts with the letter "S", followed by a six-digit number. For example, "S498162". Please note that the code is not guaranteed to be unique across authorizations.
392
        AuthorizationCode string `json:"authorization_code"`
393
        // Time at which the object was created. Measured in seconds since the Unix epoch.
394
        Created int64 `json:"created"`
395
        // 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).
396
        Currency Currency `json:"currency"`
397
        // The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
398
        MerchantAmount int64 `json:"merchant_amount"`
399
        // The currency that was collected by the merchant and presented to the cardholder for the authorization. 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).
400
        MerchantCurrency Currency `json:"merchant_currency"`
401
        // The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99.
402
        NetworkRiskScore int64 `json:"network_risk_score"`
403
        // When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome.
404
        Reason IssuingAuthorizationRequestHistoryReason `json:"reason"`
405
        // If the `request_history.reason` is `webhook_error` because the direct webhook response is invalid (for example, parsing errors or missing parameters), we surface a more detailed error message via this field.
406
        ReasonMessage string `json:"reason_message"`
407
        // Time when the card network received an authorization request from the acquirer in UTC. Referred to by networks as transmission time.
408
        RequestedAt int64 `json:"requested_at"`
409
}
410

411
// [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts).
412
type IssuingAuthorizationTreasury struct {
413
        // The array of [ReceivedCredits](https://stripe.com/docs/api/treasury/received_credits) associated with this authorization
414
        ReceivedCredits []string `json:"received_credits"`
415
        // The array of [ReceivedDebits](https://stripe.com/docs/api/treasury/received_debits) associated with this authorization
416
        ReceivedDebits []string `json:"received_debits"`
417
        // The Treasury [Transaction](https://stripe.com/docs/api/treasury/transactions) associated with this authorization
418
        Transaction string `json:"transaction"`
419
}
420

421
// The exemption applied to this authorization.
422
type IssuingAuthorizationVerificationDataAuthenticationExemption struct {
423
        // The entity that requested the exemption, either the acquiring merchant or the Issuing user.
424
        ClaimedBy IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy `json:"claimed_by"`
425
        // The specific exemption claimed for this authorization.
426
        Type IssuingAuthorizationVerificationDataAuthenticationExemptionType `json:"type"`
427
}
428

429
// 3D Secure details.
430
type IssuingAuthorizationVerificationDataThreeDSecure struct {
431
        // The outcome of the 3D Secure authentication request.
432
        Result IssuingAuthorizationVerificationDataThreeDSecureResult `json:"result"`
433
}
434
type IssuingAuthorizationVerificationData struct {
435
        // Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`.
436
        AddressLine1Check IssuingAuthorizationVerificationDataCheck `json:"address_line1_check"`
437
        // Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`.
438
        AddressPostalCodeCheck IssuingAuthorizationVerificationDataCheck `json:"address_postal_code_check"`
439
        // The exemption applied to this authorization.
440
        AuthenticationExemption *IssuingAuthorizationVerificationDataAuthenticationExemption `json:"authentication_exemption"`
441
        // Whether the cardholder provided a CVC and if it matched Stripe's record.
442
        CVCCheck IssuingAuthorizationVerificationDataCheck `json:"cvc_check"`
443
        // Whether the cardholder provided an expiry date and if it matched Stripe's record.
444
        ExpiryCheck IssuingAuthorizationVerificationDataCheck `json:"expiry_check"`
445
        // The postal code submitted as part of the authorization used for postal code verification.
446
        PostalCode string `json:"postal_code"`
447
        // 3D Secure details.
448
        ThreeDSecure *IssuingAuthorizationVerificationDataThreeDSecure `json:"three_d_secure"`
449
}
450

451
// When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization`
452
// object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the
453
// purchase to be completed successfully.
454
//
455
// Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations)
456
type IssuingAuthorization struct {
457
        APIResource
458
        // The total amount that was authorized or rejected. This amount is in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `amount` should be the same as `merchant_amount`, unless `currency` and `merchant_currency` are different.
459
        Amount int64 `json:"amount"`
460
        // Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
461
        AmountDetails *IssuingAuthorizationAmountDetails `json:"amount_details"`
462
        // Whether the authorization has been approved.
463
        Approved bool `json:"approved"`
464
        // How the card details were provided.
465
        AuthorizationMethod IssuingAuthorizationAuthorizationMethod `json:"authorization_method"`
466
        // List of balance transactions associated with this authorization.
467
        BalanceTransactions []*BalanceTransaction `json:"balance_transactions"`
468
        // You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders.
469
        Card *IssuingCard `json:"card"`
470
        // The cardholder to whom this authorization belongs.
471
        Cardholder *IssuingCardholder `json:"cardholder"`
472
        // Time at which the object was created. Measured in seconds since the Unix epoch.
473
        Created int64 `json:"created"`
474
        // The currency of the cardholder. This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. 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).
475
        Currency Currency `json:"currency"`
476
        // Fleet-specific information for authorizations using Fleet cards.
477
        Fleet *IssuingAuthorizationFleet `json:"fleet"`
478
        // Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed.
479
        Fuel *IssuingAuthorizationFuel `json:"fuel"`
480
        // Unique identifier for the object.
481
        ID string `json:"id"`
482
        // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
483
        Livemode bool `json:"livemode"`
484
        // The total amount that was authorized or rejected. This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different.
485
        MerchantAmount int64 `json:"merchant_amount"`
486
        // The local currency that was presented to the cardholder for the authorization. This currency can be different from the cardholder currency and the `currency` field on this authorization. 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).
487
        MerchantCurrency Currency                          `json:"merchant_currency"`
488
        MerchantData     *IssuingAuthorizationMerchantData `json:"merchant_data"`
489
        // 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.
490
        Metadata map[string]string `json:"metadata"`
491
        // Details about the authorization, such as identifiers, set by the card network.
492
        NetworkData *IssuingAuthorizationNetworkData `json:"network_data"`
493
        // String representing the object's type. Objects of the same type share the same value.
494
        Object string `json:"object"`
495
        // The pending authorization request. This field will only be non-null during an `issuing_authorization.request` webhook.
496
        PendingRequest *IssuingAuthorizationPendingRequest `json:"pending_request"`
497
        // History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined.
498
        RequestHistory []*IssuingAuthorizationRequestHistory `json:"request_history"`
499
        // The current status of the authorization in its lifecycle.
500
        Status IssuingAuthorizationStatus `json:"status"`
501
        // [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this authorization. If a network token was not used for this authorization, this field will be null.
502
        Token *IssuingToken `json:"token"`
503
        // List of [transactions](https://stripe.com/docs/api/issuing/transactions) associated with this authorization.
504
        Transactions []*IssuingTransaction `json:"transactions"`
505
        // [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts).
506
        Treasury         *IssuingAuthorizationTreasury         `json:"treasury"`
507
        VerificationData *IssuingAuthorizationVerificationData `json:"verification_data"`
508
        // The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized.
509
        Wallet IssuingAuthorizationWallet `json:"wallet"`
510
}
511

512
// IssuingAuthorizationList is a list of Authorizations as retrieved from a list endpoint.
513
type IssuingAuthorizationList struct {
514
        APIResource
515
        ListMeta
516
        Data []*IssuingAuthorization `json:"data"`
517
}
518

519
// UnmarshalJSON handles deserialization of an IssuingAuthorization.
520
// This custom unmarshaling is needed because the resulting
521
// property may be an id or the full struct if it was expanded.
522
func (i *IssuingAuthorization) UnmarshalJSON(data []byte) error {
×
523
        if id, ok := ParseID(data); ok {
×
524
                i.ID = id
×
525
                return nil
×
UNCOV
526
        }
×
527

528
        type issuingAuthorization IssuingAuthorization
×
529
        var v issuingAuthorization
×
530
        if err := json.Unmarshal(data, &v); err != nil {
×
531
                return err
×
UNCOV
532
        }
×
533

534
        *i = IssuingAuthorization(v)
×
UNCOV
535
        return nil
×
536
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc