Class TransactionRequest

    • Constructor Detail

      • TransactionRequest

        public TransactionRequest()
        Creates an empty TransactionRequest. The values should be set using the appropriate setter methods.
    • Method Detail

      • getTestMode

        public boolean getTestMode()
        Gets the test mode for this transaction.
      • setTestMode

        public void setTestMode​(boolean testMode)
        Sets the test mode for this transaction.
      • getCustomerIp

        public String getCustomerIp()
        Gets the customer IP
      • setCustomerIp

        public void setCustomerIp​(String customerIp)
        Sets the customer IP
      • getDuplicateWindow

        public int getDuplicateWindow()
        Gets the duplicate detection window in seconds. Defaults to DEFAULT_DUPLICATE_WINDOW seconds.
      • setDuplicateWindow

        public void setDuplicateWindow​(int duplicateWindow)
        Sets the duplicate detenction window in seconds.
      • getOrderNumber

        public String getOrderNumber()
        Gets the unique order number.
      • setOrderNumber

        public void setOrderNumber​(String orderNumber)
        Sets the unique order number.
      • getCurrency

        public Currency getCurrency()
        Gets the currency for this transaction.
      • setCurrency

        public void setCurrency​(Currency currency)
        Sets the currency code for this transaction. The currency should be set before the monetary amounts in order to properly scale the amounts. If the currency is reset, the amounts will be scaled. This may result in an ArithmentException.
      • setAmount

        public void setAmount​(BigDecimal amount)
                       throws IllegalArgumentException
        Sets the amount of the transaction. This amount should not include any tax, shipping charges, or duty. Thus the total amount of the transaction is the amount + taxAmount + shippingAmount + dutyAmount. The amount is normalized to the proper number of decimal places for the selected currency.
        Throws:
        IllegalArgumentException - if amount <= 0 or is incorrectly formatted for the currency.
      • getTaxAmount

        public BigDecimal getTaxAmount()
        Gets the tax amount of the transaction.
      • setTaxAmount

        public void setTaxAmount​(BigDecimal taxAmount)
        Sets the tax amount of the transaction. The amount is normalized to the proper number of decimal places for the selected currency.
        Throws:
        IllegalArgumentException - if taxAmount < 0 or is incorrectly formatted for the currency.
      • getTaxExempt

        public boolean getTaxExempt()
        Gets the tax exempt flag.
      • setTaxExempt

        public void setTaxExempt​(boolean taxExempt)
        Set the tax exempt flag.
      • getShippingAmount

        public BigDecimal getShippingAmount()
        Gets the shipping amount of the transaction.
      • setShippingAmount

        public void setShippingAmount​(BigDecimal shippingAmount)
        Sets the shipping amount of the transaction. The amount is normalized to the proper number of decimal places for the selected currency.
        Throws:
        IllegalArgumentException - if shippingAmount < 0 or is incorrectly formatted for the currency.
      • getDutyAmount

        public BigDecimal getDutyAmount()
        Gets the duty charges of the transaction.
      • setDutyAmount

        public void setDutyAmount​(BigDecimal dutyAmount)
        Sets the duty charges of the transaction. The amount is normalized to the proper number of decimal places for the selected currency.
        Throws:
        IllegalArgumentException - if dutyAmount < 0 or is incorrectly formatted for the currency.
      • getTotalAmount

        public BigDecimal getTotalAmount()
        Adds-up all amounts into a total amount.
        Returns:
        amount + tax + shipping + duty
      • getShippingFirstName

        public String getShippingFirstName()
        Gets the first name of the recipient.
      • setShippingFirstName

        public void setShippingFirstName​(String shippingFirstName)
        Trims and sets the first name of the recipient.
      • getShippingLastName

        public String getShippingLastName()
        Gets the last name of the recipient.
      • setShippingLastName

        public void setShippingLastName​(String shippingLastName)
        Trims and sets the last name of the recipient.
      • getShippingCompanyName

        public String getShippingCompanyName()
        Gets the company name of the recipient.
      • setShippingCompanyName

        public void setShippingCompanyName​(String shippingCompanyName)
        Trims and sets the company name of the recipient.
      • getShippingStreetAddress1

        public String getShippingStreetAddress1()
        Gets the shipping street address (first line).
      • setShippingStreetAddress1

        public void setShippingStreetAddress1​(String shippingStreetAddress1)
        Trims and sets the shipping street address (first line).
      • getShippingStreetAddress2

        public String getShippingStreetAddress2()
        Gets the shipping street address (second line).
      • setShippingStreetAddress2

        public void setShippingStreetAddress2​(String shippingStreetAddress2)
        Trims and sets the shipping street address (second line).
      • getShippingCity

        public String getShippingCity()
        Gets the shipping city.
      • setShippingCity

        public void setShippingCity​(String shippingCity)
        Trims and sets the shipping city.
      • getShippingState

        public String getShippingState()
        Gets the shipping state/province/prefecture.
      • setShippingState

        public void setShippingState​(String shippingState)
        Trims and sets the shipping state/province/prefecture.
      • getShippingPostalCode

        public String getShippingPostalCode()
        Gets the shipping postal code.
      • setShippingPostalCode

        public void setShippingPostalCode​(String shippingPostalCode)
        Trims and sets the shipping postal code.
      • getEmailCustomer

        public boolean getEmailCustomer()
        Gets the flag indicating if the customer will be emailed directly by the payment gateway.
      • setEmailCustomer

        public void setEmailCustomer​(boolean emailCustomer)
        Sets the flag indicating if the customer will be emailed directly by the payment gateway.
      • getMerchantEmail

        public String getMerchantEmail()
        Gets the merchant email address that will be emailed a copy of the customer email directly by the payment gateway.
      • setMerchantEmail

        public void setMerchantEmail​(String merchantEmail)
        Trims and sets the merchant email address that will be emailed a copy of the customer email directly by the payment gateway.
        Throws:
        IllegalArgumentException - if the address does is not in the proper format
      • getInvoiceNumber

        public String getInvoiceNumber()
        Gets the merchant-assigned invoice number.
      • setInvoiceNumber

        public void setInvoiceNumber​(String invoiceNumber)
        Sets the merchant-assigned invoice number.
      • getPurchaseOrderNumber

        public String getPurchaseOrderNumber()
        Gets the purchase order number.
      • setPurchaseOrderNumber

        public void setPurchaseOrderNumber​(String purchaseOrderNumber)
        Sets the purchase order number.
      • getDescription

        public String getDescription()
        Gets the merchant-assigned description.
      • setDescription

        public void setDescription​(String description)
        Sets the merchant-assigned description.