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 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

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

#==, #[], #[]=, #_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

#amountObject (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.



1278
1279
1280
# File 'lib/stripe/resources/issuing/authorization.rb', line 1278

def amount
  @amount
end

#amount_detailsObject (readonly)

Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit.



1280
1281
1282
# File 'lib/stripe/resources/issuing/authorization.rb', line 1280

def amount_details
  @amount_details
end

#approvedObject (readonly)

Whether the authorization has been approved.



1282
1283
1284
# File 'lib/stripe/resources/issuing/authorization.rb', line 1282

def approved
  @approved
end

#authorization_methodObject (readonly)

How the card details were provided.



1284
1285
1286
# File 'lib/stripe/resources/issuing/authorization.rb', line 1284

def authorization_method
  @authorization_method
end

#balance_responseObject (readonly)

Attribute for field balance_response



1286
1287
1288
# File 'lib/stripe/resources/issuing/authorization.rb', line 1286

def balance_response
  @balance_response
end

#balance_transactionsObject (readonly)

List of balance transactions associated with this authorization.



1288
1289
1290
# File 'lib/stripe/resources/issuing/authorization.rb', line 1288

def balance_transactions
  @balance_transactions
end

#cardObject (readonly)

You can create physical or virtual cards that are issued to cardholders.



1290
1291
1292
# File 'lib/stripe/resources/issuing/authorization.rb', line 1290

def card
  @card
end

#card_presenceObject (readonly)

Whether the card was present at the point of sale for the authorization.



1292
1293
1294
# File 'lib/stripe/resources/issuing/authorization.rb', line 1292

def card_presence
  @card_presence
end

#cardholderObject (readonly)

The cardholder to whom this authorization belongs.



1294
1295
1296
# File 'lib/stripe/resources/issuing/authorization.rb', line 1294

def cardholder
  @cardholder
end

#createdObject (readonly)

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



1296
1297
1298
# File 'lib/stripe/resources/issuing/authorization.rb', line 1296

def created
  @created
end

#crypto_transactionsObject (readonly)

Array of onchain crypto transactions linked to this resource.



1298
1299
1300
# File 'lib/stripe/resources/issuing/authorization.rb', line 1298

def crypto_transactions
  @crypto_transactions
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, in lowercase. Must be a supported currency.



1300
1301
1302
# File 'lib/stripe/resources/issuing/authorization.rb', line 1300

def currency
  @currency
end

#enriched_merchant_dataObject (readonly)

Enriched merchant data for this authorization.



1302
1303
1304
# File 'lib/stripe/resources/issuing/authorization.rb', line 1302

def enriched_merchant_data
  @enriched_merchant_data
end

#fleetObject (readonly)

Fleet-specific information for authorizations using Fleet cards.



1304
1305
1306
# File 'lib/stripe/resources/issuing/authorization.rb', line 1304

def fleet
  @fleet
end

#fraud_challengesObject (readonly)

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



1306
1307
1308
# File 'lib/stripe/resources/issuing/authorization.rb', line 1306

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.



1308
1309
1310
# File 'lib/stripe/resources/issuing/authorization.rb', line 1308

def fuel
  @fuel
end

#healthcareObject (readonly)

Details about the IIAS FSA/HSA healthcare amounts on this authorization.



1310
1311
1312
# File 'lib/stripe/resources/issuing/authorization.rb', line 1310

def healthcare
  @healthcare
end

#idObject (readonly)

Unique identifier for the object.



1312
1313
1314
# File 'lib/stripe/resources/issuing/authorization.rb', line 1312

def id
  @id
end

#livemodeObject (readonly)

If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.



1314
1315
1316
# File 'lib/stripe/resources/issuing/authorization.rb', line 1314

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. merchant_amount should be the same as amount, unless merchant_currency and currency are different.



1316
1317
1318
# File 'lib/stripe/resources/issuing/authorization.rb', line 1316

def merchant_amount
  @merchant_amount
end

#merchant_amount_exchange_rateObject (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.



1318
1319
1320
# File 'lib/stripe/resources/issuing/authorization.rb', line 1318

def merchant_amount_exchange_rate
  @merchant_amount_exchange_rate
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, in lowercase. Must be a supported currency.



1320
1321
1322
# File 'lib/stripe/resources/issuing/authorization.rb', line 1320

def merchant_currency
  @merchant_currency
end

#merchant_dataObject (readonly)

Attribute for field merchant_data



1322
1323
1324
# File 'lib/stripe/resources/issuing/authorization.rb', line 1322

def merchant_data
  @merchant_data
end

#metadataObject (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.



1324
1325
1326
# File 'lib/stripe/resources/issuing/authorization.rb', line 1324

def 
  @metadata
end

#network_dataObject (readonly)

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



1326
1327
1328
# File 'lib/stripe/resources/issuing/authorization.rb', line 1326

def network_data
  @network_data
end

#objectObject (readonly)

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



1328
1329
1330
# File 'lib/stripe/resources/issuing/authorization.rb', line 1328

def object
  @object
end

#pending_requestObject (readonly)

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



1330
1331
1332
# File 'lib/stripe/resources/issuing/authorization.rb', line 1330

def pending_request
  @pending_request
end

#redactionObject (readonly)

Redaction status of this authorization. If the authorization is not redacted, this field will be null.



1332
1333
1334
# File 'lib/stripe/resources/issuing/authorization.rb', line 1332

def redaction
  @redaction
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.



1334
1335
1336
# File 'lib/stripe/resources/issuing/authorization.rb', line 1334

def request_history
  @request_history
end

#statusObject (readonly)

The current status of the authorization in its lifecycle.



1336
1337
1338
# File 'lib/stripe/resources/issuing/authorization.rb', line 1336

def status
  @status
end

#terminal_dataObject (readonly)

Details about the cardholder verification outcome at the terminal.



1338
1339
1340
# File 'lib/stripe/resources/issuing/authorization.rb', line 1338

def terminal_data
  @terminal_data
end

#tokenObject (readonly)

Token object used for this authorization. If a network token was not used for this authorization, this field will be null.



1340
1341
1342
# File 'lib/stripe/resources/issuing/authorization.rb', line 1340

def token
  @token
end

#token_detailsObject (readonly)

Attribute for field token_details



1342
1343
1344
# File 'lib/stripe/resources/issuing/authorization.rb', line 1342

def token_details
  @token_details
end

#transactionsObject (readonly)

List of transactions associated with this authorization.



1344
1345
1346
# File 'lib/stripe/resources/issuing/authorization.rb', line 1344

def transactions
  @transactions
end

#treasuryObject (readonly)

Treasury details related to this authorization if it was created on a FinancialAccount.



1346
1347
1348
# File 'lib/stripe/resources/issuing/authorization.rb', line 1346

def treasury
  @treasury
end

#verification_dataObject (readonly)

Attribute for field verification_data



1348
1349
1350
# File 'lib/stripe/resources/issuing/authorization.rb', line 1348

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.



1350
1351
1352
# File 'lib/stripe/resources/issuing/authorization.rb', line 1350

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.



1352
1353
1354
# File 'lib/stripe/resources/issuing/authorization.rb', line 1352

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.



1368
1369
1370
1371
1372
1373
1374
1375
# File 'lib/stripe/resources/issuing/authorization.rb', line 1368

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 flow. This method is deprecated. Instead, respond directly to the webhook request to decline an authorization.



1396
1397
1398
1399
1400
1401
1402
1403
# File 'lib/stripe/resources/issuing/authorization.rb', line 1396

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

.field_encodingsObject



1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
# File 'lib/stripe/resources/issuing/authorization.rb', line 1597

def self.field_encodings
  @field_encodings = {
    fleet: {
      kind: :nullable,
      inner: {
        kind: :object,
        fields: {
          reported_breakdown: {
            kind: :nullable,
            inner: {
              kind: :object,
              fields: {
                fuel: {
                  kind: :nullable,
                  inner: {
                    kind: :object,
                    fields: { gross_amount_decimal: { kind: :nullable, inner: :decimal_string } },
                  },
                },
                non_fuel: {
                  kind: :nullable,
                  inner: {
                    kind: :object,
                    fields: { gross_amount_decimal: { kind: :nullable, inner: :decimal_string } },
                  },
                },
                tax: {
                  kind: :nullable,
                  inner: {
                    kind: :object,
                    fields: {
                      local_amount_decimal: { kind: :nullable, inner: :decimal_string },
                      national_amount_decimal: { kind: :nullable, inner: :decimal_string },
                    },
                  },
                },
              },
            },
          },
        },
      },
    },
    fuel: {
      kind: :nullable,
      inner: {
        kind: :object,
        fields: {
          quantity_decimal: { kind: :nullable, inner: :decimal_string },
          unit_cost_decimal: { kind: :nullable, inner: :decimal_string },
        },
      },
    },
  }
end

.field_remappingsObject



1593
1594
1595
# File 'lib/stripe/resources/issuing/authorization.rb', line 1593

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
# File 'lib/stripe/resources/issuing/authorization.rb', line 1571

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.



1411
1412
1413
1414
1415
1416
1417
1418
# File 'lib/stripe/resources/issuing/authorization.rb', line 1411

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.



1421
1422
1423
1424
1425
1426
1427
1428
# File 'lib/stripe/resources/issuing/authorization.rb', line 1421

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 flow. This method is deprecated. Instead, respond directly to the webhook request to approve an authorization.



1356
1357
1358
1359
1360
1361
1362
1363
# File 'lib/stripe/resources/issuing/authorization.rb', line 1356

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.



1384
1385
1386
1387
1388
1389
1390
1391
# File 'lib/stripe/resources/issuing/authorization.rb', line 1384

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



1430
1431
1432
# File 'lib/stripe/resources/issuing/authorization.rb', line 1430

def test_helpers
  TestHelpers.new(self)
end