Class Authorization

All Implemented Interfaces:
BalanceTransactionSource, HasId, MetadataStore<Authorization>, StripeObjectInterface

public class Authorization extends ApiResource implements MetadataStore<Authorization>, BalanceTransactionSource
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

  • Constructor Details

    • Authorization

      public Authorization()
  • Method Details

    • getCardholder

      public String getCardholder()
      Get ID of expandable cardholder object.
    • setCardholder

      public void setCardholder(String id)
    • getCardholderObject

      public Cardholder getCardholderObject()
      Get expanded cardholder.
    • setCardholderObject

      public void setCardholderObject(Cardholder expandableObject)
    • approve

      public Authorization approve() throws StripeException
      Approves a pending Issuing Authorization object. This request should be made within the timeout window of the real-time authorization flow. You can also respond directly to the webhook request to approve an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • approve

      public Authorization approve(RequestOptions options) throws StripeException
      Approves a pending Issuing Authorization object. This request should be made within the timeout window of the real-time authorization flow. You can also respond directly to the webhook request to approve an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • approve

      public Authorization approve(Map<String,Object> params) throws StripeException
      Approves a pending Issuing Authorization object. This request should be made within the timeout window of the real-time authorization flow. You can also respond directly to the webhook request to approve an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • approve

      public Authorization approve(Map<String,Object> params, RequestOptions options) throws StripeException
      Approves a pending Issuing Authorization object. This request should be made within the timeout window of the real-time authorization flow. You can also respond directly to the webhook request to approve an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • approve

      Approves a pending Issuing Authorization object. This request should be made within the timeout window of the real-time authorization flow. You can also respond directly to the webhook request to approve an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • approve

      public Authorization approve(AuthorizationApproveParams params, RequestOptions options) throws StripeException
      Approves a pending Issuing Authorization object. This request should be made within the timeout window of the real-time authorization flow. You can also respond directly to the webhook request to approve an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • decline

      public Authorization decline() throws StripeException
      Declines a pending Issuing Authorization object. This request should be made within the timeout window of the real time authorization flow. You can also respond directly to the webhook request to decline an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • decline

      public Authorization decline(RequestOptions options) throws StripeException
      Declines a pending Issuing Authorization object. This request should be made within the timeout window of the real time authorization flow. You can also respond directly to the webhook request to decline an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • decline

      public Authorization decline(Map<String,Object> params) throws StripeException
      Declines a pending Issuing Authorization object. This request should be made within the timeout window of the real time authorization flow. You can also respond directly to the webhook request to decline an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • decline

      public Authorization decline(Map<String,Object> params, RequestOptions options) throws StripeException
      Declines a pending Issuing Authorization object. This request should be made within the timeout window of the real time authorization flow. You can also respond directly to the webhook request to decline an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • decline

      Declines a pending Issuing Authorization object. This request should be made within the timeout window of the real time authorization flow. You can also respond directly to the webhook request to decline an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • decline

      public Authorization decline(AuthorizationDeclineParams params, RequestOptions options) throws StripeException
      Declines a pending Issuing Authorization object. This request should be made within the timeout window of the real time authorization flow. You can also respond directly to the webhook request to decline an authorization (preferred). More details can be found here.
      Throws:
      StripeException
    • list

      public static AuthorizationCollection list(Map<String,Object> params) throws StripeException
      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.
      Throws:
      StripeException
    • list

      public static AuthorizationCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • list

      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.
      Throws:
      StripeException
    • list

      public static AuthorizationCollection list(AuthorizationListParams params, RequestOptions options) throws StripeException
      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.
      Throws:
      StripeException
    • retrieve

      public static Authorization retrieve(String authorization) throws StripeException
      Retrieves an Issuing Authorization object.
      Throws:
      StripeException
    • retrieve

      public static Authorization retrieve(String authorization, RequestOptions options) throws StripeException
      Retrieves an Issuing Authorization object.
      Throws:
      StripeException
    • retrieve

      public static Authorization retrieve(String authorization, Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieves an Issuing Authorization object.
      Throws:
      StripeException
    • retrieve

      public static Authorization retrieve(String authorization, AuthorizationRetrieveParams params, RequestOptions options) throws StripeException
      Retrieves an Issuing Authorization object.
      Throws:
      StripeException
    • update

      public Authorization update(Map<String,Object> params) throws StripeException
      Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
      Specified by:
      update in interface MetadataStore<Authorization>
      Throws:
      StripeException
    • update

      public Authorization update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
      Specified by:
      update in interface MetadataStore<Authorization>
      Throws:
      StripeException
    • update

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

      public Authorization update(AuthorizationUpdateParams params, RequestOptions options) throws StripeException
      Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
      Throws:
      StripeException
    • getAmount

      public Long getAmount()
      The total amount that was authorized or rejected. This amount is in the card's currency and in the smallest currency unit.
    • getAmountDetails

      public Authorization.AmountDetails getAmountDetails()
      Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit.
    • getApproved

      public Boolean getApproved()
      Whether the authorization has been approved.
    • getAuthorizationMethod

      public String getAuthorizationMethod()
      How the card details were provided.

      One of chip, contactless, keyed_in, online, or swipe.

    • getBalanceTransactions

      public List<BalanceTransaction> getBalanceTransactions()
      List of balance transactions associated with this authorization.
    • getCard

      public Card getCard()
      You can create physical or virtual cards that are issued to cardholders.
    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getCurrency

      public String getCurrency()
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getMerchantAmount

      public Long getMerchantAmount()
      The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit.
    • getMerchantCurrency

      public String getMerchantCurrency()
      The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • getMerchantData

      public Authorization.MerchantData getMerchantData()
    • getNetworkData

      public Authorization.NetworkData getNetworkData()
      Details about the authorization, such as identifiers, set by the card network.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to issuing.authorization.

    • getPendingRequest

      public Authorization.PendingRequest getPendingRequest()
      The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook.
    • getRequestHistory

      public List<Authorization.RequestHistory> getRequestHistory()
      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.
    • getStatus

      public String getStatus()
      The current status of the authorization in its lifecycle.

      One of closed, pending, or reversed.

    • getTransactions

      public List<Transaction> getTransactions()
      List of transactions associated with this authorization.
    • getTreasury

      public Authorization.Treasury getTreasury()
      Treasury details related to this authorization if it was created on a FinancialAccount.
    • getVerificationData

      public Authorization.VerificationData getVerificationData()
    • getWallet

      public String getWallet()
      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.
    • setAmount

      public void setAmount(Long amount)
      The total amount that was authorized or rejected. This amount is in the card's currency and in the smallest currency unit.
    • setAmountDetails

      public void setAmountDetails(Authorization.AmountDetails amountDetails)
      Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit.
    • setApproved

      public void setApproved(Boolean approved)
      Whether the authorization has been approved.
    • setAuthorizationMethod

      public void setAuthorizationMethod(String authorizationMethod)
      How the card details were provided.

      One of chip, contactless, keyed_in, online, or swipe.

    • setBalanceTransactions

      public void setBalanceTransactions(List<BalanceTransaction> balanceTransactions)
      List of balance transactions associated with this authorization.
    • setCard

      public void setCard(Card card)
      You can create physical or virtual cards that are issued to cardholders.
    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setCurrency

      public void setCurrency(String currency)
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setMerchantAmount

      public void setMerchantAmount(Long merchantAmount)
      The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit.
    • setMerchantCurrency

      public void setMerchantCurrency(String merchantCurrency)
      The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • setMerchantData

      public void setMerchantData(Authorization.MerchantData merchantData)
    • setMetadata

      public void setMetadata(Map<String,String> metadata)
      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.
    • setNetworkData

      public void setNetworkData(Authorization.NetworkData networkData)
      Details about the authorization, such as identifiers, set by the card network.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to issuing.authorization.

    • setPendingRequest

      public void setPendingRequest(Authorization.PendingRequest pendingRequest)
      The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook.
    • setRequestHistory

      public void setRequestHistory(List<Authorization.RequestHistory> requestHistory)
      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.
    • setStatus

      public void setStatus(String status)
      The current status of the authorization in its lifecycle.

      One of closed, pending, or reversed.

    • setTransactions

      public void setTransactions(List<Transaction> transactions)
      List of transactions associated with this authorization.
    • setTreasury

      public void setTreasury(Authorization.Treasury treasury)
      Treasury details related to this authorization if it was created on a FinancialAccount.
    • setVerificationData

      public void setVerificationData(Authorization.VerificationData verificationData)
    • setWallet

      public void setWallet(String wallet)
      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.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId
    • getMetadata

      public Map<String,String> getMetadata()
      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.
      Specified by:
      getMetadata in interface MetadataStore<Authorization>