github.com/stripe/stripe-go/v76@v76.25.0/issuing_authorization.go (about)

     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  // When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome.
    24  type IssuingAuthorizationRequestHistoryReason string
    25  
    26  // List of values that IssuingAuthorizationRequestHistoryReason can take
    27  const (
    28  	IssuingAuthorizationRequestHistoryReasonAccountDisabled                IssuingAuthorizationRequestHistoryReason = "account_disabled"
    29  	IssuingAuthorizationRequestHistoryReasonCardActive                     IssuingAuthorizationRequestHistoryReason = "card_active"
    30  	IssuingAuthorizationRequestHistoryReasonCardInactive                   IssuingAuthorizationRequestHistoryReason = "card_inactive"
    31  	IssuingAuthorizationRequestHistoryReasonCardholderInactive             IssuingAuthorizationRequestHistoryReason = "cardholder_inactive"
    32  	IssuingAuthorizationRequestHistoryReasonCardholderVerificationRequired IssuingAuthorizationRequestHistoryReason = "cardholder_verification_required"
    33  	IssuingAuthorizationRequestHistoryReasonInsufficientFunds              IssuingAuthorizationRequestHistoryReason = "insufficient_funds"
    34  	IssuingAuthorizationRequestHistoryReasonNotAllowed                     IssuingAuthorizationRequestHistoryReason = "not_allowed"
    35  	IssuingAuthorizationRequestHistoryReasonSpendingControls               IssuingAuthorizationRequestHistoryReason = "spending_controls"
    36  	IssuingAuthorizationRequestHistoryReasonSuspectedFraud                 IssuingAuthorizationRequestHistoryReason = "suspected_fraud"
    37  	IssuingAuthorizationRequestHistoryReasonVerificationFailed             IssuingAuthorizationRequestHistoryReason = "verification_failed"
    38  	IssuingAuthorizationRequestHistoryReasonWebhookApproved                IssuingAuthorizationRequestHistoryReason = "webhook_approved"
    39  	IssuingAuthorizationRequestHistoryReasonWebhookDeclined                IssuingAuthorizationRequestHistoryReason = "webhook_declined"
    40  	IssuingAuthorizationRequestHistoryReasonWebhookError                   IssuingAuthorizationRequestHistoryReason = "webhook_error"
    41  	IssuingAuthorizationRequestHistoryReasonWebhookTimeout                 IssuingAuthorizationRequestHistoryReason = "webhook_timeout"
    42  )
    43  
    44  // The current status of the authorization in its lifecycle.
    45  type IssuingAuthorizationStatus string
    46  
    47  // List of values that IssuingAuthorizationStatus can take
    48  const (
    49  	IssuingAuthorizationStatusClosed   IssuingAuthorizationStatus = "closed"
    50  	IssuingAuthorizationStatusPending  IssuingAuthorizationStatus = "pending"
    51  	IssuingAuthorizationStatusReversed IssuingAuthorizationStatus = "reversed"
    52  )
    53  
    54  // Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`.
    55  type IssuingAuthorizationVerificationDataCheck string
    56  
    57  // List of values that IssuingAuthorizationVerificationDataCheck can take
    58  const (
    59  	IssuingAuthorizationVerificationDataCheckMatch       IssuingAuthorizationVerificationDataCheck = "match"
    60  	IssuingAuthorizationVerificationDataCheckMismatch    IssuingAuthorizationVerificationDataCheck = "mismatch"
    61  	IssuingAuthorizationVerificationDataCheckNotProvided IssuingAuthorizationVerificationDataCheck = "not_provided"
    62  )
    63  
    64  // The entity that requested the exemption, either the acquiring merchant or the Issuing user.
    65  type IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy string
    66  
    67  // List of values that IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy can take
    68  const (
    69  	IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedByAcquirer IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy = "acquirer"
    70  	IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedByIssuer   IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy = "issuer"
    71  )
    72  
    73  // The specific exemption claimed for this authorization.
    74  type IssuingAuthorizationVerificationDataAuthenticationExemptionType string
    75  
    76  // List of values that IssuingAuthorizationVerificationDataAuthenticationExemptionType can take
    77  const (
    78  	IssuingAuthorizationVerificationDataAuthenticationExemptionTypeLowValueTransaction     IssuingAuthorizationVerificationDataAuthenticationExemptionType = "low_value_transaction"
    79  	IssuingAuthorizationVerificationDataAuthenticationExemptionTypeTransactionRiskAnalysis IssuingAuthorizationVerificationDataAuthenticationExemptionType = "transaction_risk_analysis"
    80  	IssuingAuthorizationVerificationDataAuthenticationExemptionTypeUnknown                 IssuingAuthorizationVerificationDataAuthenticationExemptionType = "unknown"
    81  )
    82  
    83  // The outcome of the 3D Secure authentication request.
    84  type IssuingAuthorizationVerificationDataThreeDSecureResult string
    85  
    86  // List of values that IssuingAuthorizationVerificationDataThreeDSecureResult can take
    87  const (
    88  	IssuingAuthorizationVerificationDataThreeDSecureResultAttemptAcknowledged IssuingAuthorizationVerificationDataThreeDSecureResult = "attempt_acknowledged"
    89  	IssuingAuthorizationVerificationDataThreeDSecureResultAuthenticated       IssuingAuthorizationVerificationDataThreeDSecureResult = "authenticated"
    90  	IssuingAuthorizationVerificationDataThreeDSecureResultFailed              IssuingAuthorizationVerificationDataThreeDSecureResult = "failed"
    91  	IssuingAuthorizationVerificationDataThreeDSecureResultRequired            IssuingAuthorizationVerificationDataThreeDSecureResult = "required"
    92  )
    93  
    94  // 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.
    95  type IssuingAuthorizationWallet string
    96  
    97  // List of values that IssuingAuthorizationWallet can take
    98  const (
    99  	IssuingAuthorizationWalletApplePay   IssuingAuthorizationWallet = "apple_pay"
   100  	IssuingAuthorizationWalletGooglePay  IssuingAuthorizationWallet = "google_pay"
   101  	IssuingAuthorizationWalletSamsungPay IssuingAuthorizationWallet = "samsung_pay"
   102  )
   103  
   104  // 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.
   105  type IssuingAuthorizationListParams struct {
   106  	ListParams `form:"*"`
   107  	// Only return authorizations that belong to the given card.
   108  	Card *string `form:"card"`
   109  	// Only return authorizations that belong to the given cardholder.
   110  	Cardholder *string `form:"cardholder"`
   111  	// Only return authorizations that were created during the given date interval.
   112  	Created *int64 `form:"created"`
   113  	// Only return authorizations that were created during the given date interval.
   114  	CreatedRange *RangeQueryParams `form:"created"`
   115  	// Specifies which fields in the response should be expanded.
   116  	Expand []*string `form:"expand"`
   117  	// Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`.
   118  	Status *string `form:"status"`
   119  }
   120  
   121  // AddExpand appends a new field to expand.
   122  func (p *IssuingAuthorizationListParams) AddExpand(f string) {
   123  	p.Expand = append(p.Expand, &f)
   124  }
   125  
   126  // Retrieves an Issuing Authorization object.
   127  type IssuingAuthorizationParams struct {
   128  	Params `form:"*"`
   129  	// Specifies which fields in the response should be expanded.
   130  	Expand []*string `form:"expand"`
   131  	// 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`.
   132  	Metadata map[string]string `form:"metadata"`
   133  }
   134  
   135  // AddExpand appends a new field to expand.
   136  func (p *IssuingAuthorizationParams) AddExpand(f string) {
   137  	p.Expand = append(p.Expand, &f)
   138  }
   139  
   140  // AddMetadata adds a new key-value pair to the Metadata.
   141  func (p *IssuingAuthorizationParams) AddMetadata(key string, value string) {
   142  	if p.Metadata == nil {
   143  		p.Metadata = make(map[string]string)
   144  	}
   145  
   146  	p.Metadata[key] = value
   147  }
   148  
   149  // [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.
   150  // 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).
   151  type IssuingAuthorizationApproveParams struct {
   152  	Params `form:"*"`
   153  	// 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).
   154  	Amount *int64 `form:"amount"`
   155  	// Specifies which fields in the response should be expanded.
   156  	Expand []*string `form:"expand"`
   157  	// 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`.
   158  	Metadata map[string]string `form:"metadata"`
   159  }
   160  
   161  // AddExpand appends a new field to expand.
   162  func (p *IssuingAuthorizationApproveParams) AddExpand(f string) {
   163  	p.Expand = append(p.Expand, &f)
   164  }
   165  
   166  // AddMetadata adds a new key-value pair to the Metadata.
   167  func (p *IssuingAuthorizationApproveParams) AddMetadata(key string, value string) {
   168  	if p.Metadata == nil {
   169  		p.Metadata = make(map[string]string)
   170  	}
   171  
   172  	p.Metadata[key] = value
   173  }
   174  
   175  // [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.
   176  // 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).
   177  type IssuingAuthorizationDeclineParams struct {
   178  	Params `form:"*"`
   179  	// Specifies which fields in the response should be expanded.
   180  	Expand []*string `form:"expand"`
   181  	// 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`.
   182  	Metadata map[string]string `form:"metadata"`
   183  }
   184  
   185  // AddExpand appends a new field to expand.
   186  func (p *IssuingAuthorizationDeclineParams) AddExpand(f string) {
   187  	p.Expand = append(p.Expand, &f)
   188  }
   189  
   190  // AddMetadata adds a new key-value pair to the Metadata.
   191  func (p *IssuingAuthorizationDeclineParams) AddMetadata(key string, value string) {
   192  	if p.Metadata == nil {
   193  		p.Metadata = make(map[string]string)
   194  	}
   195  
   196  	p.Metadata[key] = value
   197  }
   198  
   199  // Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
   200  type IssuingAuthorizationAmountDetails struct {
   201  	// The fee charged by the ATM for the cash withdrawal.
   202  	ATMFee int64 `json:"atm_fee"`
   203  	// The amount of cash requested by the cardholder.
   204  	CashbackAmount int64 `json:"cashback_amount"`
   205  }
   206  type IssuingAuthorizationMerchantData struct {
   207  	// 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.
   208  	Category string `json:"category"`
   209  	// The merchant category code for the seller's business
   210  	CategoryCode string `json:"category_code"`
   211  	// City where the seller is located
   212  	City string `json:"city"`
   213  	// Country where the seller is located
   214  	Country string `json:"country"`
   215  	// Name of the seller
   216  	Name string `json:"name"`
   217  	// Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant.
   218  	NetworkID string `json:"network_id"`
   219  	// Postal code where the seller is located
   220  	PostalCode string `json:"postal_code"`
   221  	// State where the seller is located
   222  	State string `json:"state"`
   223  	// An ID assigned by the seller to the location of the sale.
   224  	TerminalID string `json:"terminal_id"`
   225  	// URL provided by the merchant on a 3DS request
   226  	URL string `json:"url"`
   227  }
   228  
   229  // Details about the authorization, such as identifiers, set by the card network.
   230  type IssuingAuthorizationNetworkData struct {
   231  	// 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`.
   232  	AcquiringInstitutionID string `json:"acquiring_institution_id"`
   233  	// 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.
   234  	SystemTraceAuditNumber string `json:"system_trace_audit_number"`
   235  	// Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions.
   236  	TransactionID string `json:"transaction_id"`
   237  }
   238  
   239  // The pending authorization request. This field will only be non-null during an `issuing_authorization.request` webhook.
   240  type IssuingAuthorizationPendingRequest struct {
   241  	// 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).
   242  	Amount int64 `json:"amount"`
   243  	// Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
   244  	AmountDetails *IssuingAuthorizationAmountDetails `json:"amount_details"`
   245  	// 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).
   246  	Currency Currency `json:"currency"`
   247  	// 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.
   248  	IsAmountControllable bool `json:"is_amount_controllable"`
   249  	// 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).
   250  	MerchantAmount int64 `json:"merchant_amount"`
   251  	// The local currency the merchant is requesting to authorize.
   252  	MerchantCurrency Currency `json:"merchant_currency"`
   253  	// The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99.
   254  	NetworkRiskScore int64 `json:"network_risk_score"`
   255  }
   256  
   257  // 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.
   258  type IssuingAuthorizationRequestHistory struct {
   259  	// 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.
   260  	Amount int64 `json:"amount"`
   261  	// Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
   262  	AmountDetails *IssuingAuthorizationAmountDetails `json:"amount_details"`
   263  	// Whether this request was approved.
   264  	Approved bool `json:"approved"`
   265  	// 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.
   266  	AuthorizationCode string `json:"authorization_code"`
   267  	// Time at which the object was created. Measured in seconds since the Unix epoch.
   268  	Created int64 `json:"created"`
   269  	// 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).
   270  	Currency Currency `json:"currency"`
   271  	// 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).
   272  	MerchantAmount int64 `json:"merchant_amount"`
   273  	// 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).
   274  	MerchantCurrency Currency `json:"merchant_currency"`
   275  	// The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99.
   276  	NetworkRiskScore int64 `json:"network_risk_score"`
   277  	// When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome.
   278  	Reason IssuingAuthorizationRequestHistoryReason `json:"reason"`
   279  	// 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.
   280  	ReasonMessage string `json:"reason_message"`
   281  	// Time when the card network received an authorization request from the acquirer in UTC. Referred to by networks as transmission time.
   282  	RequestedAt int64 `json:"requested_at"`
   283  }
   284  
   285  // [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).
   286  type IssuingAuthorizationTreasury struct {
   287  	// The array of [ReceivedCredits](https://stripe.com/docs/api/treasury/received_credits) associated with this authorization
   288  	ReceivedCredits []string `json:"received_credits"`
   289  	// The array of [ReceivedDebits](https://stripe.com/docs/api/treasury/received_debits) associated with this authorization
   290  	ReceivedDebits []string `json:"received_debits"`
   291  	// The Treasury [Transaction](https://stripe.com/docs/api/treasury/transactions) associated with this authorization
   292  	Transaction string `json:"transaction"`
   293  }
   294  
   295  // The exemption applied to this authorization.
   296  type IssuingAuthorizationVerificationDataAuthenticationExemption struct {
   297  	// The entity that requested the exemption, either the acquiring merchant or the Issuing user.
   298  	ClaimedBy IssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy `json:"claimed_by"`
   299  	// The specific exemption claimed for this authorization.
   300  	Type IssuingAuthorizationVerificationDataAuthenticationExemptionType `json:"type"`
   301  }
   302  
   303  // 3D Secure details.
   304  type IssuingAuthorizationVerificationDataThreeDSecure struct {
   305  	// The outcome of the 3D Secure authentication request.
   306  	Result IssuingAuthorizationVerificationDataThreeDSecureResult `json:"result"`
   307  }
   308  type IssuingAuthorizationVerificationData struct {
   309  	// Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`.
   310  	AddressLine1Check IssuingAuthorizationVerificationDataCheck `json:"address_line1_check"`
   311  	// Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`.
   312  	AddressPostalCodeCheck IssuingAuthorizationVerificationDataCheck `json:"address_postal_code_check"`
   313  	// The exemption applied to this authorization.
   314  	AuthenticationExemption *IssuingAuthorizationVerificationDataAuthenticationExemption `json:"authentication_exemption"`
   315  	// Whether the cardholder provided a CVC and if it matched Stripe's record.
   316  	CVCCheck IssuingAuthorizationVerificationDataCheck `json:"cvc_check"`
   317  	// Whether the cardholder provided an expiry date and if it matched Stripe's record.
   318  	ExpiryCheck IssuingAuthorizationVerificationDataCheck `json:"expiry_check"`
   319  	// The postal code submitted as part of the authorization used for postal code verification.
   320  	PostalCode string `json:"postal_code"`
   321  	// 3D Secure details.
   322  	ThreeDSecure *IssuingAuthorizationVerificationDataThreeDSecure `json:"three_d_secure"`
   323  }
   324  
   325  // When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization`
   326  // object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the
   327  // purchase to be completed successfully.
   328  //
   329  // Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations)
   330  type IssuingAuthorization struct {
   331  	APIResource
   332  	// 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.
   333  	Amount int64 `json:"amount"`
   334  	// Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
   335  	AmountDetails *IssuingAuthorizationAmountDetails `json:"amount_details"`
   336  	// Whether the authorization has been approved.
   337  	Approved bool `json:"approved"`
   338  	// How the card details were provided.
   339  	AuthorizationMethod IssuingAuthorizationAuthorizationMethod `json:"authorization_method"`
   340  	// List of balance transactions associated with this authorization.
   341  	BalanceTransactions []*BalanceTransaction `json:"balance_transactions"`
   342  	// You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders.
   343  	Card *IssuingCard `json:"card"`
   344  	// The cardholder to whom this authorization belongs.
   345  	Cardholder *IssuingCardholder `json:"cardholder"`
   346  	// Time at which the object was created. Measured in seconds since the Unix epoch.
   347  	Created int64 `json:"created"`
   348  	// 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).
   349  	Currency Currency `json:"currency"`
   350  	// Unique identifier for the object.
   351  	ID string `json:"id"`
   352  	// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
   353  	Livemode bool `json:"livemode"`
   354  	// 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.
   355  	MerchantAmount int64 `json:"merchant_amount"`
   356  	// 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).
   357  	MerchantCurrency Currency                          `json:"merchant_currency"`
   358  	MerchantData     *IssuingAuthorizationMerchantData `json:"merchant_data"`
   359  	// 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.
   360  	Metadata map[string]string `json:"metadata"`
   361  	// Details about the authorization, such as identifiers, set by the card network.
   362  	NetworkData *IssuingAuthorizationNetworkData `json:"network_data"`
   363  	// String representing the object's type. Objects of the same type share the same value.
   364  	Object string `json:"object"`
   365  	// The pending authorization request. This field will only be non-null during an `issuing_authorization.request` webhook.
   366  	PendingRequest *IssuingAuthorizationPendingRequest `json:"pending_request"`
   367  	// 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.
   368  	RequestHistory []*IssuingAuthorizationRequestHistory `json:"request_history"`
   369  	// The current status of the authorization in its lifecycle.
   370  	Status IssuingAuthorizationStatus `json:"status"`
   371  	// [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.
   372  	Token *IssuingToken `json:"token"`
   373  	// List of [transactions](https://stripe.com/docs/api/issuing/transactions) associated with this authorization.
   374  	Transactions []*IssuingTransaction `json:"transactions"`
   375  	// [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).
   376  	Treasury         *IssuingAuthorizationTreasury         `json:"treasury"`
   377  	VerificationData *IssuingAuthorizationVerificationData `json:"verification_data"`
   378  	// 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.
   379  	Wallet IssuingAuthorizationWallet `json:"wallet"`
   380  }
   381  
   382  // IssuingAuthorizationList is a list of Authorizations as retrieved from a list endpoint.
   383  type IssuingAuthorizationList struct {
   384  	APIResource
   385  	ListMeta
   386  	Data []*IssuingAuthorization `json:"data"`
   387  }
   388  
   389  // UnmarshalJSON handles deserialization of an IssuingAuthorization.
   390  // This custom unmarshaling is needed because the resulting
   391  // property may be an id or the full struct if it was expanded.
   392  func (i *IssuingAuthorization) UnmarshalJSON(data []byte) error {
   393  	if id, ok := ParseID(data); ok {
   394  		i.ID = id
   395  		return nil
   396  	}
   397  
   398  	type issuingAuthorization IssuingAuthorization
   399  	var v issuingAuthorization
   400  	if err := json.Unmarshal(data, &v); err != nil {
   401  		return err
   402  	}
   403  
   404  	*i = IssuingAuthorization(v)
   405  	return nil
   406  }