Class PaymentRequestDTO
java.lang.Object
org.broadleafcommerce.common.payment.dto.PaymentRequestDTO
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();
- Author:
- Elbert Bautista (elbertbautista)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AddressDTO<PaymentRequestDTO>
protected boolean
protected CreditCardDTO<PaymentRequestDTO>
protected GatewayCustomerDTO<PaymentRequestDTO>
protected List<CustomerCreditDTO<PaymentRequestDTO>>
protected PaymentGatewayRequestType
protected List<GiftCardDTO<PaymentRequestDTO>>
protected List<LineItemDTO>
protected String
protected String
protected String
protected String
protected PaymentType
protected String
protected AddressDTO<PaymentRequestDTO>
protected SubscriptionDTO<PaymentRequestDTO>
protected String
protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadditionalField
(String key, Object value) billTo()
You should only call this once, as it will create a new bill to address if called more than once.boolean
completeCheckoutOnCallback
(boolean completeCheckoutOnCallback) You should only call this once, as it will create a new credit card if called more than once.boolean
customer()
You should only call this once, as it will create a new customer if called more than once.You should only call this once, as it will create a new gift card if called more than once.boolean
gatewayRequestType
(PaymentGatewayRequestType gatewayRequestType) giftCard()
You should only call this once, as it will create a new gift card if called more than once.boolean
lineItem()
orderCurrencyCode
(String orderCurrencyCode) orderDescription
(String orderDescription) orderSubtotal
(String orderSubtotal) paymentType
(PaymentType paymentType) shippingTotal
(String shippingTotal) shipTo()
You should only call this once, as it will create a new customer if called more than once.boolean
You should only call this once, as it will create a new subscription if called more than once.boolean
transactionTotal
(String transactionTotal)
-
Field Details
-
customer
-
shipTo
-
billTo
-
creditCard
-
subscription
-
giftCards
-
customerCredits
-
lineItems
-
additionalFields
-
orderId
-
orderCurrencyCode
-
orderDescription
-
orderSubtotal
-
shippingTotal
-
taxTotal
-
transactionTotal
-
paymentType
-
gatewayRequestType
-
completeCheckoutOnCallback
protected boolean completeCheckoutOnCallback
-
-
Constructor Details
-
PaymentRequestDTO
public PaymentRequestDTO()
-
-
Method Details
-
customer
You should only call this once, as it will create a new customer if called more than once. Use the getter if you need to append more information later. -
creditCard
You should only call this once, as it will create a new credit card if called more than once. Use the getter if you need to append more information later. -
subscription
You should only call this once, as it will create a new subscription if called more than once. Use the getter if you need to append more information later. -
shipTo
You should only call this once, as it will create a new customer if called more than once. Use the getter if you need to append more information later. -
billTo
You should only call this once, as it will create a new bill to address if called more than once. Use the getter if you need to append more information later. -
giftCard
You should only call this once, as it will create a new gift card if called more than once. Use the getter if you need to append more information later. -
customerCredit
You should only call this once, as it will create a new gift card if called more than once. Use the getter if you need to append more information later. -
lineItem
-
additionalField
-
orderId
-
orderCurrencyCode
-
orderDescription
-
orderSubtotal
-
shippingTotal
-
taxTotal
-
transactionTotal
-
paymentType
-
gatewayRequestType
-
completeCheckoutOnCallback
-
getLineItems
-
getGiftCards
-
getCustomerCredits
-
getShipTo
-
getBillTo
-
getCreditCard
-
getSubscription
-
getCustomer
-
getAdditionalFields
-
getOrderId
-
getOrderCurrencyCode
-
getOrderDescription
-
getOrderSubtotal
-
getShippingTotal
-
getTaxTotal
-
getTransactionTotal
-
getPaymentType
-
getGatewayRequestType
-
isCompleteCheckoutOnCallback
public boolean isCompleteCheckoutOnCallback() -
shipToPopulated
public boolean shipToPopulated() -
billToPopulated
public boolean billToPopulated() -
creditCardPopulated
public boolean creditCardPopulated() -
customerPopulated
public boolean customerPopulated() -
subscriptionPopulated
public boolean subscriptionPopulated()
-