Class PaymentResponse


  • public class PaymentResponse
    extends Object
    PaymentResponse
    • Constructor Detail

      • PaymentResponse

        public PaymentResponse()
    • Method Detail

      • additionalData

        public PaymentResponse additionalData​(Map<String,​String> additionalData)
        Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.
        Parameters:
        additionalData -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getAdditionalData

        public Map<String,​String> getAdditionalData()
        Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.
        Returns:
        additionalData
      • setAdditionalData

        public void setAdditionalData​(Map<String,​String> additionalData)
        Contains additional information about the payment. Some data fields are included only if you select them first: Go to **Customer Area** > **Developers** > **Additional data**.
        Parameters:
        additionalData -
      • amount

        public PaymentResponse amount​(Amount amount)
        amount
        Parameters:
        amount -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getAmount

        public Amount getAmount()
        amount
        Returns:
        amount
      • setAmount

        public void setAmount​(Amount amount)
        amount
        Parameters:
        amount -
      • donationToken

        public PaymentResponse donationToken​(String donationToken)
        Donation Token containing payment details for Adyen Giving.
        Parameters:
        donationToken -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getDonationToken

        public String getDonationToken()
        Donation Token containing payment details for Adyen Giving.
        Returns:
        donationToken
      • setDonationToken

        public void setDonationToken​(String donationToken)
        Donation Token containing payment details for Adyen Giving.
        Parameters:
        donationToken -
      • fraudResult

        public PaymentResponse fraudResult​(FraudResult fraudResult)
        fraudResult
        Parameters:
        fraudResult -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getFraudResult

        public FraudResult getFraudResult()
        fraudResult
        Returns:
        fraudResult
      • setFraudResult

        public void setFraudResult​(FraudResult fraudResult)
        fraudResult
        Parameters:
        fraudResult -
      • merchantReference

        public PaymentResponse merchantReference​(String merchantReference)
        The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.
        Parameters:
        merchantReference -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getMerchantReference

        public String getMerchantReference()
        The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.
        Returns:
        merchantReference
      • setMerchantReference

        public void setMerchantReference​(String merchantReference)
        The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.
        Parameters:
        merchantReference -
      • paymentMethod

        public PaymentResponse paymentMethod​(ResponsePaymentMethod paymentMethod)
        paymentMethod
        Parameters:
        paymentMethod -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getPaymentMethod

        public ResponsePaymentMethod getPaymentMethod()
        paymentMethod
        Returns:
        paymentMethod
      • setPaymentMethod

        public void setPaymentMethod​(ResponsePaymentMethod paymentMethod)
        paymentMethod
        Parameters:
        paymentMethod -
      • pspReference

        public PaymentResponse pspReference​(String pspReference)
        Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response.
        Parameters:
        pspReference -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getPspReference

        public String getPspReference()
        Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response.
        Returns:
        pspReference
      • setPspReference

        public void setPspReference​(String pspReference)
        Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > For payment methods that require a redirect or additional action, you will get this value in the `/payments/details` response.
        Parameters:
        pspReference -
      • refusalReason

        public PaymentResponse refusalReason​(String refusalReason)
        If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).
        Parameters:
        refusalReason -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getRefusalReason

        public String getRefusalReason()
        If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).
        Returns:
        refusalReason
      • setRefusalReason

        public void setRefusalReason​(String refusalReason)
        If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values. For more information, see [Refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).
        Parameters:
        refusalReason -
      • refusalReasonCode

        public PaymentResponse refusalReasonCode​(String refusalReasonCode)
        Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).
        Parameters:
        refusalReasonCode -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getRefusalReasonCode

        public String getRefusalReasonCode()
        Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).
        Returns:
        refusalReasonCode
      • setRefusalReasonCode

        public void setRefusalReasonCode​(String refusalReasonCode)
        Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).
        Parameters:
        refusalReasonCode -
      • resultCode

        public PaymentResponse resultCode​(PaymentResponse.ResultCodeEnum resultCode)
        The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state.
        Parameters:
        resultCode -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getResultCode

        public PaymentResponse.ResultCodeEnum getResultCode()
        The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state.
        Returns:
        resultCode
      • setResultCode

        public void setResultCode​(PaymentResponse.ResultCodeEnum resultCode)
        The result of the payment. For more information, see [Result codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **AuthenticationNotRequired** – The transaction does not require 3D Secure authentication. Returned for [standalone authentication-only integrations](https://docs.adyen.com/online-payments/3d-secure/other-3ds-flows/authentication-only). * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **PartiallyAuthorised** – The payment has been authorised for a partial amount. This happens for card payments when the merchant supports Partial Authorisations and the cardholder has insufficient funds. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. * **PresentToShopper** – Indicates that the response contains additional information that you need to present to a shopper, so that they can use it to complete a payment. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state.
        Parameters:
        resultCode -
      • threeDS2ResponseData

        public PaymentResponse threeDS2ResponseData​(ThreeDS2ResponseData threeDS2ResponseData)
        threeDS2ResponseData
        Parameters:
        threeDS2ResponseData -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getThreeDS2ResponseData

        public ThreeDS2ResponseData getThreeDS2ResponseData()
        threeDS2ResponseData
        Returns:
        threeDS2ResponseData
      • setThreeDS2ResponseData

        public void setThreeDS2ResponseData​(ThreeDS2ResponseData threeDS2ResponseData)
        threeDS2ResponseData
        Parameters:
        threeDS2ResponseData -
      • threeDS2Result

        public PaymentResponse threeDS2Result​(ThreeDS2Result threeDS2Result)
        threeDS2Result
        Parameters:
        threeDS2Result -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getThreeDS2Result

        public ThreeDS2Result getThreeDS2Result()
        threeDS2Result
        Returns:
        threeDS2Result
      • setThreeDS2Result

        public void setThreeDS2Result​(ThreeDS2Result threeDS2Result)
        threeDS2Result
        Parameters:
        threeDS2Result -
      • threeDSPaymentData

        public PaymentResponse threeDSPaymentData​(String threeDSPaymentData)
        When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`.
        Parameters:
        threeDSPaymentData -
        Returns:
        the current PaymentResponse instance, allowing for method chaining
      • getThreeDSPaymentData

        public String getThreeDSPaymentData()
        When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`.
        Returns:
        threeDSPaymentData
      • setThreeDSPaymentData

        public void setThreeDSPaymentData​(String threeDSPaymentData)
        When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`.
        Parameters:
        threeDSPaymentData -
      • equals

        public boolean equals​(Object o)
        Return true if this PaymentResponse object is equal to o.
        Overrides:
        equals in class Object
      • hashCode

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

        public static PaymentResponse fromJson​(String jsonString)
                                        throws com.fasterxml.jackson.core.JsonProcessingException
        Create an instance of PaymentResponse given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of PaymentResponse
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if the JSON string is invalid with respect to PaymentResponse
      • toJson

        public String toJson()
                      throws com.fasterxml.jackson.core.JsonProcessingException
        Convert an instance of PaymentResponse to an JSON string
        Returns:
        JSON string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException