Class PaymentRequestDTO

java.lang.Object
org.broadleafcommerce.common.payment.dto.PaymentRequestDTO

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();
 
Author:
Elbert Bautista (elbertbautista)