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, Fleet, FraudChallenge, Fuel, MerchantData, NetworkData, PendingRequest, Redaction, RequestHistory, TestHelpers, 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_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.
-
#currency ⇒ Object
readonly
The currency of the cardholder.
-
#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.
-
#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_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.
-
#token ⇒ Object
readonly
Token object used for this authorization.
-
#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, #_get_union_variant_class, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, inner_class_union_variant_types, #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.
486 487 488 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 486 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.
488 489 490 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 488 def amount_details @amount_details end |
#approved ⇒ Object (readonly)
Whether the authorization has been approved.
490 491 492 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 490 def approved @approved end |
#authorization_method ⇒ Object (readonly)
How the card details were provided.
492 493 494 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 492 def @authorization_method end |
#balance_transactions ⇒ Object (readonly)
List of balance transactions associated with this authorization.
494 495 496 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 494 def balance_transactions @balance_transactions end |
#card ⇒ Object (readonly)
You can create physical or virtual cards that are issued to cardholders.
496 497 498 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 496 def card @card end |
#card_presence ⇒ Object (readonly)
Whether the card was present at the point of sale for the authorization.
498 499 500 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 498 def card_presence @card_presence end |
#cardholder ⇒ Object (readonly)
The cardholder to whom this authorization belongs.
500 501 502 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 500 def cardholder @cardholder end |
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
502 503 504 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 502 def created @created 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.
504 505 506 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 504 def currency @currency end |
#fleet ⇒ Object (readonly)
Fleet-specific information for authorizations using Fleet cards.
506 507 508 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 506 def fleet @fleet end |
#fraud_challenges ⇒ Object (readonly)
Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk reasons.
508 509 510 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 508 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.
510 511 512 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 510 def fuel @fuel end |
#id ⇒ Object (readonly)
Unique identifier for the object.
512 513 514 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 512 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.
514 515 516 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 514 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.
516 517 518 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 516 def merchant_amount @merchant_amount 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.
518 519 520 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 518 def merchant_currency @merchant_currency end |
#merchant_data ⇒ Object (readonly)
Attribute for field merchant_data
520 521 522 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 520 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.
522 523 524 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 522 def @metadata end |
#network_data ⇒ Object (readonly)
Details about the authorization, such as identifiers, set by the card network.
524 525 526 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 524 def network_data @network_data end |
#object ⇒ Object (readonly)
String representing the object's type. Objects of the same type share the same value.
526 527 528 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 526 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.
528 529 530 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 528 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.
530 531 532 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 530 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.
532 533 534 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 532 def request_history @request_history end |
#status ⇒ Object (readonly)
The current status of the authorization in its lifecycle.
534 535 536 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 534 def status @status 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.
536 537 538 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 536 def token @token end |
#transactions ⇒ Object (readonly)
List of transactions associated with this authorization.
538 539 540 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 538 def transactions @transactions end |
#treasury ⇒ Object (readonly)
Treasury details related to this authorization if it was created on a FinancialAccount.
540 541 542 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 540 def treasury @treasury end |
#verification_data ⇒ Object (readonly)
Attribute for field verification_data
542 543 544 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 542 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.
544 545 546 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 544 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.
546 547 548 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 546 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.
562 563 564 565 566 567 568 569 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 562 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.
590 591 592 593 594 595 596 597 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 590 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
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 785 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_remappings ⇒ Object
781 782 783 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 781 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 765 def self.inner_class_types @inner_class_types = { amount_details: AmountDetails, fleet: Fleet, fraud_challenges: FraudChallenge, fuel: Fuel, merchant_data: MerchantData, network_data: NetworkData, pending_request: PendingRequest, redaction: Redaction, request_history: RequestHistory, 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.
605 606 607 608 609 610 611 612 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 605 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.
615 616 617 618 619 620 621 622 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 615 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.
550 551 552 553 554 555 556 557 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 550 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.
578 579 580 581 582 583 584 585 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 578 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
624 625 626 |
# File 'lib/stripe/resources/issuing/authorization.rb', line 624 def test_helpers TestHelpers.new(self) end |