Purchase Token

A purchase token is used to send purchase information to the Web-Merchant/WM server. This data is encypted using both Secure Sockets Layer (SSL) and Select Pro's own encryption protocol, giving a tamper free way to pass transaction information.

What's Encrypted

Creation procedure

You must first create the COMpurchase object using the Server.CreateObject("Web-Merchant/WM.COMpurchase") method. Next set the Currency, Amount, the ShopperID, the TransactionID, and Installation ID using the appropiate 'set' methods (see below). You can also set optional information such as the customers name, etc.

Once the purchase token is set up (i.e. all information has been added using the 'set' methods), you must call the 'process' method and check for any errors using 'getFirstError' and 'getNextError' methods. Once this has been done call the 'produce' method to create the hyperlink to be placed on your page

When the shopper clicks the hyperlink, he/she is diverted to the payment pages and a callback is sent when the process is complete.

To store the shopper ID and the transaction ID, the 'setShopperID' and 'setTransID' methods must be called. These will then be sent to the server and returned as part of the callback.

Methods:


Method: boolean init(String purchaseURL)
Description: Initialise ready to start constructing a purchase token. This must be called before any other method. Not needed for processing callbacks. Consult the Select integration Guide for more infomation.
Returns: True if initialisation is OK, or false otherwise.
Parameters: The URL of the Web-Merchant/WM WCC server - please see the Select Integerators Guide for more information.

Method: setCartId(String id)
Description: Sets the cart ID. This application specific string, should contain a reference that can be used by your customers to identify the order. This will appear as the first part of the cartId shown to the customer. The Cart ID and the Shopper ID must be be more than 254 characters long in total.
Returns:
Parameters: The Cart ID

Method: setShopperId(String id)
Description: Sets an application specific shopper ID. This will appear as the second part of the cartId shown to the customer. The Cart ID and the Shopper ID must be be more than 254 characters long in total.
Returns:
Parameters: The Shopper ID

Method: SetCurrencyISOCode(String iso)
Description: Sets the currency for this transaction. Consult the Select Integration Guide for a list of ISO codes.
Returns:
Parameters: The currency ISO code

Method: setAmount(double c)
Description: Sets the amount of the purchase in the current currency
Returns:
Parameters: The amount

Method: AddMerchantAccountID(long acid)
Description: Adds a merchant account. For more information please consult the Select Integration Guide.
Returns:
Parameters: The Account ID to add

Method: setTestMode(int mode)
Description: Set the test mode of this tranaction. If set to 100 then a purchase is testmode. It is not obligatory to set this as it defaults to live payment. For more information, please consult the Select Integration Guide.
Returns:
Parameters: The test mode to use

Method: setDescription(String desc)
Description: Sets the description (that the customer sees) for the purchase. It is not obligatory to set this. For more information, please consult the Select Integration Guide.
Returns:
Parameters: The description of the transaction

Method: setName(String name)
Description: Sets the name of the customer. It is not obligatory to set this. For more information, please consult the Select Integration Guide.
Returns:
Parameters: The name of the customer

Method: setAddress(String add)
Description: Sets the address of the customer. It is not obligatory to set this. For more information please consult the Select Integration Guide.
Returns:
Parameters: The address of the customer

Method: setPostcode(String pc)
Description: Sets the postcode of the customer. It is not obligatory to set this. For more information please consult the Select Integration Guide.
Returns:
Parameters: The postcode of the customer

Method: setCountryISOCode(String iso)
Description: Sets the standard ISO code for the customer. It is not obligatory to set this. For more information please consult the Select Integration Guide.
Returns:
Parameters: The standard country ISO code

Method: setTelephone(String tel)
Description: Sets the customers telephone number. It is not obligatory to set this. For more information please consult the Select Integration Guide.
Returns:
Parameters: The telephone number of the customer

Method: setFax(String fax)
Description: Sets the fax number of the customer. It is not obligatory to set this. For more information please consult the Select Integration Guide.
Returns:
Parameters: The fax number of the customer

Method: setEmail(String email)
Description: Sets the customers Email address. It is not obligatory to set this. For more information please consult the Select Integration Guide.
Returns:
Parameters: The email address of the customer

Method: boolean process()
Description: Processes the information that has been entered. This function must be called before 'produce'. The errors can be examined by calling 'getFirstError()' and 'getNextError()'
Returns: False if an error is encountered, True otherwise.
Parameters: none