Class: Stripe::Issuing::Authorization
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Issuing::Authorization
- Extended by:
- Gem::Deprecate, APIOperations::List
- Includes:
- APIOperations::Save
- Defined in:
- lib/stripe/resources/issuing/authorization.rb
Overview
When an issued card is used to make a purchase, an Issuing Authorization
object is created. Authorizations must be approved for the
purchase to be completed successfully.
Related guide: Issued card authorizations
Defined Under Namespace
Classes: AmountDetails, BalanceResponse, CryptoTransaction, EnrichedMerchantData, Fleet, FraudChallenge, Fuel, Healthcare, MerchantData, NetworkData, PendingRequest, Redaction, RequestHistory, TerminalData, TestHelpers, TokenDetails, Treasury, VerificationData
Constant Summary collapse
- OBJECT_NAME =
"issuing.authorization"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
The total amount that was authorized or rejected.
-
#amount_details ⇒ Object
readonly
Detailed breakdown of amount components.
-
#approved ⇒ Object
readonly
Whether the authorization has been approved.
-
#authorization_method ⇒ Object
readonly
How the card details were provided.
-
#balance_response ⇒ Object
readonly
Attribute for field balance_response.
-
#balance_transactions ⇒ Object
readonly
List of balance transactions associated with this authorization.
-
#card ⇒ Object
readonly
You can create physical or virtual cards that are issued to cardholders.
-
#card_presence ⇒ Object
readonly
Whether the card was present at the point of sale for the authorization.
-
#cardholder ⇒ Object
readonly
The cardholder to whom this authorization belongs.
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#crypto_transactions ⇒ Object
readonly
Array of onchain crypto transactions linked to this resource.
-
#currency ⇒ Object
readonly
The currency of the cardholder.
-
#enriched_merchant_data ⇒ Object
readonly
Enriched merchant data for this authorization.
-
#fleet ⇒ Object
readonly
Fleet-specific information for authorizations using Fleet cards.
-
#fraud_challenges ⇒ Object
readonly
Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk reasons.
-
#fuel ⇒ Object
readonly
Information about fuel that was purchased with this transaction.
-
#healthcare ⇒ Object
readonly
Details about the IIAS FSA/HSA healthcare amounts on this authorization.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
If the object exists in live mode, the value is
true. -
#merchant_amount ⇒ Object
readonly
The total amount that was authorized or rejected.
-
#merchant_amount_exchange_rate ⇒ Object
readonly
The exchange rate used by the network to convert the
merchant_amounttoamount. -
#merchant_currency ⇒ Object
readonly
The local currency that was presented to the cardholder for the authorization.
-
#merchant_data ⇒ Object
readonly
Attribute for field merchant_data.
-
#metadata ⇒ Object
readonly
Set of key-value pairs that you can attach to an object.
-
#network_data ⇒ Object
readonly
Details about the authorization, such as identifiers, set by the card network.
-
#object ⇒ Object
readonly
String representing the object's type.
-
#pending_request ⇒ Object
readonly
The pending authorization request.
-
#redaction ⇒ Object
readonly
Redaction status of this authorization.
-
#request_history ⇒ Object
readonly
History of every time a
pending_requestauthorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). -
#status ⇒ Object
readonly
The current status of the authorization in its lifecycle.
-
#terminal_data ⇒ Object
readonly
Details about the cardholder verification outcome at the terminal.
-
#token ⇒ Object
readonly
Token object used for this authorization.
-
#token_details ⇒ Object
readonly
Attribute for field token_details.
-
#transactions ⇒ Object
readonly
List of transactions associated with this authorization.
-
#treasury ⇒ Object
readonly
Treasury details related to this authorization if it was created on a FinancialAccount.
-
#verification_data ⇒ Object
readonly
Attribute for field verification_data.
-
#verified_by_fraud_challenge ⇒ Object
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.
-
#wallet ⇒ Object
readonly
The digital wallet used for this transaction.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.approve(authorization, params = {}, opts = {}) ⇒ Object
[Deprecated] Approves a pending Issuing Authorization object.
-
.decline(authorization, params = {}, opts = {}) ⇒ Object
[Deprecated] Declines a pending Issuing Authorization object.
- .field_encodings ⇒ Object
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of Issuing Authorization objects.
- .object_name ⇒ Object
-
.update(authorization, params = {}, opts = {}) ⇒ Object
Updates the specified Issuing Authorization object by setting the values of the parameters passed.
Instance Method Summary collapse
-
#approve(params = {}, opts = {}) ⇒ Object
[Deprecated] Approves a pending Issuing Authorization object.
-
#decline(params = {}, opts = {}) ⇒ Object
[Deprecated] Declines a pending Issuing Authorization object.
- #test_helpers ⇒ Object
Methods included from APIOperations::List
Methods included from APIOperations::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
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, 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
#amount ⇒ Object (readonly)
The total amount that was authorized or rejected. This amount is in currency and in the smallest currency unit. amount should be the same as merchant_amount, unless currency and merchant_currency are different.
1078 1079 1080 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1078 def amount @amount end |
#amount_details ⇒ Object (readonly)
Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit.
1080 1081 1082 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1080 def amount_details @amount_details end |
#approved ⇒ Object (readonly)
Whether the authorization has been approved.
1082 1083 1084 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1082 def approved @approved end |
#authorization_method ⇒ Object (readonly)
How the card details were provided.
1084 1085 1086 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1084 def @authorization_method end |
#balance_response ⇒ Object (readonly)
Attribute for field balance_response
1086 1087 1088 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1086 def balance_response @balance_response end |
#balance_transactions ⇒ Object (readonly)
List of balance transactions associated with this authorization.
1088 1089 1090 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1088 def balance_transactions @balance_transactions end |
#card ⇒ Object (readonly)
You can create physical or virtual cards that are issued to cardholders.
1090 1091 1092 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1090 def card @card end |
#card_presence ⇒ Object (readonly)
Whether the card was present at the point of sale for the authorization.
1092 1093 1094 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1092 def card_presence @card_presence end |
#cardholder ⇒ Object (readonly)
The cardholder to whom this authorization belongs.
1094 1095 1096 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1094 def cardholder @cardholder end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
1096 1097 1098 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1096 def created @created end |
#crypto_transactions ⇒ Object (readonly)
Array of onchain crypto transactions linked to this resource.
1098 1099 1100 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1098 def crypto_transactions @crypto_transactions end |
#currency ⇒ Object (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, in lowercase. Must be a supported currency.
1100 1101 1102 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1100 def currency @currency end |
#enriched_merchant_data ⇒ Object (readonly)
Enriched merchant data for this authorization.
1102 1103 1104 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1102 def enriched_merchant_data @enriched_merchant_data end |
#fleet ⇒ Object (readonly)
Fleet-specific information for authorizations using Fleet cards.
1104 1105 1106 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1104 def fleet @fleet end |
#fraud_challenges ⇒ Object (readonly)
Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk reasons.
1106 1107 1108 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1106 def fraud_challenges @fraud_challenges end |
#fuel ⇒ Object (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.
1108 1109 1110 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1108 def fuel @fuel end |
#healthcare ⇒ Object (readonly)
Details about the IIAS FSA/HSA healthcare amounts on this authorization.
1110 1111 1112 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1110 def healthcare @healthcare end |
#id ⇒ Object (readonly)
Unique identifier for the object.
1112 1113 1114 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1112 def id @id end |
#livemode ⇒ Object (readonly)
If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.
1114 1115 1116 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1114 def livemode @livemode end |
#merchant_amount ⇒ Object (readonly)
The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit. merchant_amount should be the same as amount, unless merchant_currency and currency are different.
1116 1117 1118 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1116 def merchant_amount @merchant_amount end |
#merchant_amount_exchange_rate ⇒ Object (readonly)
The exchange rate used by the network to convert the merchant_amount to amount. The merchant_amount multiplied with this rate will equal to the amount.
1118 1119 1120 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1118 def merchant_amount_exchange_rate @merchant_amount_exchange_rate end |
#merchant_currency ⇒ Object (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, in lowercase. Must be a supported currency.
1120 1121 1122 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1120 def merchant_currency @merchant_currency end |
#merchant_data ⇒ Object (readonly)
Attribute for field merchant_data
1122 1123 1124 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1122 def merchant_data @merchant_data end |
#metadata ⇒ Object (readonly)
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
1124 1125 1126 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1124 def @metadata end |
#network_data ⇒ Object (readonly)
Details about the authorization, such as identifiers, set by the card network.
1126 1127 1128 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1126 def network_data @network_data end |
#object ⇒ Object (readonly)
String representing the object's type. Objects of the same type share the same value.
1128 1129 1130 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1128 def object @object end |
#pending_request ⇒ Object (readonly)
The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook.
1130 1131 1132 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1130 def pending_request @pending_request end |
#redaction ⇒ Object (readonly)
Redaction status of this authorization. If the authorization is not redacted, this field will be null.
1132 1133 1134 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1132 def redaction @redaction end |
#request_history ⇒ Object (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.
1134 1135 1136 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1134 def request_history @request_history end |
#status ⇒ Object (readonly)
The current status of the authorization in its lifecycle.
1136 1137 1138 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1136 def status @status end |
#terminal_data ⇒ Object (readonly)
Details about the cardholder verification outcome at the terminal.
1138 1139 1140 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1138 def terminal_data @terminal_data end |
#token ⇒ Object (readonly)
Token object used for this authorization. If a network token was not used for this authorization, this field will be null.
1140 1141 1142 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1140 def token @token end |
#token_details ⇒ Object (readonly)
Attribute for field token_details
1142 1143 1144 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1142 def token_details @token_details end |
#transactions ⇒ Object (readonly)
List of transactions associated with this authorization.
1144 1145 1146 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1144 def transactions @transactions end |
#treasury ⇒ Object (readonly)
Treasury details related to this authorization if it was created on a FinancialAccount.
1146 1147 1148 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1146 def treasury @treasury end |
#verification_data ⇒ Object (readonly)
Attribute for field verification_data
1148 1149 1150 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1148 def verification_data @verification_data end |
#verified_by_fraud_challenge ⇒ Object (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.
1150 1151 1152 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1150 def verified_by_fraud_challenge @verified_by_fraud_challenge end |
#wallet ⇒ Object (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.
1152 1153 1154 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1152 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 flow. This method is deprecated. Instead, respond directly to the webhook request to approve an authorization.
1168 1169 1170 1171 1172 1173 1174 1175 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1168 def self.approve(, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/issuing/authorizations/%<authorization>s/approve", { authorization: CGI.escape() }), 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 flow. This method is deprecated. Instead, respond directly to the webhook request to decline an authorization.
1196 1197 1198 1199 1200 1201 1202 1203 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1196 def self.decline(, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/issuing/authorizations/%<authorization>s/decline", { authorization: CGI.escape() }), params: params, opts: opts ) end |
.field_encodings ⇒ Object
1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1397 def self.field_encodings @field_encodings = { fleet: { kind: :object, fields: { reported_breakdown: { kind: :object, fields: { fuel: { kind: :object, fields: { gross_amount_decimal: :decimal_string } }, non_fuel: { kind: :object, fields: { gross_amount_decimal: :decimal_string } }, tax: { kind: :object, fields: { local_amount_decimal: :decimal_string, national_amount_decimal: :decimal_string, }, }, }, }, }, }, fuel: { kind: :object, fields: { quantity_decimal: :decimal_string, unit_cost_decimal: :decimal_string }, }, } end |
.field_remappings ⇒ Object
1393 1394 1395 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1393 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1371 def self.inner_class_types @inner_class_types = { amount_details: AmountDetails, balance_response: BalanceResponse, crypto_transactions: CryptoTransaction, enriched_merchant_data: EnrichedMerchantData, fleet: Fleet, fraud_challenges: FraudChallenge, fuel: Fuel, healthcare: Healthcare, merchant_data: MerchantData, network_data: NetworkData, pending_request: PendingRequest, redaction: Redaction, request_history: RequestHistory, terminal_data: TerminalData, token_details: TokenDetails, treasury: Treasury, verification_data: VerificationData, } 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.
1211 1212 1213 1214 1215 1216 1217 1218 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1211 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/issuing/authorizations", params: params, opts: opts ) end |
.object_name ⇒ Object
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.
1221 1222 1223 1224 1225 1226 1227 1228 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1221 def self.update(, params = {}, opts = {}) request_stripe_object( method: :post, path: format("/v1/issuing/authorizations/%<authorization>s", { authorization: CGI.escape() }), 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 flow. This method is deprecated. Instead, respond directly to the webhook request to approve an authorization.
1156 1157 1158 1159 1160 1161 1162 1163 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1156 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 flow. This method is deprecated. Instead, respond directly to the webhook request to decline an authorization.
1184 1185 1186 1187 1188 1189 1190 1191 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1184 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_helpers ⇒ Object
1230 1231 1232 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 1230 def test_helpers TestHelpers.new(self) end |