![]() |
[SECPay services]
-> SECCard Manual
| Index |
| Normal Processing |
| Synchronous processing |
| Server side processing |
| Batch Processing |
| Parameters |
| Applet |
| Customer Field Encryption |
| Post Code Format Verification |
| Example Calls |
| XML Calls |
| Trouble with Thawte Certificates |
|
Normal Processing Details SECPay will host the 'checkout' process on our secure server. No sensitive data will be sent over the Internet without being encrypted using Secure Sockets Layer (SSL). SECPay capture the card payment details as the last step in the sales process through our card details input template, and if authorisation is successful the merchant must supply the goods/services that he has agreed to sell to the customer in accordance with the agreed conditions of sale. The merchant should embed a simple form into his site with a number of fields (normally hidden), this form will POST the following items of information to the SECPay secure server using the following SECPay servlet.
This servlet forms the basis of all authorisation requests to SECPay whether using this normal process, or other more sophisticated methods. A test form for viewing the effects of altering the values of the fields posted to the ValCard servlet can be found at the following URL: |
|
PLEASE NOTE : When testing your interface either use a merchant id of 'test' or use either 'secpay' or your merchant_id and a setting of 'test_status' in the options parameter explained below . Until your merchant account has been set up by the bank your merchant identifier will not work except with test status. Remove the test_status setting from the options parameter when you go live OR set it to 'live' otherwise no transactions will be forwarded to the bank. Preferably, MAKE SURE YOU REMOVE IT ENTIRELY (setting it to false will not make your site live). If you must keep it, then set it to 'live' (it will be removed by our server). Customers that forward transactions to SECPay from a single IP address or send us more than three transactions any one hour from any one IP address must let us know their IP addresses or transactions will be blocked as they will be retreated as fraud. |
| merchant | The merchant identifier is assigned by us and we use it in turn to lookup your merchant number and other details (to give added security). The merchant number supplied by the bank is never exposed to the Internet. |
| trans_id | This is an identifier that you use to track this authorisation. Any string can be used as long as it does not contain spaces, spaces will be changed to '_' characters so are best avoided. |
| amount | The total amount required for authorisation against the customers card. Please do not supply more than the prescribed number of decimal places as we will reject the transaction. |
| callback |
This is the processing code secpay is required to call when we have completed the authorisation process. The resulting html output from the callback is presented relative to the authorisation server, and therefore you should not include any relative path graphics or links, as these will not work. Use absolute URLS. Also note, that any graphics included in the html output of your callback, or any redirects will cause a security warning to display to the customer before they know of the results of the transaction, unless they are located on a secure server. The normal process call to a callback is a GET, but can be modified to a POST within the options parameter. Callback can be viewed as two possible scenarios., static response to success or failure, or active code which processes the results of the parameters passed. Scenario 1: In the first scenario of static response, two scripts can be specified for success and failure, the first script being for success and the second for failure e.g. callback=http://www.mysite.com/successcallback.html;http://www.mysite.com/failcallback.html Scenario 2: (See also the section on callback parameters) In the second scenario, active code is parsing and processing the parameters passed back to the callback script. This code would normally be written in cgi/servlet/asp/javascript etc, and will be expected to receive a number of parameters. The 'valid' parameter will always be set to 'true' or 'false' depending on the success or failure of the authorisation. This must be trapped by your cgi/servlet/asp/script/javascript etc, and you must generate your own response html in the normal way for such methods. In any case it is the responsibility of your cgi/servlet/asp/script to proceed with the sale or cancel the sale as appropriate. Some examples are available
for you to use as templates here in zip
format or here in Unix tar format.
You can also supply your own parameters with the callback and then use them when the script is called. Anything can be supplied. If you do supply your own parameters then you must ensure they are URL encoded. For example a callback might be "callback=http://www.abc.com/cgi-bin/callback.pl?fred=one&bruce=two+three", note the '+'. The fred and bruce parameters will be returned to you as given. This mechanism could be used to get back your own order and address parameters if you don't want to save them on your site and then look them up.
Our server
side extensions can also be used to expand variables originally
supplied to us in any form variable (except 'card_no'!) so for example
the addresses or order details can be retrieved via the callback.
e.g. http://www.mysite.com/callback?order=${order}&shipping=${shipping}&billing=${billing} will put the appropriate information onto the callback. Security Note : It is strongly advised that you check the hash returned with the callback and supply a key. Alternatively you can check that the REMOTE_HOST calling you back is 'secpay.com', NOTE that many web servers do not do reverse DNS lookups so you may only be able to get the IP address. It is also possible to check that the amount supplied is the same as the amount authorised, as well as use of the MD5 hash that we append. These measures are especially important for software downloads initiated by the customer. |
| currency | The ISO 4217 three character alpha currency code. For this option to be useful a multi-currency account is required with your bank. NOTE : currency can also be supplied as an option (see below), most useful for users of SECBatch/SECVPN. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| template |
This is the HTML template we use for accepting the card payments. It is written using a server side scripting extension to HTML. This form template can be downloaded and customised to your in house look and feel if you cannot achieve this with our formatting parameters. However, we will need to host this on our server. It is available here. We would strongly recommend that you get your site working with our default template before requesting this. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| err_template |
This is the HTML template we use for displaying error messages, you can supply your own by using this parameter. NOTE : if this URL is wrong then there will be no template for displaying the error message to that effect, you have been warned... |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| options |
There are a number of options
settings which can be listed.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| order | This is the details of your
order. If these details are supplied then an order details summary will
be viewable on our secure transaction viewer. See examples
below for format of this parameter. Please use this field in the way it was designed to be used, do not fill it with very large blocks of text as there are limitations in any piece of software as to field size. Structure it in the way documented below. Do not include HTML or Javascript in it. Failure to comply with this can temporarily affect our service and inconvenience other customers. Draft US law will make it an offence for one computer system to do this to another. This field is provided as a convenience for the majority of customers that have simple requirements. It is not suitable for everyone. If you have complex requirements then please capture, store and present your own order details to the customer and do not send them to us. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shipping | This can be either a single parameter supplying shipping address details or a set of such parameters. See below for a breakdown of the elements of the shipping address. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| billing | Similar to shipping but supplying billing address details. See below for a breakdown of the elements of the billing address. This parameter is required for those merchants using the AVS anti-fraud checks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| backcallback | An extra callback that if supplied will give the customer the option of abandoning the card entry dialogue and returning to the merchant's site. You must enter the URL that will be loaded when the back button is clicked into the backcallback field. There is an associated button that is normally hidden to go with this parameter, to make the button visible set show_back=submit. If the button is present but the parameter is not supplied then this button will act as a normal 'Submit'. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| show_back | Set to 'submit' when using the backcallback parameter, else the 'back' button on the payment form will act as a submit, and will attempt to authorise a payment. |
| Although the template can be used to completely customise your look and feel some customers wish to make only minor changes to the default template or do not have any ability to host. For these customers the following parameters may be useful. Download the template to view the details. |
| font_face | The font used to render the template. | ||||||||||||||||||||||||
| font_size | The size of the font | ||||||||||||||||||||||||
| font_color | The colour of the font | ||||||||||||||||||||||||
| bgcolor | The background colour | ||||||||||||||||||||||||
| background | A background image - use with great care or extra and extremely off putting security warnings will be raised to the customer. Only recommended for customers with their own secure site (in which case an absolute URL must be supplied) or when the image is hosted with secpay. | ||||||||||||||||||||||||
| branding | Text or other branding to make the template look more like your own. | ||||||||||||||||||||||||
| cb_message | Any message you might wish to appear on a successful callback for the customer. | ||||||||||||||||||||||||
| cb_fail_message | Any message you might wish to appear on a failure callback for the customer. | ||||||||||||||||||||||||
| <Field Name>_Text |
A set of parameters that allow you to tailor the text against entry fields, useful for change prompts, foreign language prompts etc. NOTE :case is important
|
||||||||||||||||||||||||
| <Card Type>_Text |
A set of parameters that allow you to tailor the text against credit card types - or make them unavailable. The parameters are : NOTE : case is important
|
||||||||||||||||||||||||
| <Field Error Text>_Error |
A set of parameters that allow you to tailor the text shown in the event of an error. Useful for tailoring error message text and foreign language errors. NOTE : case is important
|
Payment Form Parameters normally filled in on the form template on the secure server :
| customer | The name of the customer on the card | ||||||||||||||||||
| card_no | The number of the credit/debit card | ||||||||||||||||||
| card_type | The type of card the customer is using to pay. The possible values are :
|
||||||||||||||||||
| start_date | The start date on the card - if there is one | ||||||||||||||||||
| expiry | The expiry date on the card | ||||||||||||||||||
| issue | For Switch and Solo cards only |
Examples :
| order="prod=funny_book,item_amount=18.50;prod=sad_book,item_amount=16.50" |
| prod=funny_book,item_amount=18.50x1;prod=sad_book,item_amount=16.50x2 |
| prod=funny_book,item_amount=18.50x1;prod=sad_book,item_amount=16.50x2;prod=SHIPPING,item_amount=5.00 |
| prod=funny_book,item_amount=18.50x1;prod=sad_book,item_amount=16.50x2;prod=SHIPPING,item_amount=5.00;prod=TAX @ 17.5%,amount=7.00 |
| prod=funny_book,item_amount=18.50x1;prod=sad_book,item_amount=16.50x2;prod=SHIPPING,item_amount=5.00;prod=TAX @ 17.5%,item_amount=7.00;prod=DISCOUNT,item_amount=5.00 |
| prod=funny_book,item_amount=18.50x1;prod=sad_book,item_amount=16.50x2 |
|
An XML example is (please preserve the class parameters and case on tags) :
<order class='com.secpay.seccard.Order'>
<orderLines class='com.secpay.seccard.OrderLine'>
<OrderLine>
<prod_code>funny_book</prod_code>
<item_amount>18.50</item_amount>
<quantity>1</quantity>
</OrderLine>
<OrderLine>
<prod_code>scary_book</prod_code>
<item_amount>10.00</item_amount>
<quantity>5</quantity>
</OrderLine>
</orderLines>
</order>
Please note that as HTML and XML have the same quoting conventions (either single or double quotes) if you use the fragment above then you must use double quotes for the HTML, i.e. <input type="hidden" name="order" value='XML GOES HERE using double quotes'> or <input type="hidden" name="order" value="XML GOES HERE using single quotes"> This facility is supplied as a convenience for the customer so that all details can be viewed in a single place on our web site. We can take no responsibility for it's accuracy or completeness. |
The shipping address can be supplied as the following parameters:
| ship_name | Contact or customer's name |
| ship_company | Company (if sold to company) |
| ship_addr_1 | Generic address lines |
| ship_addr_2 | Generic address lines |
| ship_city | The city or town |
| ship_state | The county, state, province or other area |
| ship_country | The country |
| ship_post_code | The country post code or zip |
| ship_tel | The contact telephone number |
| ship_email | Email address - this is also used for order confirmation and should always be supplied. |
| ship_url | URL of web site. |
|
The shipping details can alternatively be supplied as a single string, called 'shipping' with normal URL encoding, note that if a single string is used then the fields should be separated with commas. A minimal string would normally include the telephone number and the email to answer queries.
|
The billing address can be supplied as the following parameters:
| bill_name | Contact or customer's name |
| bill_company | Company (if sold to company) |
| bill_addr_1 | Generic address lines |
| bill_addr_2 | Generic address lines |
| bill_city | The city or town |
| bill_state | The county, state, province or other area |
| bill_country | The country |
| bill_post_code | The country post code or zip |
| bill_tel | The contact telephone number |
| bill_email | Email address - this is also used for order confirmation and should always be supplied. |
| bill_url | URL of web site. |
|
The billing details can alternatively be supplied as a single string, called 'billing'' with normal URL encoding, note that if a single string is used then the fields should be separated with commas. A minimal string would normally include the telephone number and the email to answer queries. billing=name=Fred+Bloggs,email=somebody@secpay.com, etc An XML Example is (note there is a 'billing' equivalent of course) :
<shipping class='com.secpay.seccard.Address'> <name>Fred Bloggs</name> <company>Acme Co</company> <addr_1>1 The Road</addr_1> <addr_2>The Cresent</addr_2> <city>Metropolis</city> <state>Sunny State</state> <country>Atlantis</country> <post_code>AA23 1BB</post_code> <tel>01732 300200</tel> <email>sales\@secpay.com</email> <url>http%3A//www.secpay.com/</url> </shipping> Please note that as HTML and XML have the same quoting conventions (either single or double quotes) if you use the fragment above then you must use double quotes for the HTML, i.e. <input type="hidden" name="order" value='XML GOES HERE using double quotes'> or <input type="hidden" name="order" value="XML GOES HERE using single quotes"> This facility is supplied as a convenience for the customer so that all details can be viewed in a single place on our web site. We can take no responsibility for it's accuracy or completeness.
|
As previously mentioned the callback url will be supplied with number of parameters :
| trans_id | This is the same as the parameter supplied to us and is the merchant's 'handle' on the transaction. It should be a unique string for the IP address / merchant. | ||||||||||||||||||||||||||||||||||||||||||
| valid | This is true or false and indicates the acceptance or not of the card details. We do not supply other statuses, telephone referrals and most other standard responses are not relevant for Internet transactions (see above for description of message=). SECPay check for potential fraud and report these occurrences to the authorising banks. | ||||||||||||||||||||||||||||||||||||||||||
| auth_code | ONLY MANDATORY WHEN 'valid=true'. The bank's authorisation code for your information only, do not show to customer. | ||||||||||||||||||||||||||||||||||||||||||
| cv2avs | The Apacs approved text that is supplied as a result of the CV2 and AVS anti-Fraud checks. There are five core values defined, these are ALL MATCH, SECURITY CODE MATCH ONLY, ADDRESS MATCH ONLY, NO DATA MATCHES and DATA NOT CHECKED. With these core codes an address is only understood to match if and only if both the address proper and the postcode match at the same time. This is a little strict for some people so the following codes have been introduced too : PARTIAL ADDRESS MATCH / POSTCODE, PARTIAL ADDRESS MATCH / ADDRESS, SECURITY CODE MATCH / POSTCODE, SECURITY CODE MATCH / ADDRESS. Codes are only supplied when CV2 and/or Billing Address data is supplied, it is in your interests to supply this data to us. Note that at present all issuers should be issuing new cards with a CV2 security code on them however the AVS checks will only work with UK issued cards. Also note that Switch have not yet implemented these checks (but the cards should have the CV2 security code on them nevertheless). | ||||||||||||||||||||||||||||||||||||||||||
| message | ONLY SUPPLIED WHEN 'valid=false'. The bank's failure message for your information only, do not show to customer. | ||||||||||||||||||||||||||||||||||||||||||
| resp_code | ONLY SUPPLIED WHEN 'valid=false' AND code=N. The bank's failure code for your information only, do not show to customer. 2 or 83 : referral, 5 or 54 : Not Authorised, 30 : general error (retrying after 1 minute may succeed, depending on error) | ||||||||||||||||||||||||||||||||||||||||||
| amount | This is the amount actually authorised by the bank. It should always be the same as the amount requested. | ||||||||||||||||||||||||||||||||||||||||||
| currency | This is supplied for the convenience of customers trading in non-default currencies, i.e. non-GBP at present. | ||||||||||||||||||||||||||||||||||||||||||
| code | The code
field is a short code giving extensive details of failure states. It is
of particular use to SECBatch/SECVPN users. Note : preauth checks can
have several errors, e.g. P:NEC means the name, expiry date and card number
fields are all invalid or not supplied.
| ||||||||||||||||||||||||||||||||||||||||||
| test_status |
Returned if the options parameter test_status was set to either 'true' or 'false'
|
| hash | This parameter
is always returned. For those customers that have chosen to register a hash
key with SECPay the key is concatenated onto the end of the callback URL.
The start of the resulting string is removed before the first single '/'
character and the whole string is then hashed using MD5. The merchant should
do the same and ensure that the generated hash matches that returned. The
protocol and domain (and port if supplied) are removed to ensure the code
can be moved between servers without change, but still as much of the string
as possible is still used. An example is available in the callback download.
If the default hashing scheme is not sufficient or there are special requirements then the md_flds option (see above) can be used. A Java version of the MD5 algorithm is available with the callback download. If you use Perl any CPAN archive should contain an appropriate implementation. A C implementation is also available within the secbatch facility. We will make other implementations available when possible. |
| Authorisation | Standard authorisation processing |
| Release | Release of deferred processing |
| Refund | Refund of a transaction |
| Repeat | Continuous Authority repeat billing |
| PreAuthoristation | This verifies that the card data will pass our preliminary checks |
|
An additional call is available for pre-authorisation of the card, this call will return a result string that must be parsed, please download secbatch and check the supplied examples. preAuth(card_no, card_type, expiry, start, issue, result) This call is simply a wrapper around an https service supplied by SECPay. This service is available at the following URL (please supply your own parameters). https://www.secpay.com/java-bin/PreAuth?card_no=CN&card_type=CT&expiry=EX&issue=IS&start=SD It is your responsibility to integrate these functions with your applications, though we can undertake this work on a consultancy paid basis. Please contact us if you require us to quote for this work. Batch Processing SECPay provide client-side example programs for sites that collect their own credit card details and wish to forward them to us for verification. Using a remote procedure call or a command line set of parameters. The API will take it's parameters from the function call or iteratively read a set of parameters from a file and repeatedly call the SECPay server.
Where the file consists of a set of comma separated records with the following fields or parameters: Format : secbatch <merchant> {other args}
|
| Transaction Identifier | Your unique transaction identifier |
| IP address | Identification such as IP address or Post Code |
| Customer Card Name | The name on the card |
| Card Number | Credit / Debit card number |
| Amount | Total transaction amount |
| Expiry Date | Expiry date on card normally MM/YY |
| Issue number | Switch issue number if appropriate |
| Start Date | Start date on card (if any) |
| Order Details | Order detail as defined above |
| Shipping Address | Shipping address details as defined above |
| Billing Address | Billing address details (if different from shipping address) |
| Options | Option list (if any) |
|
Full parameter definition can be found in the section on parameters. SECBatch can be downloaded from one of the links below. SECVPN is the preferred version for the future. SECVPN will benefit from all future exhancements and can easily be used as a COM object on Microsoft operating systems. It can also be called from Perl using the new JPL interface shipped with the newest Perl releases. |
| Java VPN Version(pkzip) | SECVPN (pkzip) | Documentation is available here |
| Java VPN Version(pkzip) | SECVPN (gzip/tar) | Documentation is available here |
| NT/W95 (Winsock V2) | SECBatch (Dynamically linked) | This program runs under Win95/98 or NT requires Winsock 2 and the latest security patches. These can be obtained from Winsock 1.2 for Windows 95. Take note of the instructions and disclaimers on this site. |
| Linux Version (ELF) | SECBatch (Linux Version - ELF) | This is a precompiled static version supplied with appropriate libraries. Also supplied is a dynamic shared object version with perl wrappers. |
| FreeBSD 3.4 (ELF) | SECBatch (FreeBSD 3.4 - ELF) | This is a dynamic shared object version with perl wrappers. |
| Other platforms | Please contact SECPay | If at all possible use SECVPN. |
|
An applet is available
for credit card validation. Note that this applet will probably not
work behind a firewall and we are aware of this issue. It is available here
please view the source to tailor it for your site. This is a simple way
to integrate SECPay with your application. It can also be run as a stand
alone application and will eventually include order and address details,
refunds, releases, remote reporting etc. For testing the dummy card number
4444333322221111 can be used.
SECPay is aware of the
problems experienced by merchants and the possibilities of fraudulent customers.
To counter this threat we will be bringing in a range of new services to
verify customer and generally reduce the merchant exposure.
As a very small first step in this direction there is now a service available to check for well formed UK postcodes. It is available at : https://www.secpay.com/java-bin/PreAuth?postcode=TN92LE Or alternatively if more convenient ; https://www.secpay.com/java-bin/PreAuth?incode=TN9&outcode=2LE Examples of CallsNote that a merchant of 'test' will allow you to test connectivity. For full testing use 'secpay' or register and use your own merchant id. This is a simple call : Form based call: This form has all of its fields exposed, and will work. Normally a lot of the fields would be hidden from the customer. The example can be called from here formexample.html or view the source here formexample.txt XML CallsSECPay now support a complete XML call (over https) and response facility. It is very easy to use and is useful for those customers that have their own secure server and some XML expertise. There is an XML equivalent of each servlet. For example the main validation servlet ValCard has an associated servlet called XMLValCard. All XML calls are made to the XML equivalents. XML requests are called XMLRequest and all Responses are called XMLResponse, regardless of what is called. These XML objects are therefore flexible, extensible and orthogonal with all other call methods. A detailed DTD is not therefore supplied, in a sense this whole document is the DTD. The call must be an HTTPS call and must be a POST. As this type of call will normally be done programatically the XML need not be contained within an HTML form field. In fact it is preferred if it is not. However some users may wish to use a containing field, any name would do but 'xml' might be sensible.
A Simple Request might be :
<XMLRequest><merchant>secpay</merchant><trans_id>xmltest</trans_id><amount>10.50</amount><options>test_status=true,dups=false</options><card_no>4444333322221111</card_no><expiry>1204</expiry><customer>Fred Bloggs</customer></XMLRequest> Important Note: Please ensure that all of the XMLRequest is on a single line with no spaces between the elements.
The Response would be :
<XMLResponse> <valid>true</valid> <trans_id>xmltest</trans_id> <code>A</code> <auth_code>9999</auth_code> <amount>10.50</amount> <test_status>true</test_status> <hash>ff358bda726d08448b9d2df43eed9d51</hash> </XMLResponse> Obviously other parameters and objects can be included, for example the shipping and billing addresses and a number of order lines could be included. Addresses and order lines must have the format defined above. Thawte certificate rootSome old browsers did not include the Thawte root certificate, IE 3.0 is an example. If you have trouble communicating with our secure site using an old browser then please install the Thawte root from here. Another problem that may be experienced is with root rollover in Netscape 3. The Thawte root certificate will expire on July 27 1998 in this browser, this is only a warning. To remove this warning follow these instructions :
|