Class: Stripe::Issuing::Authorization

Inherits:
APIResource show all
Extended by:
Gem::Deprecate, APIOperations::List
Includes:
APIOperations::Save
Defined in:
lib/stripe/resources/issuing/authorization.rb

Overview

When an [issued card](stripe.com/docs/issuing) is used to make a purchase, an Issuing ‘Authorization` object is created. [Authorizations](stripe.com/docs/issuing/purchases/authorizations) must be approved for the purchase to be completed successfully.

Related guide: [Issued card authorizations](stripe.com/docs/issuing/purchases/authorizations)

Defined Under Namespace

Classes: AmountDetails, ApproveParams, CaptureParams, CreateParams, DeclineParams, ExpireParams, FinalizeAmountParams, Fleet, FraudChallenge, Fuel, IncrementParams, ListParams, MerchantData, NetworkData, PendingRequest, RequestHistory, RespondParams, ReverseParams, TestHelpers, Treasury, UpdateParams, VerificationData

Constant Summary collapse

OBJECT_NAME =
"issuing.authorization"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::List

list

Methods included from APIOperations::Save

included, #save

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from StripeObject

#==, #[], #[]=, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Instance Attribute Details

#amountObject (readonly)

The total amount that was authorized or rejected. This amount is in ‘currency` and in the [smallest currency unit](stripe.com/docs/currencies#zero-decimal). `amount` should be the same as `merchant_amount`, unless `currency` and `merchant_currency` are different.



1067
1068
1069
# File 'lib/stripe/resources/issuing/authorization.rb', line 1067

def amount
  @amount
end

#amount_detailsObject (readonly)

Detailed breakdown of amount components. These amounts are denominated in ‘currency` and in the [smallest currency unit](stripe.com/docs/currencies#zero-decimal).



1069
1070
1071
# File 'lib/stripe/resources/issuing/authorization.rb', line 1069

def amount_details
  @amount_details
end

#approvedObject (readonly)

Whether the authorization has been approved.



1071
1072
1073
# File 'lib/stripe/resources/issuing/authorization.rb', line 1071

def approved
  @approved
end

#authorization_methodObject (readonly)

How the card details were provided.



1073
1074
1075
# File 'lib/stripe/resources/issuing/authorization.rb', line 1073

def authorization_method
  @authorization_method
end

#balance_transactionsObject (readonly)

List of balance transactions associated with this authorization.



1075
1076
1077
# File 'lib/stripe/resources/issuing/authorization.rb', line 1075

def balance_transactions
  @balance_transactions
end

#cardObject (readonly)

You can [create physical or virtual cards](stripe.com/docs/issuing) that are issued to cardholders.



1077
1078
1079
# File 'lib/stripe/resources/issuing/authorization.rb', line 1077

def card
  @card
end

#cardholderObject (readonly)

The cardholder to whom this authorization belongs.



1079
1080
1081
# File 'lib/stripe/resources/issuing/authorization.rb', line 1079

def cardholder
  @cardholder
end

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



1081
1082
1083
# File 'lib/stripe/resources/issuing/authorization.rb', line 1081

def created
  @created
end

#currencyObject (readonly)

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](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).



1083
1084
1085
# File 'lib/stripe/resources/issuing/authorization.rb', line 1083

def currency
  @currency
end

#fleetObject (readonly)

Fleet-specific information for authorizations using Fleet cards.



1085
1086
1087
# File 'lib/stripe/resources/issuing/authorization.rb', line 1085

def fleet
  @fleet
end

#fraud_challengesObject (readonly)

Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk reasons.



1087
1088
1089
# File 'lib/stripe/resources/issuing/authorization.rb', line 1087

def fraud_challenges
  @fraud_challenges
end

#fuelObject (readonly)

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.



1089
1090
1091
# File 'lib/stripe/resources/issuing/authorization.rb', line 1089

def fuel
  @fuel
end

#idObject (readonly)

Unique identifier for the object.



1091
1092
1093
# File 'lib/stripe/resources/issuing/authorization.rb', line 1091

def id
  @id
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



1093
1094
1095
# File 'lib/stripe/resources/issuing/authorization.rb', line 1093

def livemode
  @livemode
end

#merchant_amountObject (readonly)

The total amount that was authorized or rejected. This amount is in the ‘merchant_currency` and in the [smallest currency unit](stripe.com/docs/currencies#zero-decimal). `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different.



1095
1096
1097
# File 'lib/stripe/resources/issuing/authorization.rb', line 1095

def merchant_amount
  @merchant_amount
end

#merchant_currencyObject (readonly)

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](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).



1097
1098
1099
# File 'lib/stripe/resources/issuing/authorization.rb', line 1097

def merchant_currency
  @merchant_currency
end

#merchant_dataObject (readonly)

Attribute for field merchant_data



1099
1100
1101
# File 'lib/stripe/resources/issuing/authorization.rb', line 1099

def merchant_data
  @merchant_data
end

#metadataObject (readonly)

Set of [key-value pairs](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.



1101
1102
1103
# File 'lib/stripe/resources/issuing/authorization.rb', line 1101

def 
  @metadata
end

#network_dataObject (readonly)

Details about the authorization, such as identifiers, set by the card network.



1103
1104
1105
# File 'lib/stripe/resources/issuing/authorization.rb', line 1103

def network_data
  @network_data
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



1105
1106
1107
# File 'lib/stripe/resources/issuing/authorization.rb', line 1105

def object
  @object
end

#pending_requestObject (readonly)

The pending authorization request. This field will only be non-null during an ‘issuing_authorization.request` webhook.



1107
1108
1109
# File 'lib/stripe/resources/issuing/authorization.rb', line 1107

def pending_request
  @pending_request
end

#request_historyObject (readonly)

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.



1109
1110
1111
# File 'lib/stripe/resources/issuing/authorization.rb', line 1109

def request_history
  @request_history
end

#statusObject (readonly)

The current status of the authorization in its lifecycle.



1111
1112
1113
# File 'lib/stripe/resources/issuing/authorization.rb', line 1111

def status
  @status
end

#tokenObject (readonly)

[Token](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.



1113
1114
1115
# File 'lib/stripe/resources/issuing/authorization.rb', line 1113

def token
  @token
end

#transactionsObject (readonly)

List of [transactions](stripe.com/docs/api/issuing/transactions) associated with this authorization.



1115
1116
1117
# File 'lib/stripe/resources/issuing/authorization.rb', line 1115

def transactions
  @transactions
end

#treasuryObject (readonly)

[Treasury](stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](stripe.com/docs/api/treasury/financial_accounts).



1117
1118
1119
# File 'lib/stripe/resources/issuing/authorization.rb', line 1117

def treasury
  @treasury
end

#verification_dataObject (readonly)

Attribute for field verification_data



1119
1120
1121
# File 'lib/stripe/resources/issuing/authorization.rb', line 1119

def verification_data
  @verification_data
end

#verified_by_fraud_challengeObject (readonly)

Whether the authorization bypassed fraud risk checks because the cardholder has previously completed a fraud challenge on a similar high-risk authorization from the same merchant.



1121
1122
1123
# File 'lib/stripe/resources/issuing/authorization.rb', line 1121

def verified_by_fraud_challenge
  @verified_by_fraud_challenge
end

#walletObject (readonly)

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.



1123
1124
1125
# File 'lib/stripe/resources/issuing/authorization.rb', line 1123

def wallet
  @wallet
end

Class Method Details

.approve(authorization, params = {}, opts = {}) ⇒ Object

Deprecated

Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](stripe.com/docs/issuing/controls/real-time-authorizations) flow.

This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).



1139
1140
1141
1142
1143
1144
1145
1146
# File 'lib/stripe/resources/issuing/authorization.rb', line 1139

def self.approve(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/authorizations/%<authorization>s/approve", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.decline(authorization, params = {}, opts = {}) ⇒ Object

Deprecated

Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](stripe.com/docs/issuing/controls/real-time-authorizations) flow.

This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).



1167
1168
1169
1170
1171
1172
1173
1174
# File 'lib/stripe/resources/issuing/authorization.rb', line 1167

def self.decline(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/authorizations/%<authorization>s/decline", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

.list(params = {}, opts = {}) ⇒ Object

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.



1182
1183
1184
1185
1186
1187
1188
1189
# File 'lib/stripe/resources/issuing/authorization.rb', line 1182

def self.list(params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/issuing/authorizations",
    params: params,
    opts: opts
  )
end

.object_nameObject



17
18
19
# File 'lib/stripe/resources/issuing/authorization.rb', line 17

def self.object_name
  "issuing.authorization"
end

.update(authorization, params = {}, opts = {}) ⇒ Object

Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.



1192
1193
1194
1195
1196
1197
1198
1199
# File 'lib/stripe/resources/issuing/authorization.rb', line 1192

def self.update(authorization, params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/authorizations/%<authorization>s", { authorization: CGI.escape(authorization) }),
    params: params,
    opts: opts
  )
end

Instance Method Details

#approve(params = {}, opts = {}) ⇒ Object

Deprecated

Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](stripe.com/docs/issuing/controls/real-time-authorizations) flow.

This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).



1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/stripe/resources/issuing/authorization.rb', line 1127

def approve(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/authorizations/%<authorization>s/approve", { authorization: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#decline(params = {}, opts = {}) ⇒ Object

Deprecated

Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](stripe.com/docs/issuing/controls/real-time-authorizations) flow.

This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).



1155
1156
1157
1158
1159
1160
1161
1162
# File 'lib/stripe/resources/issuing/authorization.rb', line 1155

def decline(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: format("/v1/issuing/authorizations/%<authorization>s/decline", { authorization: CGI.escape(self["id"]) }),
    params: params,
    opts: opts
  )
end

#test_helpersObject



1201
1202
1203
# File 'lib/stripe/resources/issuing/authorization.rb', line 1201

def test_helpers
  TestHelpers.new(self)
end