Sending a Purchase to Web-Merchant/WM

When a shopper is ready to pay for his purchases your shopping site should present him with a button or link that submits the data describing the payment to the Web-Merchant/WM server. This data can present the payment as a single total price or as a series of items describing a shopping basket, with optional tax and shipping items. In the latter case Web-Merchant/WM do all the necessary calculations for the total price. This can be used to provide a simple shopping basket facility on a totally static site. [Note that this shopping basket facility will not be available until later].

An example Payment submission page

The following form is an example of the data submitted to Web-Merchant/WM for a single-item payment. If you are using Select Pro or Select COM then much of this information is encapsulated in the "Purchase Token" rather than as separate hidden fields. See the appropriate documentation for details on constructing the purchase token.

A full list of all the fields that can be submitted to initiate a payment can be found in the section Web-Merchant/WM Parameters. Note that this list indicates that only some parameters are required. Many are optional.

If you supply contact details for the shopper then these are automatically placed into any contact details forms that the shopper would be required to fill in on the Web-Merchant/WM server. Hence, if you have asked the shopper for this information then it is best to submit it to us to prevent him having to type it again. Alternatively, you can rely on the contact details that are returned to you in the payment response and not gather these details on your site.

<form action="https://select.WM.com/wcc/purchase"
method=POST>
<input type=hidden name="instId" value="1234">
<input type=hidden name="cartId" value="101KT0098">
<input type=hidden name="amount" value="25.35">
<input type=hidden name="currency" value="FRF">
<input type=hidden name="desc" value="Socks, Black cotton">
<input type=hidden name="testMode" value="100">
<input type=hidden name="name" value="J. Bloggs">
<input type=hidden name="address" value="4 Any St,&#10;Somewhere">
<input type=hidden name="postcode" value="AB10 5AB">
<input type=hidden name="country" value="GB">
<input type=hidden name="tel" value="0123456789">
<input type=hidden name="email" value="demo@uk.WM.com">
<input type=submit value="Buy This">
</form>

Test Mode

When you are testing your site you should use a value for testMode that is greater than 0. Your transactions will be put through a test account rather than a live account, and you will be able to access all the Web-Merchant/WM account management facilities for this test account. This enables you to get a realistic sense of the whole payment processing procedure via Web-Merchant/WM, without any money ever changing hands. See Testing Your Installation for further details.

Preferred Accounts

Most merchants are unlikely to need to specify preferred accounts for a transaction. Web-Merchant/WM automatically selects an account suitable for processing the transaction, based on the test mode and the currency of the transaction.

Preferred accounts become relevant when you have accounts with identical characteristics to be used for different purposes. For example, you may have one Sterling account for software sales and another for hardware. Payments submitted to Web-Merchant/WM for software will need to specify the software account and similarly for hardware. If you do not specify which then Web-Merchant/WM selects whichever is found first in the database. You specify accounts to be used by setting the parameters accId1, accId2 etc. These accounts are tried in the specified order until one suitable for the payment is found. If none of the specified accounts matches then Web-Merchant/WM goes on to try any others you may have. Hence these parameters specify a preference rather than an absolute list of accounts to use.
Back to contents page

$Revision: 1.13 $