org.locomotive.commerce.ics
Class ICSRequest

java.lang.Object
  |
  +--org.locomotive.commerce.ics.ICSRequest

public class ICSRequest
extends java.lang.Object

A wrapper class for generating proper SCMPMessages. This implementation is not written to support access by multiple concurrent threads, so it is suggested that you avoid doing it. Also, Cybersource does not recommend adding more than 32 offers to SCMPMessage via their C library, and therefore we don't recommend it here either. :-) The characters ':', '^', ',' (colon, caret, comma) must not be in any of the names or values, as they are used by the underlying transport mechanism as field separators. There is no known way to escape these characters - don't use them. The addField () calls used internally are not always checked to see if they fail. With the exception of low memory circumstances, this should not be a problem. Please see the Cybersource CommerceFLEX API documentation for more information.


Constructor Summary
ICSRequest(boolean debug_on, java.lang.String hostname, java.lang.String keyname)
           
 
Method Summary
 void addField(java.lang.String name, java.lang.String value)
          The following method allows you to add your own fields to the SCMP message.
 void addOffer(Offer next_offer)
          adds the specified offer to the list (Vector) of offers associated with this ICSRequest.
 void clearOffers()
          deletes or removes any offers that were added to this request.
 void requestBill(java.lang.String ordernumber)
          request the ICS service "ics_bill"
 void requestBill(java.lang.String ordernumber, java.lang.String totalamount)
          request the ICS service "ics_bill" for the specified amount
 void requestCredit(java.lang.String ordernumber, java.lang.String totalamount)
          request the ICS service "ics_credit"
 void requestDownload()
           
 void requestExportCheck()
          request the ICS service "ics_export"
 void requestFraudScore(java.lang.String ipaddress)
          request that the fraud score be generated.
 void requestFulfillmentNotify(java.lang.String who)
          request that the fulfillment house be notified.
 void requestPreApp()
          request the ICS service "ics_preapp" Requesting this service is necessary before any funds can be transferred from customer credit cards to the account of the merchant.
 void requestTaxCalculation()
          request the tax calculation service.
 ICSReply send()
          sends the request to the
 void setBuyerInfo(java.lang.String firstname, java.lang.String lastname, java.lang.String email, java.lang.String phone, java.lang.String address1, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String country, java.lang.String ccnum, java.lang.String expmo, java.lang.String expyr)
          Necessary for any order.
 void setComment(java.lang.String comment, int field_no)
          set one of the 8 comment fields.
 void setComments(java.lang.String comments)
          set the comment field.
 void setOptionalBuyerInfo(java.lang.String company, java.lang.String address2)
          Optional information to accompany an order.
 void setShipAddress(java.lang.String shipaddress1, java.lang.String shipaddress2, java.lang.String shipcity, java.lang.String shipstate, java.lang.String shipzip, java.lang.String shipcountry)
          Set optional Shipping address information.
 void setSubRefNumber(java.lang.String sub_ref_no)
          the SubRefNumber will be passed along to the fulfillment house.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICSRequest

public ICSRequest(boolean debug_on,
                  java.lang.String hostname,
                  java.lang.String keyname)
           throws SCMPException
Method Detail

requestBill

public void requestBill(java.lang.String ordernumber)
request the ICS service "ics_bill"

requestBill

public void requestBill(java.lang.String ordernumber,
                        java.lang.String totalamount)
request the ICS service "ics_bill" for the specified amount

requestCredit

public void requestCredit(java.lang.String ordernumber,
                          java.lang.String totalamount)
request the ICS service "ics_credit"

requestExportCheck

public void requestExportCheck()
request the ICS service "ics_export"

requestPreApp

public void requestPreApp()
request the ICS service "ics_preapp" Requesting this service is necessary before any funds can be transferred from customer credit cards to the account of the merchant.

setBuyerInfo

public void setBuyerInfo(java.lang.String firstname,
                         java.lang.String lastname,
                         java.lang.String email,
                         java.lang.String phone,
                         java.lang.String address1,
                         java.lang.String city,
                         java.lang.String state,
                         java.lang.String zip,
                         java.lang.String country,
                         java.lang.String ccnum,
                         java.lang.String expmo,
                         java.lang.String expyr)
Necessary for any order. There are limits on value sizes:

setOptionalBuyerInfo

public void setOptionalBuyerInfo(java.lang.String company,
                                 java.lang.String address2)
Optional information to accompany an order.

addField

public void addField(java.lang.String name,
                     java.lang.String value)
The following method allows you to add your own fields to the SCMP message. Use at your own discretion! Make sure that you're not redefining already existing ICS fields. An example of using this method might be adding the credit card type for the fulfillment house, for their accounting purposes. In that case, you would call this method by saying:
    ics_req.addField ("cctype", "visa");
In this example, "cctype" is not a field that is defined in ICS.

setShipAddress

public void setShipAddress(java.lang.String shipaddress1,
                           java.lang.String shipaddress2,
                           java.lang.String shipcity,
                           java.lang.String shipstate,
                           java.lang.String shipzip,
                           java.lang.String shipcountry)
Set optional Shipping address information.

setComments

public void setComments(java.lang.String comments)
set the comment field.

setComment

public void setComment(java.lang.String comment,
                       int field_no)
set one of the 8 comment fields.
Parameters:
comment - the comment to enter
field_no - the comment field to enter the comment into. Can be from 0 to 7.

setSubRefNumber

public void setSubRefNumber(java.lang.String sub_ref_no)
the SubRefNumber will be passed along to the fulfillment house. The specific contents of this field should be determined by the merchant and the fulfillment house.

addOffer

public void addOffer(Offer next_offer)
adds the specified offer to the list (Vector) of offers associated with this ICSRequest.

clearOffers

public void clearOffers()
deletes or removes any offers that were added to this request.

requestFulfillmentNotify

public void requestFulfillmentNotify(java.lang.String who)
request that the fulfillment house be notified. Typically this is used when doing an 'ics_bill'.

requestDownload

public void requestDownload()

requestFraudScore

public void requestFraudScore(java.lang.String ipaddress)
request that the fraud score be generated. Valid score metrics will be generated for each offer.

requestTaxCalculation

public void requestTaxCalculation()
request the tax calculation service. Each offer may require additional tax fields to be set.

send

public ICSReply send()
              throws SCMPException
sends the request to the