public class PaymentResponse extends Object implements Serializable
The DTO object that represents the response coming back from any call to the Gateway. This can either wrap an API result call or a translated HTTP Web response. This can not only be the results of a transaction, but also a request for a Secure Token etc...
Note: the success and validity flags are set to true by default, unless otherwise overridden by specific gateway implementations
Constructor and Description |
---|
PaymentResponse() |
PaymentResponse(PaymentType paymentType,
PaymentGatewayType gatewayType) |
Modifier and Type | Method and Description |
---|---|
PaymentResponse |
amount(javax.money.MonetaryAmount amount) |
Address<PaymentResponse> |
billTo() |
PaymentResponse |
completeCheckoutOnCallback(boolean completeCheckoutOnCallback) |
CreditCard<PaymentResponse> |
creditCard() |
GatewayCustomer<PaymentResponse> |
customer() |
PaymentResponse |
customer(GatewayCustomer<PaymentResponse> customer) |
CustomerCredit<PaymentResponse> |
customerCredit() |
PaymentResponse |
dateRecorded(Instant dateRecorded) |
PaymentResponse |
declineType(String declineType) |
PaymentResponse |
failureType(String failureType) |
PaymentResponse |
gatewayResponseCode(String gatewayResponseCode) |
javax.money.MonetaryAmount |
getAmount() |
Address<PaymentResponse> |
getBillTo()
The billing address associated with this transaction
|
CreditCard<PaymentResponse> |
getCreditCard()
for sale/authorize transactions, this will be the Credit Card object that was charged.
|
GatewayCustomer<PaymentResponse> |
getCustomer()
Any customer information that relates to this transaction
|
List<CustomerCredit<PaymentResponse>> |
getCustomerCredits()
Any customer credit accounts that have been processed.
|
Instant |
getDateRecorded()
The timestamp when this transaction response was recorded
|
String |
getDeclineType()
The type of transaction decline (hard vs soft decline)
|
String |
getFailureType()
The type of transaction failure (
TransactionFailureType ). |
String |
getGatewayResponseCode()
The response code provided by the payment gateway which may represent a success or failure
|
List<GiftCard<PaymentResponse>> |
getGiftCards()
Any gift cards that have been processed.
|
String |
getMessage()
Message describing the result of the transaction
|
String |
getOrderId()
The Order ID that this transaction is associated with
|
PaymentGatewayType |
getPaymentGatewayType()
The Payment Gateway Type that this transaction response represents
|
String |
getPaymentId()
The Payment ID that this transaction is associated with
|
String |
getPaymentToken()
If this is a Tokenization request, this will hold the token sent back from the gateway
|
PaymentType |
getPaymentType()
The Type of Payment that this transaction response represents
|
String |
getRawResponse()
A string representation of the response that came from the gateway.
|
Map<String,String> |
getResponseMap()
A more convenient representation of
rawResponse to hold the response from the
gateway. |
Address<PaymentResponse> |
getShipTo()
If shipping information is captured on the gateway, the values sent back will be put here
|
String |
getThreeDSecureVerificationUrl()
The gateway-provided url where the customer must verify that they are in fact the owner of
the payment method.
|
String |
getTransactionReferenceId()
The transaction reference that is passed to the payment gateway.
|
TransactionType |
getTransactionType()
The Transaction Type of the Payment that this response represents
|
GiftCard<PaymentResponse> |
giftCard() |
boolean |
isCompleteCheckoutOnCallback()
Sets whether or not this module should complete checkout on callback.
|
boolean |
isSuccessful()
Whether or not the transaction on the gateway was successful.
|
boolean |
isValid()
Whether or not this response was tampered with.
|
PaymentResponse |
message(String message) |
PaymentResponse |
orderId(String orderId) |
PaymentResponse |
paymentGatewayType(PaymentGatewayType paymentGatewayType) |
PaymentResponse |
paymentId(String paymentId) |
PaymentResponse |
paymentToken(String paymentToken) |
PaymentResponse |
paymentType(PaymentType paymentType) |
PaymentResponse |
rawResponse(String rawResponse) |
PaymentResponse |
responseMap(String key,
String value) |
Address<PaymentResponse> |
shipTo() |
PaymentResponse |
successful(boolean successful) |
PaymentResponse |
threeDSecureVerificationUrl(String threeDSecureVerificationUrl) |
PaymentResponse |
transactionReferenceId(String transactionReferenceId) |
PaymentResponse |
transactionType(TransactionType transactionType) |
PaymentResponse |
valid(boolean valid) |
public PaymentResponse(PaymentType paymentType, PaymentGatewayType gatewayType)
public PaymentResponse()
public PaymentResponse customer(GatewayCustomer<PaymentResponse> customer)
public GatewayCustomer<PaymentResponse> customer()
public CreditCard<PaymentResponse> creditCard()
public Address<PaymentResponse> shipTo()
public Address<PaymentResponse> billTo()
public GiftCard<PaymentResponse> giftCard()
public CustomerCredit<PaymentResponse> customerCredit()
public PaymentResponse responseMap(String key, String value)
public PaymentResponse orderId(String orderId)
public PaymentResponse paymentId(String paymentId)
public PaymentResponse amount(javax.money.MonetaryAmount amount)
public PaymentResponse paymentToken(String paymentToken)
public PaymentResponse transactionReferenceId(String transactionReferenceId)
public PaymentResponse gatewayResponseCode(String gatewayResponseCode)
public PaymentResponse message(String message)
public PaymentResponse threeDSecureVerificationUrl(String threeDSecureVerificationUrl)
public PaymentResponse failureType(String failureType)
public PaymentResponse declineType(String declineType)
public PaymentResponse dateRecorded(Instant dateRecorded)
public PaymentResponse paymentGatewayType(PaymentGatewayType paymentGatewayType)
public PaymentResponse paymentType(PaymentType paymentType)
public PaymentResponse transactionType(TransactionType transactionType)
public PaymentResponse successful(boolean successful)
public PaymentResponse completeCheckoutOnCallback(boolean completeCheckoutOnCallback)
public PaymentResponse valid(boolean valid)
public PaymentResponse rawResponse(String rawResponse)
public GatewayCustomer<PaymentResponse> getCustomer()
public Address<PaymentResponse> getShipTo()
public Address<PaymentResponse> getBillTo()
public CreditCard<PaymentResponse> getCreditCard()
public List<GiftCard<PaymentResponse>> getGiftCards()
public List<CustomerCredit<PaymentResponse>> getCustomerCredits()
public PaymentGatewayType getPaymentGatewayType()
public PaymentType getPaymentType()
public TransactionType getTransactionType()
public String getTransactionReferenceId()
public String getOrderId()
public String getPaymentId()
public javax.money.MonetaryAmount getAmount()
public String getPaymentToken()
public String getMessage()
public String getGatewayResponseCode()
public String getThreeDSecureVerificationUrl()
public String getFailureType()
TransactionFailureType
).public String getDeclineType()
public Instant getDateRecorded()
public boolean isSuccessful()
public boolean isValid()
public boolean isCompleteCheckoutOnCallback()
Sets whether or not this module should complete checkout on callback. In most Credit Card gateway implementation, this should be set to 'TRUE' and should not be configurable as the gateway expects it to tbe the final step in the checkout process.
In gateways where it does not expect to be the last step in the checkout process, for example BLC Gift Card Module, PayPal Express Checkout, etc... The callback from the gateway can be configured whether or not to complete checkout.
public String getRawResponse()
responseMap
.public Map<String,String> getResponseMap()
rawResponse
to hold the response from the
gateway.Copyright © 2021. All rights reserved.