public class PaymentRequestDTO extends Object
A DTO that is comprised of all the information that is sent to a Payment Gateway to complete a transaction. This DTO uses a modified builder pattern in order to provide an easy way of constructing the request. You can construct a DTO using the following notation:
IMPORTANT: note that some of the convenience methods generate a new instance of the object. (e.g. billTo, shipTo, etc...) So, if you need to modify the shipping or billing information after you have invoked requestDTO.shipTo()..., use the getShipTo() method to append more information. Otherwise, you will overwrite the shipping information with a new instance.
PaymentRequestDTO requestDTO = new PaymentRequestDTO()
.orderId(referenceNumber)
.customer()
.customerId("1")
.done()
.shipTo()
.addressFirstName("Bill")
.addressLastName("Broadleaf")
.addressLine1("123 Test Dr.")
.addressCityLocality("Austin")
.addressStateRegion("TX")
.addressPostalCode("78759")
.done()
.billTo()
.addressFirstName("Bill")
.addressLastName("Broadleaf")
.addressLine1("123 Test Dr.")
.addressCityLocality("Austin")
.addressStateRegion("TX")
.addressPostalCode("78759")
.done()
.shippingTotal("0")
.taxTotal("0")
.orderCurrencyCode("USD")
.orderDescription("My Order Description")
.orderSubtotal("10.00")
.transactionTotal("10.00")
.lineItem()
.name("My Product")
.description("My Product Description")
.shortDescription("My Product Short Description")
.systemId("1")
.amount("10.00")
.quantity("1")
.itemTotal("10.00")
.tax("0")
.total("10.00")
.done();
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
additionalFields |
protected AddressDTO<PaymentRequestDTO> |
billTo |
protected boolean |
completeCheckoutOnCallback |
protected CreditCardDTO<PaymentRequestDTO> |
creditCard |
protected GatewayCustomerDTO<PaymentRequestDTO> |
customer |
protected List<CustomerCreditDTO<PaymentRequestDTO>> |
customerCredits |
protected PaymentGatewayRequestType |
gatewayRequestType |
protected List<GiftCardDTO<PaymentRequestDTO>> |
giftCards |
protected List<LineItemDTO> |
lineItems |
protected String |
orderCurrencyCode |
protected String |
orderDescription |
protected String |
orderId |
protected String |
orderSubtotal |
protected PaymentType |
paymentType |
protected String |
shippingTotal |
protected AddressDTO<PaymentRequestDTO> |
shipTo |
protected SubscriptionDTO<PaymentRequestDTO> |
subscription |
protected String |
taxTotal |
protected String |
transactionTotal |
Constructor and Description |
---|
PaymentRequestDTO() |
protected GatewayCustomerDTO<PaymentRequestDTO> customer
protected AddressDTO<PaymentRequestDTO> shipTo
protected AddressDTO<PaymentRequestDTO> billTo
protected CreditCardDTO<PaymentRequestDTO> creditCard
protected SubscriptionDTO<PaymentRequestDTO> subscription
protected List<GiftCardDTO<PaymentRequestDTO>> giftCards
protected List<CustomerCreditDTO<PaymentRequestDTO>> customerCredits
protected List<LineItemDTO> lineItems
protected String orderId
protected String orderCurrencyCode
protected String orderDescription
protected String orderSubtotal
protected String shippingTotal
protected String taxTotal
protected String transactionTotal
protected PaymentType paymentType
protected PaymentGatewayRequestType gatewayRequestType
protected boolean completeCheckoutOnCallback
public GatewayCustomerDTO<PaymentRequestDTO> customer()
public CreditCardDTO<PaymentRequestDTO> creditCard()
public SubscriptionDTO<PaymentRequestDTO> subscription()
public AddressDTO<PaymentRequestDTO> shipTo()
public AddressDTO<PaymentRequestDTO> billTo()
public GiftCardDTO<PaymentRequestDTO> giftCard()
public CustomerCreditDTO<PaymentRequestDTO> customerCredit()
public LineItemDTO lineItem()
public PaymentRequestDTO additionalField(String key, Object value)
public PaymentRequestDTO orderId(String orderId)
public PaymentRequestDTO orderCurrencyCode(String orderCurrencyCode)
public PaymentRequestDTO orderDescription(String orderDescription)
public PaymentRequestDTO orderSubtotal(String orderSubtotal)
public PaymentRequestDTO shippingTotal(String shippingTotal)
public PaymentRequestDTO taxTotal(String taxTotal)
public PaymentRequestDTO transactionTotal(String transactionTotal)
public PaymentRequestDTO paymentType(PaymentType paymentType)
public PaymentRequestDTO gatewayRequestType(PaymentGatewayRequestType gatewayRequestType)
public PaymentRequestDTO completeCheckoutOnCallback(boolean completeCheckoutOnCallback)
public List<LineItemDTO> getLineItems()
public List<GiftCardDTO<PaymentRequestDTO>> getGiftCards()
public List<CustomerCreditDTO<PaymentRequestDTO>> getCustomerCredits()
public AddressDTO<PaymentRequestDTO> getShipTo()
public AddressDTO<PaymentRequestDTO> getBillTo()
public CreditCardDTO<PaymentRequestDTO> getCreditCard()
public SubscriptionDTO<PaymentRequestDTO> getSubscription()
public GatewayCustomerDTO<PaymentRequestDTO> getCustomer()
public String getOrderId()
public String getOrderCurrencyCode()
public String getOrderDescription()
public String getOrderSubtotal()
public String getShippingTotal()
public String getTaxTotal()
public String getTransactionTotal()
public PaymentType getPaymentType()
public PaymentGatewayRequestType getGatewayRequestType()
public boolean isCompleteCheckoutOnCallback()
public boolean shipToPopulated()
public boolean billToPopulated()
public boolean creditCardPopulated()
public boolean customerPopulated()
public boolean subscriptionPopulated()
Copyright © 2022. All rights reserved.