Package com.adyen.model.checkout
Class PaymentResponse
- java.lang.Object
-
- com.adyen.model.checkout.PaymentResponse
-
public class PaymentResponse extends Object
PaymentResponse
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPaymentResponse.CustomTypeAdapterFactorystatic classPaymentResponse.ResultCodeEnumThe result of the payment.
-
Field Summary
Fields Modifier and Type Field Description static HashSet<String>openapiFieldsstatic HashSet<String>openapiRequiredFieldsstatic StringSERIALIZED_NAME_ACTIONstatic StringSERIALIZED_NAME_ADDITIONAL_DATAstatic StringSERIALIZED_NAME_AMOUNTstatic StringSERIALIZED_NAME_DONATION_TOKENstatic StringSERIALIZED_NAME_FRAUD_RESULTstatic StringSERIALIZED_NAME_MERCHANT_REFERENCEstatic StringSERIALIZED_NAME_ORDERstatic StringSERIALIZED_NAME_PAYMENT_METHODstatic StringSERIALIZED_NAME_PSP_REFERENCEstatic StringSERIALIZED_NAME_REFUSAL_REASONstatic StringSERIALIZED_NAME_REFUSAL_REASON_CODEstatic StringSERIALIZED_NAME_RESULT_CODEstatic StringSERIALIZED_NAME_THREE_D_S_PAYMENT_DATAstatic StringSERIALIZED_NAME_THREE_D_S2_RESPONSE_DATAstatic StringSERIALIZED_NAME_THREE_D_S2_RESULT
-
Constructor Summary
Constructors Constructor Description PaymentResponse()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentResponseaction(PaymentResponseAction action)PaymentResponseadditionalData(Map<String,String> additionalData)PaymentResponseamount(Amount amount)PaymentResponsedonationToken(String donationToken)booleanequals(Object o)PaymentResponsefraudResult(FraudResult fraudResult)static PaymentResponsefromJson(String jsonString)Create an instance of PaymentResponse given an JSON stringPaymentResponseActiongetAction()Get actionMap<String,String>getAdditionalData()Contains additional information about the payment.AmountgetAmount()Get amountStringgetDonationToken()Donation Token containing payment details for Adyen Giving.FraudResultgetFraudResult()Get fraudResultStringgetMerchantReference()The reference to uniquely identify a payment.CheckoutOrderResponsegetOrder()Get orderResponsePaymentMethodgetPaymentMethod()Get paymentMethodStringgetPspReference()Adyen's 16-character string reference associated with the transaction/request.StringgetRefusalReason()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.StringgetRefusalReasonCode()Code that specifies the refusal reason.PaymentResponse.ResultCodeEnumgetResultCode()The result of the payment.ThreeDS2ResponseDatagetThreeDS2ResponseData()Get threeDS2ResponseDataThreeDS2ResultgetThreeDS2Result()Get threeDS2ResultStringgetThreeDSPaymentData()When non-empty, contains a value that you must submit to the `/payments/details` endpoint as `paymentData`.inthashCode()PaymentResponsemerchantReference(String merchantReference)PaymentResponseorder(CheckoutOrderResponse order)PaymentResponsepaymentMethod(ResponsePaymentMethod paymentMethod)PaymentResponsepspReference(String pspReference)PaymentResponseputAdditionalDataItem(String key, String additionalDataItem)PaymentResponserefusalReason(String refusalReason)PaymentResponserefusalReasonCode(String refusalReasonCode)PaymentResponseresultCode(PaymentResponse.ResultCodeEnum resultCode)voidsetAction(PaymentResponseAction action)voidsetAdditionalData(Map<String,String> additionalData)voidsetAmount(Amount amount)voidsetDonationToken(String donationToken)voidsetFraudResult(FraudResult fraudResult)voidsetMerchantReference(String merchantReference)voidsetOrder(CheckoutOrderResponse order)voidsetPaymentMethod(ResponsePaymentMethod paymentMethod)voidsetPspReference(String pspReference)voidsetRefusalReason(String refusalReason)voidsetRefusalReasonCode(String refusalReasonCode)voidsetResultCode(PaymentResponse.ResultCodeEnum resultCode)voidsetThreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData)voidsetThreeDS2Result(ThreeDS2Result threeDS2Result)voidsetThreeDSPaymentData(String threeDSPaymentData)PaymentResponsethreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData)PaymentResponsethreeDS2Result(ThreeDS2Result threeDS2Result)PaymentResponsethreeDSPaymentData(String threeDSPaymentData)StringtoJson()Convert an instance of PaymentResponse to an JSON stringStringtoString()static voidvalidateJsonObject(com.google.gson.JsonObject jsonObj)Validates the JSON Object and throws an exception if issues found
-
-
-
Field Detail
-
SERIALIZED_NAME_ACTION
public static final String SERIALIZED_NAME_ACTION
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_ADDITIONAL_DATA
public static final String SERIALIZED_NAME_ADDITIONAL_DATA
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_AMOUNT
public static final String SERIALIZED_NAME_AMOUNT
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_DONATION_TOKEN
public static final String SERIALIZED_NAME_DONATION_TOKEN
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_FRAUD_RESULT
public static final String SERIALIZED_NAME_FRAUD_RESULT
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_MERCHANT_REFERENCE
public static final String SERIALIZED_NAME_MERCHANT_REFERENCE
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_ORDER
public static final String SERIALIZED_NAME_ORDER
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_PAYMENT_METHOD
public static final String SERIALIZED_NAME_PAYMENT_METHOD
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_PSP_REFERENCE
public static final String SERIALIZED_NAME_PSP_REFERENCE
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_REFUSAL_REASON
public static final String SERIALIZED_NAME_REFUSAL_REASON
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_REFUSAL_REASON_CODE
public static final String SERIALIZED_NAME_REFUSAL_REASON_CODE
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_RESULT_CODE
public static final String SERIALIZED_NAME_RESULT_CODE
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_THREE_D_S2_RESPONSE_DATA
public static final String SERIALIZED_NAME_THREE_D_S2_RESPONSE_DATA
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_THREE_D_S2_RESULT
public static final String SERIALIZED_NAME_THREE_D_S2_RESULT
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_THREE_D_S_PAYMENT_DATA
public static final String SERIALIZED_NAME_THREE_D_S_PAYMENT_DATA
- See Also:
- Constant Field Values
-
-
Method Detail
-
action
public PaymentResponse action(PaymentResponseAction action)
-
getAction
public PaymentResponseAction getAction()
Get action- Returns:
- action
-
setAction
public void setAction(PaymentResponseAction action)
-
additionalData
public PaymentResponse additionalData(Map<String,String> additionalData)
-
putAdditionalDataItem
public PaymentResponse putAdditionalDataItem(String key, String additionalDataItem)
-
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
-
amount
public PaymentResponse amount(Amount amount)
-
getAmount
public Amount getAmount()
Get amount- Returns:
- amount
-
setAmount
public void setAmount(Amount amount)
-
donationToken
public PaymentResponse donationToken(String donationToken)
-
getDonationToken
public String getDonationToken()
Donation Token containing payment details for Adyen Giving.- Returns:
- donationToken
-
setDonationToken
public void setDonationToken(String donationToken)
-
fraudResult
public PaymentResponse fraudResult(FraudResult fraudResult)
-
getFraudResult
public FraudResult getFraudResult()
Get fraudResult- Returns:
- fraudResult
-
setFraudResult
public void setFraudResult(FraudResult fraudResult)
-
merchantReference
public PaymentResponse merchantReference(String merchantReference)
-
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)
-
order
public PaymentResponse order(CheckoutOrderResponse order)
-
getOrder
public CheckoutOrderResponse getOrder()
Get order- Returns:
- order
-
setOrder
public void setOrder(CheckoutOrderResponse order)
-
paymentMethod
public PaymentResponse paymentMethod(ResponsePaymentMethod paymentMethod)
-
getPaymentMethod
public ResponsePaymentMethod getPaymentMethod()
Get paymentMethod- Returns:
- paymentMethod
-
setPaymentMethod
public void setPaymentMethod(ResponsePaymentMethod paymentMethod)
-
pspReference
public PaymentResponse pspReference(String pspReference)
-
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)
-
refusalReason
public PaymentResponse refusalReason(String refusalReason)
-
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)
-
refusalReasonCode
public PaymentResponse refusalReasonCode(String refusalReasonCode)
-
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)
-
resultCode
public PaymentResponse resultCode(PaymentResponse.ResultCodeEnum resultCode)
-
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. * **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)
-
threeDS2ResponseData
public PaymentResponse threeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData)
-
getThreeDS2ResponseData
public ThreeDS2ResponseData getThreeDS2ResponseData()
Get threeDS2ResponseData- Returns:
- threeDS2ResponseData
-
setThreeDS2ResponseData
public void setThreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData)
-
threeDS2Result
public PaymentResponse threeDS2Result(ThreeDS2Result threeDS2Result)
-
getThreeDS2Result
public ThreeDS2Result getThreeDS2Result()
Get threeDS2Result- Returns:
- threeDS2Result
-
setThreeDS2Result
public void setThreeDS2Result(ThreeDS2Result threeDS2Result)
-
threeDSPaymentData
public PaymentResponse threeDSPaymentData(String threeDSPaymentData)
-
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)
-
validateJsonObject
public static void validateJsonObject(com.google.gson.JsonObject jsonObj) throws IOExceptionValidates the JSON Object and throws an exception if issues found- Parameters:
jsonObj- JSON Object- Throws:
IOException- if the JSON Object is invalid with respect to PaymentResponse
-
fromJson
public static PaymentResponse fromJson(String jsonString) throws IOException
Create an instance of PaymentResponse given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of PaymentResponse
- Throws:
IOException- if the JSON string is invalid with respect to PaymentResponse
-
toJson
public String toJson()
Convert an instance of PaymentResponse to an JSON string- Returns:
- JSON string
-
-