Cyber Source PHP Simple Order Client
Cyber Source PHP Simple Order Client
Within the United States, go to http://www.cybersource.com/esupport. Outside the United States, email [email protected] or call +44 0 1189 653 545.
Copyright
2010 CyberSource Corporation. All rights reserved. CyberSource Corporation ("CyberSource") furnishes this document and the software described in this document under the applicable agreement between the reader of this document ("You") and CyberSource ("Agreement"). You may use this document and/or software only in accordance with the terms of the Agreement. Except as expressly set forth in the Agreement, the information contained in this document is subject to change without notice and therefore should not interpreted in any way as a guarantee or warranty by CyberSource. CyberSource assumes no responsibility or liability for any errors that may appear in this document. The copyrighted software that accompanies this document is licensed to You for use only in strict accordance with the Agreement. You should read the Agreement carefully before using the software. Except as permitted by the Agreement, You may not reproduce any part of this document, store this document in a retrieval system, or transmit this document, in any form or by any means, electronic, mechanical, recording, or otherwise, without the prior written consent of CyberSource.
For civilian agencies. Use, reproduction, or disclosure is subject to restrictions set forth in subparagraphs (a) through
(d) of the Commercial Computer Software Restricted Rights clause at 52.227-19 and the limitations set forth in CyberSource Corporation's standard commercial agreement for this software. Unpublished rights reserved under the copyright laws of the United States.
Trademarks
CyberSource, the CyberSource logo, SmartCert, and PaylinX are registered trademarks of CyberSource Corporation in the U.S. and other countries. The Power of Payment, CyberSource Payment Manager, CyberSource Risk Manager, CyberSource Decision Manager, and CyberSource Connect are trademarks and/or service marks of CyberSource Corporation. All other brands and product names are trademarks or registered trademarks of their respective owners.
ii
CyberSource Corporation
Contents
Documentation Changes............................................................................................................vii
Chapter 1
Introduction.....................................................................................................................................1 Who Should Read This Guide .......................................................................................................1 Other Necessary Documentation ..................................................................................................2 General Documentation ..........................................................................................................2 Business Center Users .............................................................................................................2 Enterprise Business Center Users ..........................................................................................3 Using PHP in a Hosted Environment ..........................................................................................4 Choosing Your API and Client Version .......................................................................................4 API Variation ............................................................................................................................4 Client Versions..........................................................................................................................5 Sample Code Available ..................................................................................................................5 Basic PHP Page Example ........................................................................................................5 Sample Scripts...........................................................................................................................6 Sample PHP Pages ...................................................................................................................6
Chapter 2
Installing and Testing the Client ................................................................................................9 System Requirements .....................................................................................................................9 For Linux ...................................................................................................................................9 For Windows.............................................................................................................................9 Creating a Security Key ................................................................................................................10 Business Center Users ...........................................................................................................10 Resellers............................................................................................................................10 Merchants.........................................................................................................................10 Enterprise Business Center Users ........................................................................................11 Installing the Client .......................................................................................................................11 For Linux .................................................................................................................................11 For Windows...........................................................................................................................12 Configuring Client Settings .........................................................................................................13 Testing the Client...........................................................................................................................15 Going Live ......................................................................................................................................17 Business Center Users ...........................................................................................................17 Enterprise Business Center Users ........................................................................................17
PHP Simple Order API Client Developers Guide August 2010
iii
Updating the Client to Use a Newer API Version....................................................................18 Special Installation Instructions for Oracle Users ....................................................................18
Chapter 3
PHP API for the Client ................................................................................................................21 Summary of Functions .................................................................................................................21 cybs_load_config() ........................................................................................................................21 cybs_run_transaction() .................................................................................................................22 Reply Key Descriptions.........................................................................................................22 Possible Return Status Values ..............................................................................................23
Chapter 4
Using Name-Value Pairs.............................................................................................................29 Other Necessary Documentation................................................................................................29 Requesting ICS Services ...............................................................................................................30 Creating and Sending the Request .............................................................................................30 Loading the Configuration Settings ....................................................................................30 Creating an Empty Request Array ......................................................................................31 Adding the Merchant ID.......................................................................................................31 Adding Services to the Request Array................................................................................31 Requesting a Sale ...................................................................................................................31 Adding Service-Specific Fields to the Request Array.......................................................31 Sending the Request ..............................................................................................................32 Interpreting the Reply ..................................................................................................................32 Handling the Return Status ..................................................................................................32 Processing the Reason Codes ...............................................................................................35 Handling Reviews..................................................................................................................37 Requesting Multiple Services ......................................................................................................38 Retrying When System Errors Occur .........................................................................................39
Chapter 5
Using XML.....................................................................................................................................41 Other Documentation You Need ................................................................................................41 Requesting ICS Services ...............................................................................................................42 Sample Code ..................................................................................................................................42 Creating a Request Document.....................................................................................................42 Creating an Empty Request..................................................................................................43 Adding the Merchant ID.......................................................................................................43 Adding Services to the Request ...........................................................................................43 Requesting a Sale ...................................................................................................................44 Adding Service-Specific Fields to the Request ..................................................................44 Sending the Request .....................................................................................................................45 Loading the Configuration Settings ....................................................................................45 Reading the XML Document................................................................................................45 Sending the Request ..............................................................................................................46
iv
CyberSource Corporation
Contents
Interpreting the Reply...................................................................................................................46 Handling the Return Status ..................................................................................................46 Processing the Reason Codes ...............................................................................................49 Handling Reviews..................................................................................................................52 Requesting Multiple Services ......................................................................................................52 Retrying When System Errors Occur .........................................................................................53
Appendix A
Generating Security Keys ...........................................................................................................55 Preparing to Generate a Key........................................................................................................55 Merchants Using the Business Center.................................................................................55 Merchants Using the Enterprise Business Center .............................................................57 Generating a Key ...........................................................................................................................57
Appendix B
Viewing a Security Keys Serial Number................................................................................61 Importing the Key File...........................................................................................................61 Viewing the Serial Number ..................................................................................................62
Appendix C
Advanced Configuration Information .....................................................................................65 Using Alternate Server Configuration Settings ........................................................................65 Configuring Your Settings for Multiple Merchant...................................................................65
Appendix D
Using the Client Application Fields .........................................................................................67 Index ...............................................................................................................................................69
vi
CyberSource Corporation
Documentation Changes
The following table lists changes made in the last six releases of this document:
Release
August 2010
Changes
Clarified how to use logs to comply with PCI and PABP requirements. For more information, see enableLog on page 14. Added notes stating that the CyberSource servers do not support persistent HTTP connections. For name-value pairs, see Requesting ICS Services on page 30. For XML, see Requesting ICS Services on page 42. Added information regarding PCI and PABP compliance. See the description of enableLog in Table 1 on page 13. Added important information about configuring your client API host to a unique, public IP address. See System Requirements on page 9. Updated the information about the supported versions of PHP. The Linux version of the client now also includes support for PHP 5.1.0-5.1.2. See System Requirements on page 9. Updated the guide to reflect the new folder structure for the clients samples directory. Modified Appendix A, Generating Security Keys, on page 55. The process for generating a key is now identical in both Business Centers. Updated the information in Other Necessary Documentation on page 2. Updated the information in Going Live on page 17. Added guidelines for using the clients logging capability. See the description of the enableLog property in Configuration Settings on page 13. Added information about the type of character set encoding that the SDK supports. See System Requirements on page 9.
January 2008
October 2006
July 2006
March 2006
August 2005
vii
viii
CyberSource Corporation
Chapter 1
Introduction
This chapter provides an introduction to the CyberSource Simple Order API Client for PHP. The chapter includes these sections: Who Should Read This Guide Other Necessary Documentation Using PHP in a Hosted Environment Choosing Your API and Client Version Sample Code Available This guide covers the Linux and Windows platforms and uses the Linux convention of forward slashes when path names are listed.
A merchant or reseller using the Business Center at https://businesscenter.cybersource.com. An enterprise merchant using the Enterprise Business Center at https://ebc.cybersource.com.
Most of this guides content is applicable to both types of users. The guide indicates if particular information applies only to one type of user. You will need to know which type of user you are when you install the client and generate security keys. If you are not sure whether you should use the Business Center or the Enterprise Business Center, look at the registration email that you received when you or someone at your company opened your account with CyberSource. The email includes your login ID and password and indicates whether to use the login with the Business Center or the Enterprise Business Center. If you do not have access to the registration email or have lost it, contact your account manager.
General Documentation
This documentation is available in the client package download:
Use the client SDK's documentation to determine how to: -- Create the request -- Send the request -- Receive the reply Reply
CyberSource
Use the Business Center Simple Order API User's Guide to interpret what is in the reply
CyberSource Corporation
Chapter 1 Introduction
Credit Card Services Implementation Guide: Describes the API for using the CyberSource ICS Credit Card Services. Make sure when you read this guide that you read the Simple Order API chapter, not the SCMP API chapter. Reporting Developers Guide: Describes how to download the CyberSource reports that you will be using to manage your orders. Implementation guides for any other ICS services that you are planning to use. These are available in the documentation area of the Support Center.
Important The Simple Order API was originally referred to as the Web Services API in the CyberSource documentation. You may still see old references to the Web Services API in some locations.
Request
Use the Credit Card Services Implementation Guide to determine what to put in the request
Use the client SDK's documentation to determine how to: -- Create the request -- Send the request -- Receive the reply Reply
CyberSource
Use the Credit Card Services Implementation Guide to interpret what is in the reply
API Variation
With this client package, you can use either of these variations of the Simple Order API:
Name-value pairs, which are simpler to use XML, which requires you to create and parse XML documents
The test that you run immediately after installing the client uses name-value pairs.
CyberSource Corporation
Chapter 1 Introduction
Client Versions
CyberSource regularly updates the Simple Order API to introduce new API fields and functionality. To determine the latest version of the server-side API for the ICS services, go to https://ics2ws.ic3.com/commerce/1.x/transactionProcessor/. The Simple Order API Client for PHP also has a version, but it is not the same as the API version. The client version represents the version of the client-side code that you use to access the ICS services. When configuring the client, you indicate the version of the API that you want to use. When setting this parameter, do not use the current version of the client; use the current version of the API.
$request['billTo_country'] = 'US'; $request['billTo_email'] = '[email protected]'; $request['card_accountNumber'] = '4111111111111111'; $request['card_expirationMonth'] = '12'; $request['card_expirationYear'] = '2010'; $request['purchaseTotals_currency'] = 'USD'; // This example has two items $request['item_0_unitPrice'] = '12.34'; $request['item_1_unitPrice'] = '56.78'; // Add optional fields here according to your business needs // Send request $reply = array(); $status = cybs_run_transaction( $config, $request, $reply ); // Handle the reply. See Handling the Return Status on page 32.
Sample Scripts
The client contains two sample scripts, one for using name-value pairs and one for using XML. See Testing the Client on page 15 or see the README file for more information about using the authCaptureSample.php script to test the client.
XML: We suggest that you examine the name-value pair sample code listed above before implementing your code to process XML requests. For the XML sample code, see authSample.php in <installation directory>/ samples/xml. Also see the auth.xml XML document that the script uses.
Description Used by the other PHP pages in the directory. Displays the contents of the shopping basket and prompts for address and payment information.
CyberSource Corporation
Chapter 1 Introduction
Description Authorizes the order and displays the result. Footer used in the checkout pages. Header used in the checkout pages.
To use the sample PHP pages: 1 If you have files in your Web servers root directory that have the same name as the files listed in Table 1, back up those files. You will be copying the sample store files into the root directory in the next step. For Apache, the root directory is the one specified by DocumentRoot in httpd.conf. 2 3 Copy all of the files in the <installation directory>/samples/store directory into your Web servers root directory. Modify the cybs.ini file as appropriate (see Configuring Client Settings on page 13). Important Make sure you use absolute paths for the directories in the cybs.ini file that you use with the sample store, for example: keysDirectory=c:\keys. If you encounter problems getting the sample PHP pages to work, you may need to locate your cybs.ini file outside of the root directory. 4 5 Open the checkout.php file in a text editor and locate the cybs_load_config() function. Make sure that the parameter for the cybs.ini file passed to the function includes the absolute path. For example, make sure the line reads:
$config = cybs_load_config( 'c:\cybs.ini' );
Restart your Web server. If you are using IIS, you may need to restart you computer for IIS to pick up the new server path.
Open a Web browser and type the following URL: http://<your web server name or IP address>/<virtual directory if applicable>/checkout.php
CyberSource Corporation
Chapter 2
This chapter explains how to install, configure, and test the Simple Order API Client for PHP and includes these sections: System Requirements Creating a Security Key Installing the Client Configuring Client Settings Testing the Client Going Live Updating the Client to Use a Newer API Version Special Installation Instructions for Oracle Users
System Requirements
Your system must meet the following requirements.
For Linux
Linux kernel 2.2, LibC6 on an Intel processor (for RedHat users, this currently corresponds to versions 7.1 and 7.2) PHP4 (minimum version 4.2.1) or PHP5 (5.0.05.0.3 and 5.1.0-5.1.2) GNU GCC
For Windows
Windows XP, 2000, or newer Minimum PHP version 4.2.1
Important Failure to configure your client API host to a unique, public IP address will cause inconsistent transaction results. CyberSource strongly recommends configuring your client API host to a unique, public IP address. Failure to do so will cause inconsistent transaction results. The client API request ID algorithm uses a combination of IP address and system time, along with other values. In some architectures it is possible that this combination will not yield unique identifiers.
Merchants
If you are a merchant using the Business Center, you create your security key by using a Java applet that you access through the Business Center. See Appendix A, Merchants Using the Business Center, on page 55 for instructions.
10
CyberSource Corporation
For Linux
To install the client: 1 2 3 Go to the client downloads page on the Support Center. Download the latest client package. You can save the file in any directory. Unzip and untar the package. This creates a directory called simapi-php-n.n.n, where n.n.n is the client version. Important The simapi-php-n.n.n/lib directory contains symbolic links. If you install the client by copying the lib directory from some other location where you untarred the package, check to see if the symbolic links are still there. If they are not, you need to recreate them. 4 Copy the phpN_cybersource.so file into the PHP extension directory, where the N is 4 if your PHP version is 4.x.x; 5 if your PHP version is 5.0.0-5.0.2; 503 if your PHP version is 5.0.3.; or 512 if your version is 5.1.0-5.1.2. The extension directory is the one "extension_dir" is set to in the php.ini file. If you do not already have "extension_dir" set to an explicit directory: a b c 5 Create an extension directory (outside of the client installation directory). Set "extension_dir" to that directory. Copy the phpN_cybersource.so file to that directory location.
If you are using an Oracle database, go to Special Installation Instructions for Oracle Users on page 18 and follow the instructions. Otherwise, in the php.ini file, locate the Dynamic Extensions section and add one of the following lines anywhere before the next section in the file:
extension=php4_cybersource.so (if using PHP 4.x.x) or extension=php5_cybersource.so (if using PHP 5.0.0-5.0.2) extension=php503_cybersource.so (if using PHP 5.0.3) or extension=php512_cybersource.so (if using PHP 5.1.0-5.1.2)
11
Modify the environment variable LD_LIBRARY_PATH to include the lib directory of the CyberSource client. For example:
export LD_LIBRARY_PATH=/baseDir/simapi-php-n.n.n/lib:$LD_LIBRARY_PATH
where /baseDir is the directory where you untarred the CyberSource client package. Note If the Web server is running as the user "nobody", you must use ldconfig instead of setting the LD_LIBRARY_PATH. In this case, update the /etc/ld.so.conf file to include the library path (/baseDir/simapi-php-n.n.n/lib), and run ldconfig to update the configuration. 8 9 Configure the client. See Configuring Client Settings below. Test the client. See Testing the Client on page 15.
You have now installed and tested the client. You are ready to create your own code for requesting ICS services. Finish reading this chapter, and then move on to either Chapter 4, Using Name-Value Pairs, on page 29 if you plan to use name-value pairs, or Chapter 5, Using XML, on page 41 if you plan to use XML.
For Windows
1 2 3 4 Go to the client downloads page on the Support Center. Download the latest client package. You can save the file in any directory. Unzip the package. This creates a directory called simapi-php-n.n.n, where n.n.n is the client version. Copy the phpN_cybersource.dll file into the PHP extension directory, where the N is 4 if your PHP version is 4.x.x, or 5 if your PHP version is 5.x.x. The extension directory is the one "extension_dir" is set to in the php.ini file. If you do not already have "extension_dir" set to an explicit directory: a b c 5 Create an extension directory (outside of the client installation directory). Set "extension_dir" to that directory. Copy the phpN_cybersource.dll file to that directory location.
In the php.ini file, locate the Windows Extensions section and add one of the following lines anywhere before the next section in the file:
extension=php4_cybersource.dll (if using PHP 4.x.x) or extension=php5_cybersource.dll (if using PHP 5.0.05.0.2) extension=php503_cybersource.dll (if using PHP 5.0.3) or extension=php512_cybersource.dll (if using PHP 5.1.0-5.1.2)
6 7
Save the php.ini file. Add the lib directory of the CyberSource client package to the system PATH. This makes the DLLs included in the client package available to the CyberSource PHP extension. The client is now installed on your system.
12
CyberSource Corporation
8 9
Configure the client. See Configuring Client Settings below. Test the client. See Testing the Client on page 15.
You have now installed and tested the client. You are ready to create your own code for requesting ICS services. Finish reading this chapter, and then move on to either Chapter 4, Using Name-Value Pairs, on page 29 if you plan to use name-value pairs, or Chapter 5, Using XML, on page 41 if you plan to use XML.
Setting merchantID
Description Merchant ID. The client uses this value if you do not specify a merchant ID in the request itself. Location of the merchants security key. The client includes a keys directory that you can use. Include the path, for example: ../keys, or c:\simapi-php-1.0.0\keys.
keysDirectory
Note We recommend that you store your key locally for faster request processing.
sendToProduction Flag that indicates whether the transactions for this merchant should be sent to the production server. Use one of these values: false: Do not send to the production server; send to the test server (default setting).
Note Make sure that if your merchant ID is configured to use the test mode, you send requests to the test server.
13
Setting targetAPIVersion
serverURL
namespaceURI
enableLog
Important CyberSource recommends that you use logging only when troubleshooting problems. To comply with all Payment Card Industry (PCI) and Payment Application (PA) Data Security Standards regarding the storage of credit card and card verification number data, the logs that are generated contain only masked credit card and card verification number (CVV, CVC2, CVV2, CID, CVN) data.
Follow these guidelines: Use debugging temporarily for diagnostic purposes only.
If possible, use debugging only with test credit card numbers. Never store clear text card verification numbers. Delete the log files as soon as you no longer need them. Never email to CyberSource personal and account information, such as customers' names, addresses, card or check account numbers, and card verification numbers.
For more information about PCI and PABP requirements, see www.visa.com/cisp.
14
CyberSource Corporation
Setting logDirectory
Description Directory of the log file. Note that the client will not create this directory for you; you must specify an existing directory.The client includes a logs directory that you can use. Include the path, for example: ../logs, or c:\simapi-php-1.0.0\logs. Log file name. The client uses cybs.log by default. Maximum size in megabytes for the log file. The default value is 10. When the log file reaches the specified size, it is archived into cybs.log.<yyyymmddThhmmssxxx> and a new log file is started. The xxx indicates milliseconds. The location of the bundled file of CA Root Certificates (ca-bundle.crt) which is included in the client download package. The client automatically looks for the file in the directory where your security key is stored (specified by keysDirectory). If you move the file so it does not reside in keysDirectory, use this configuration setting to specify the full path to the file, including the file name. Length of time-out in seconds. The default is 110. Proxy server to use. Allowable formats include:
logFilename logMaximumSize
sslCertFile
timeout proxyServer
Note The default port is 1080. If your proxy server is listening on another port, you must specify a port number.
proxyUsername Username used to authenticate against the proxy server if required. If the proxy server requires the domain name during authentication, add the domain name and a backslash: <domain>\<username> Password used to authenticate against the proxy server, if required.
proxyPassword
15
Run the test authCaptureSample.php script by typing: php authCaptureSample.php where php is the command-line interface (CLI) version. Depending on your PHP version, php may be in the main PHP directory, the sapi/cli directory, the cli directory, or it may be named php-cli.exe or php.exe. For example, for PHP 4.3.0 with Linux, you may have: <PHP directory>/sapi/cli/php authCaptureSample.php Or for PHP 4.3.8 with Windows, you may have: <PHP directory>\cli\php authCaptureSample.php or <PHP directory>\php.exe authCaptureSample.php The results of the test are displayed in the window.
1 2 3 4 5 6
If the test is successful, you see a decision of ACCEPT for both the credit card authorization and the follow-on capture. If the test is not successful, you see a different decision value or an error message.
If the test fails: Check to see that your cybs.ini settings are correct. Run the test again. If the test still fails, look at the error message and determine the return status value (a numeric value from -1 to 8). See the descriptions of the status values in Possible Return Status Values on page 23, and follow any instructions given there for the error you received. Run the test again. If the test still fails, contact Customer Support.
If you want to also run the XML sample: 1 2 3 Go to the <installation directory>/sample/xml directory. For Windows, modify the cybs.ini in the folder with your settings (for Linux, make sure the samples/cybs.ini file is set how you want it). Run the test authSample.php script by typing: php authSample.php The results of the test are displayed in the window.
If the test is successful, you see a decision of ACCEPT for both the credit card authorization and the follow-on capture. If the test is not successful, you see a different decision value or an error message.
16
CyberSource Corporation
Going Live
When you have completed all of your system testing and are ready to accept real transactions from your customers, you are ready to go live.
17
10 Click Submit question. You will receive an email with your support ticket number, and a CyberSource representative will contact you to complete the process. 11 Once CyberSource has confirmed that you are live, make sure to update your system so that you send requests to the production server and not the test server. See the description of the SendToProduction property in Table 1 on page 13. After you go live, use real card numbers and other data to test every card type, currency, and CyberSource application that your integration supports. Because these are real transactions in which you are buying from yourself, use small amounts, such as one dollar, to do the tests. Use your bank statements to verify that money is deposited into and withdrawn from your merchant bank account as expected. If you have more than one CyberSource merchant ID, test each one separately.
1 2 3
Load the Oracle extensions dynamically In the php.ini file, load the CyberSource extension before the Oracle extensions
To meet these requirements, follow these instructions: At a command prompt, go to your PHP directory. Type the following: make clean Execute configure so that you are loading the Oracle extension(s) dynamically. To do this, include shared, before the path to each Oracle extension. For example, you might execute configure as follows: ./configure --prefix=<target PHP directory> --with-apxs=/usr/local/apache_1.3.32/bin/apxs --with-oracle=shared,/home/u01/app/oracle/product/8.1.7
18
CyberSource Corporation
--with-oci8=shared,/home/u01/app/oracle/product/8.1.7 --without-mysql
Type the following: make make install In the Dynamic Extensions section of the php.ini file, add the CyberSource extension before the Oracle extensions:
extension=phpN_cybersource.so (where N represents the version of PHP: 4, 5, 503,
or 512)
extension = oracle.so extension = oci8.so
6 7
Save the php.ini file. Continue with the original installation instructions (see Step 7 on page 12).
19
20
CyberSource Corporation
Chapter 3
Summary of Functions
The client includes these functions:
cybs_load_config() cybs_run_transaction()
cybs_load_config()
Table 1 cybs_load_config()
array cybs_load_config( string filename ) Loads the configuration settings from a file An array containing the configuration settings filename: Name of the configuration file
21
cybs_run_transaction()
cybs_run_transaction()
Table 2 cybs_run_transaction()
int cybs_run_transaction( array config, array request, array reply ) Sends the request to the ICS server and receives the reply A value that indicates the status of the request config: Configuration array to use request: Array containing one of these:
The individual name-value pairs in the request (for namevalue pair users) A single key called CYBS_SK_XML_DOCUMENT whose value is the XML document representing the request (for XML users)
Note You must create this array before you call cybs_run_ transaction().
The individual name-value pairs in the reply (for namevalue pair users) A single key called CYBS_SK_XML_DOCUMENT whose value is the XML document representing the reply (for XML users) A combination of the following keys and their values: CYBS_SK_ERROR_INFO CYBS_SK_RAW_REPLY CYBS_SK_FAULT_DOCUMENT CYBS_SK_FAULT_CODE CYBS_SK_FAULT_STRING CYBS_SK_FAULT_REQUEST_ID
22
CyberSource Corporation
Value
Description
CYBS_S_OK
Critical: No Result: The client successfully received a reply. For name-value pair users, the $reply array has the reply namevalue pairs for the services that you requested. For XML users, the $reply array contains the response in XML format. Manual action to take: None
-1
CYBS_S_PHP_ PARAM_ERROR
Critical: No Result: The request was not sent because there was a problem with one or more of the parameters passed to the cybs_run_transaction() function. Manual action to take: Make sure the parameter values are correct.
CYBS_S_PRE_SEND_ ERROR
Critical: No Result: An error occurred before the request could be sent. This usually indicates a configuration problem with the client. Error information to read: $reply[CYBS_SK_ERROR_INFO] Manual action to take: Fix the problem described in the error information.
23
cybs_run_transaction()
Value
Description
CYBS_S_SEND_ ERROR
Critical: No Result: An error occurred while sending the request. Error information to read: $reply[CYBS_SK_ERROR_INFO] Manual action to take: None NOTE A typical send error that you might receive when testing occurs if the ca-bundle.crt file is not located in the same directory as your security key. See the description of the sslCertFile configuration parameter in Table 1 on page 13 for information about how to fix the problem.
CYBS_S_RECEIVE_ ERROR
Critical: Yes Result: An error occurred while waiting for or retrieving the reply. Error information to read: $reply[CYBS_SK_ERROR_INFO] $reply[CYBS_SK_RAW_REPLY] Manual action to take: Check the Transaction Search screens on the Business Center (for Business Center merchants) or Enterprise Business Center (for enterprise merchants) to see if the request was processed, and if so, if it succeeded. Update your transaction database appropriately.
CYBS_S_POST_ RECEIVE_ERROR
Critical: Yes Result: The client received a reply or a fault, but an error occurred while processing it. Error information to read: $reply[CYBS_SK_ERROR_INFO] $reply[CYBS_SK_RAW_REPLY] Manual action to take: Examine the value of $reply[CYBS_SK_ RAW_REPLY]. If you cannot determine the status of the request, then check the Transaction Search screens on the Business Center (for Business Center merchants) or Enterprise Business Center (for enterprise merchants) to see if the request was processed, and if so, if it succeeded. Update your transaction database appropriately.
24
CyberSource Corporation
Value
Description
CYBS_S_CRITICAL_ SERVER_FAULT
Critical: Yes Result: The server returned a fault with $reply[CYBS_SK_FAULT_ CODE] set to CriticalServerError. Error information to read: $reply[CYBS_SK_ERROR_INFO] $reply[CYBS_SK_FAULT_CODE] $reply[CYBS_SK_FAULT_STRING] $reply[CYBS_SK_FAULT_DOCUMENT] $reply[CYBS_SK_FAULT_REQUEST_ID] Manual action to take: Check the Transaction Search screens on the Business Center (for Business Center merchants) or Enterprise Business Center (for enterprise merchants) to see if the request succeeded. When searching for the request, use the request ID provided by $reply[CYBS_SK_FAULT_REQUEST_ID].
CYBS_S_SERVER_ FAULT
Critical: No Result: The server returned a fault with $reply[CYBS_SK_ FAULT_CODE] set to ServerError, indicating a problem with the ICS server. Error information to read: $reply[CYBS_SK_ERROR_INFO] $reply[CYBS_SK_FAULT_CODE] $reply[CYBS_SK_FAULT_STRING] $reply[CYBS_SK_FAULT_DOCUMENT] Manual action to take: None
25
cybs_run_transaction()
Value
Description
CYBS_S_OTHER_ FAULT
Critical: No Result: The server returned a fault with $reply[CYBS_SK_ FAULT_CODE] set to a value other than ServerError or CriticalServerError. Indicates a possible problem with merchant status or the security key. Could also indicate that the message was tampered with after it was signed and before it reached the ICS server. Error information to read: $reply[CYBS_SK_ERROR_INFO] $reply[CYBS_SK_FAULT_CODE] $reply[CYBS_SK_FAULT_STRING] $reply[CYBS_SK_FAULT_DOCUMENT] Manual action to take: Examine the value of the $reply[CYBS_ SK_FAULT_STRING] and fix the problem. You may need to generate a new security key, or you may need to contact Customer Support if there are problems with your merchant status. NOTE A typical error that you might receive occurs if your merchant ID is configured for test mode but you send transactions to the production server. See the description of the sendToProduction configuration parameter in Table 1 on page 13 for information about fixing the problem.
CYBS_S_HTTP_ ERROR
Critical: No Result: The server returned an HTTP status code other than 200 (OK) or 504 (gateway timeout). Note that if a 504 gateway timeout occurs, then the status=3. Error information to read: $reply[CYBS_SK_ERROR_INFO] $reply[CYBS_SK_RAW_REPLY] Value of varReply: CYBS_SK_RAW_REPLY contains the HTTP response body, or if none was returned, the literal "(no response available)". Manual action to take: None.
Table 4 summarizes which reply information you receive for each status value.
26
CyberSource Corporation
CYBS_S_PRE_SEND_ERROR
CYBS_S_RECEIVE_ERROR
CYBS_S_SERVER_FAULT
CYBS_S_OTHER_FAULT x x x x
CYBS_S_SEND_ERROR
Name-value pairs or CYBS_SK_XML_DOCUMENT Available Information CYBS_SK_ERROR_INFO CYBS_SK_RAW_REPLY CYBS_SK_FAULT_DOCUMENT CYBS_SK_FAULT_CODE CYBS_SK_FAULT_STRING CYBS_SK_FAULT_REQUEST_ID
x x x x x x x x x x x x x x x x x x
CYBS_S_HTTP_ERROR
CYBS_SOK
27
cybs_run_transaction()
28
CyberSource Corporation
Chapter 4
This chapter explains how to use the client to request ICS services by using name-value pairs and includes these sections: Other Necessary Documentation Requesting ICS Services Creating and Sending the Request Interpreting the Reply Requesting Multiple Services Retrying When System Errors Occur
Business Center Simple Order API Users Guide: Describes the API for using the CyberSource ICS Credit Card Services and other payment services.
Credit Card Services Implementation Guide: Describes the API for using the CyberSource ICS Credit Card Services. Make sure when you read this guide that you read the Simple Order API chapter and NOT the SCMP API chapter. Implementation guides for any other ICS services you are planning to use. These are available in the documentation area of the Support Center.
29
Collects information for the ICS services that you will use Assembles the order information into requests Sends the requests to the CyberSource server Important The CyberSource servers do not support persistent HTTP connections.
The instructions in this chapter explain how to use PHP to request ICS services. You will need another guide, as described in Other Necessary Documentation on page 29, to get a list of the API fields to use in your requests.
You could instead create an array and add each configuration setting separately. You could also use a combination of the two methods: You could read the settings from a file and then add new settings dynamically with the array to override the settings read from the file.
30
CyberSource Corporation
Requesting a Sale
You can request multiple services by adding additional fields to the request. For example, if you fulfill the order immediately, you can request credit card authorization and capture together (referred to as a sale):
$request['ccAuthService_run'] = 'true'; $request['ccCaptureService_run'] = 'true';
31
The example above shows only a partial list of the fields you need to send. Refer to Other Necessary Documentation on page 29 for information about the guide or guides that list all of the fields for the service(s) you are requesting.
32
CyberSource Corporation
if ($status == 0) // Read the value of the "decision" in the $reply array. $decision = $reply['decision']; // If decision=ACCEPT, indicate to the customer that the request was successful. // If decision=REJECT, indicate to the customer that the order was not approved. // If decision=ERROR, indicate to the customer that an error occurred and to try // again later. // Now get reason code results: // $strContent = getReplyContent( $reply); // See Processing the Reason Codes on page 35 for how to process the // reasonCode from the reply. // Note that getReplyContent() is included in this document to help you // understand how to process reason codes, but it is not included as part of the // sample scripts or sample PHP pages. else { handleError( $status, $request, $reply ); } //--------------------function handleError( $status, $request, $reply ) //--------------------// handleError() shows how to handle the different errors that can occur. { switch ($status) { // There was a problem with the parameters passed to cybs_run_transaction() case CYBS_S_PHP_PARAM_ERROR: // Non-critical error.
33
// Tell customer the order could not be completed and to try again later. // Notify appropriate internal resources of the error. break; // An error occurred before the request could be sent. case CYBS_S_PRE_SEND_ERROR: // Non-critical error. // Tell customer the order could not be completed and to try again later. // Notify appropriate internal resources of the error. break; // An error occurred while sending the request. case CYBS_S_SEND_ERROR: // Non-critical error. // Tell customer the order could not be completed and to try again later. break; // An error occurred while waiting for or retrieving the reply. case CYBS_S_RECEIVE_ERROR: // Critial error. // Tell customer the order cannot be completed and to try again later. // Notify appropriate internal resources of the error. // See the sample code for more information about handling critical errors. break; // An error occurred after receiving and during processing of the reply. case CYBS_S_POST_RECEIVE_ERROR: // Critical error. // Tell customer the order could not be completed and to try again later. // Look at CYBS_SK_RAW_REPLY in $reply for the raw reply. // Notify appropriate internal resources of the error. // See the sample code for more information about handling critical errors. break; // CriticalServerError fault case CYBS_S_CRITICAL_SERVER_FAULT: // Critial error. // Tell customer the order could not be completed and to try again later. // Read the various fault details from the $reply. // Notify appropriate internal resources of the fault. // See the sample code for more information about reading fault details and // handling a critical error.
34
CyberSource Corporation
break; // ServerError fault case CYBS_S_SERVER_FAULT: // Non-critical error. // Tell customer the order could not be completed and to try again later. // Read the various fault details from the $reply. // See the sample code for information about reading fault details. break; // Other fault case CYBS_S_OTHER_FAULT: // Non-critical error. // Tell customer the order could not be completed and to try again later. // Read the various fault details from the $reply. // Notify appropriate internal resources of the fault. // See the sample code for information about reading fault details. break; // HTTP error Case CYBS_S_HTTP_ERROR: // Non-critical error. // Tell customer the order cannot be completed and to try again later. // Look at CYBS_SK_RAW_REPLY in $reply for the raw reply. break; } }
35
Important Because CyberSource may add reply fields and reason codes at any time, you should parse the reply data according to the names of the fields instead of their order in the reply. The most important reply fields to evaluate are the following:
decision: A one-word description of the results of your request. The decision is one of the following:
ACCEPT if the request succeeded REJECT if one or more of the services in the request was declined REVIEW if you are an enterprise merchant using CyberSource Decision Manager
and it flags the order for review. See Handling Reviews on page 37 for more information.
ERROR if there was a system error. See Retrying When System Errors Occur on page 39 for important information about handling system errors.
reasonCode: A numeric code that provides more specific information about the results of your request.
You also receive a reason code for each service in your request. You can use these reason codes to determine whether a specific service succeeded or failed. If a service fails, other services in your request may not run. For example, if you request a credit card authorization and capture, and the authorization fails, the capture will not run. The reason codes for each service are described in the Business Center Simple Order API Users Guide (for Business Center users) or in the services implementation guide (for Enterprise Business Center users). Important CyberSource reserves the right to add new reason codes at any time. If your error handler receives a reason code that it does not recognize, it should use the decision to interpret the reply.
36
CyberSource Corporation
// Note that getReplyContent() is included in this document to help you understand // how to process reason codes, but it is not included as part of the sample scripts // or sample PHP pages. //---------------function getReplyContent( $reply ) //---------------{ $reasonCode = $reply['reasonCode'] switch ($reasonCode) { // Success case '100': return( sprintf( "Request ID: %s\nAuthorizedAmount: %s\nAuthorization Code: %s, $reply['requestID'], $reply['ccAuthReply_amount'], $reply['ccAuthReply_authorizationCode'] ) ); break; // Insufficient funds case '204': return( sprintf( "Insufficient funds in account. Please use a different card or select another form of payment." ) ); break; // Add other reason codes here that you need to handle specifically. For all // other reason codes, return an empty string, in which case, you should // display a generic message appropriate to the decision value you received. default: return ( '' ); } }
Handling Reviews
If you use CyberSource Decision Manager, you may also receive the REVIEW value in the decision field. REVIEW means that Decision Manager has marked the order for review based on how you configured the Decision Manager rules. If you will be using Decision Manager, you have to determine how to handle the new
REVIEW value. Ideally, you will update your order management system to recognize the
37
REVIEW response and handle it according to your business rules. If you cannot update your system to handle the REVIEW response, CyberSource recommends that you choose one of these options:
If you authorize and capture the credit card payment at the same time, treat the REVIEW response like a REJECT response. Rejecting any orders that are marked for review may be appropriate if your product is a software download or access to a Web site. If supported by your processor, you may also want to reverse the authorization. If you approve the order after reviewing it, convert the order status to ACCEPT in your order management system. You can request the credit card capture without requesting a new authorization. If you approve the order after reviewing it but cannot convert the order status to ACCEPT in your system, request a new authorization for the order. When processing this new authorization, you must disable Decision Manager. Otherwise the order will be marked for review again. For details about the API field that disables Decision Manager, see the Decision Manager Developers Guide. Alternately, you can specify a custom business rule in Decision Manager so that authorizations originating from a particular internal IP address at your company are automatically accepted. If supported by your processor, you may want to reverse the original authorization.
38
CyberSource Corporation
This tells CyberSource to continue processing the capture even if the AVS result causes CyberSource to decline the authorization. In this case you would then get reply fields for both the authorization and the capture in your reply. Note You are charged only for the services that CyberSource performs.
Search for the transaction in the Enterprise Business Center or the Business Center (depending on which one you normally use), look at the description of the error on the Transaction Detail page, and call your processor to determine if and why they are rejecting the transaction. Contact CyberSource Customer Support to confirm whether your error is truly caused by a CyberSource system issue.
If Vital is your processor, you may want to follow the first suggestion as there are several common Vital processor responses that are returned to you as system errors and that only Vital can address.
39
40
CyberSource Corporation
Chapter 5
Using XML
This chapter describes how to request ICS services using XML and includes these sections: Other Documentation You Need Requesting ICS Services Sample Code Creating a Request Document Sending the Request Interpreting the Reply Requesting Multiple Services Retrying When System Errors Occur
Business Center Simple Order API Users Guide: Describes the API for using the CyberSource ICS Credit Card Services and other payment services.
Credit Card Services Implementation Guide: Describes the API for using the CyberSource ICS Credit Card Services. Make sure when you read this guide that you read the Simple Order API chapter and NOT the SCMP API chapter. Implementation guides for any other ICS services you are planning to use. These are available in the documentation area of the Support Center.
41
Collects information for the ICS services that you will use Assembles the order information into requests Sends the requests to the CyberSource server Important The CyberSource servers do not support persistent HTTP connections.
The instructions in this chapter explain how to write the code that requests these services. You will need another guide, as described in Other Documentation You Need on page 41, to get a list of the API fields (XML elements) to use in your requests.
Sample Code
We suggest that you examine the name-value pair sample code provided in authCaptureSample.php before implementing your code to process XML requests. The sample will give you a basic understanding of how to request CyberSources ICS services. The sample code file is located in the <installation directory>/samples/nvp directory. After examining that sample code, read this chapter to understand how to create code to process XML requests. Note that the code in this chapters example is incomplete. For a complete sample program, see the authSample.php file in the <installation directory>/samples/xml directory.
42
CyberSource Corporation
The following example shows a basic XML document for requesting ICS services. In this example, Jane Smith is buying an item for $29.95. The XML document in this example is incomplete. For a complete example, see the auth.xml document in the samples/xml directory.
When you construct a request, you need to indicate the correct namespace for the elements, and the namespace must use the same API version that you specify in the configuration settings file. For example, if targetAPIVersion=1.18 in the cybs.ini file, the namespace must be urn:schemas-cybersource-com:transaction-data-1.18. Note The XML document that you receive in the reply always uses a prefix of c: (for example, xmlns:c="urn:schemas-cybersource-com:transaction-data-1.18"). Make sure you use an XML parser that supports namespaces.
43
Requesting a Sale
You can request multiple services by adding additional elements. For example, if you fulfill the order immediately, you can request a credit card authorization and capture together (referred to as a sale):
<?xml version="1.0" encoding="utf-8"?> <requestMessage xmlns="urn:schemas-cybersource-com:transaction-data1.18"> <merchantID>infodev</merchantID> <ccAuthService run="true"/> <ccCaptureService run="true"/> </requestMessage>
44
CyberSource Corporation
The example above shows only a partial list of the fields you need to send. Refer to Other Documentation You Need on page 41 for information about the guide or guides that list all of the fields for the service(s) you are requesting.
Note The namespace that you specify in the XML document must use the same API version that you specify in the configuration settings file. For example, if targetAPIVersion=1.18 in the file, the namespace must be urn:schemas-cybersourcecom:transaction-data-1.18. The example code below retrieves the API version from the configuration settings file and places it in the XML document.
45
46
CyberSource Corporation
' Note that getReplyContent() is included in this document to help you understand ' how to process reason codes, but it is not included as part of the sample ' scripts or sample PHP pages. else { handleError( $status, $request, $reply ); } //--------------------function handleError( $status, $request, $reply ) //--------------------{ switch ($status) { // There was a problem with the parameters passed to // cybs_run_transaction() case CYBS_S_PHP_PARAM_ERROR: // Non-critical error. // Tell customer the order could not be completed and to try again later. // Notify appropriate internal resources of the error. break; // An error occurred before the request could be sent. case CYBS_S_PRE_SEND_ERROR: // Non-critical error. // Tell customer the order could not be completed and to try again later. // Notify appropriate internal resources of the error. break; // An error occurred while sending the request. case CYBS_S_SEND_ERROR: // Non-critical error. // Tell customer the order could not be completed and to try again later. break; // An error occurred while waiting for or retrieving // the reply. case CYBS_S_RECEIVE_ERROR: // Critial error. // Tell customer the order could not be completed and to try again later. // Notify appropriate internal resources of the error. // See the sample code for more information about handling critical errors.
47
break; // An error occurred after receiving and during processing // of the reply. case CYBS_S_POST_RECEIVE_ERROR: // Critical error. // Tell customer the order could not be completed and to try again later. // Look at CYBS_SK_RAW_REPLY in $reply for the raw reply. // Notify appropriate internal resources of the error. // See the sample code for more information about handling critical errors. break; // CriticalServerError fault case CYBS_S_CRITICAL_SERVER_FAULT: // Critial error. // Tell customer the order could not be completed and to try again later. // Read the various fault details from the $reply. // Notify appropriate internal resources of the fault. // See the sample code for more information about reading fault details and // handling a critical error. break; // ServerError fault case CYBS_S_SERVER_FAULT: // Non-critical error. // Tell customer the order could not be completed and to try again later. // Read the various fault details from the $reply. // See the sample code for information about reading fault details. break; // Other fault case CYBS_S_OTHER_FAULT: // Non-critical error. // Tell customer the order could not be completed and to try again later. // Read the various fault details from the $reply. // Notify appropriate internal resources of the fault. // See the sample code for information about reading fault details. break; // HTTP error Case CYBS_S_HTTP_ERROR:
48
CyberSource Corporation
// Non-critical error. // Tell customer the order could not be completed and to try again later. // Look at CYBS_SK_RAW_REPLY in $reply for the raw reply. break; } }
decision: A one-word description of the results of your request. The decision is one of the following:
ACCEPT if the request succeeded REJECT if one or more of the services in the request was declined REVIEW if you use CyberSource Decision Manager and it flags the order for
page 53 for important information about handling system errors. reasonCode: A numeric code that provides more specific information about the results of your request.
You also receive a reason code for each service in your request. You can use these reason codes to determine whether a specific service succeeded or failed. If a service fails, other services in your request may not run. For example, if you request a credit card authorization and capture, and the authorization fails, the capture will not run. The reason codes for each service are described in the Business Center Simple Order API
49
Users Guide (for Business Center users) or in the services implementation guide (for Enterprise Business Center users). We reserve the right to add new reason codes at any time. If your error handler receives a reason code that it does not recognize, it should use the decision to interpret the reply.
50
CyberSource Corporation
// Note that getReplyContent() is included in this document to help you understand // how to process reason codes, but it is not included as part of the sample // scripts or sample PHP pages. // This code assumes you have a method called getField() that retrieves the // specified field from the XML document in $reply[CYBS_SK_XML_DOCUMENT]. //---------------function getReplyContent( $reply ) //---------------{ $reasonCode = $reply['reasonCode'] switch ($reasonCode) { // Success case '100': return( sprintf( "Request ID: %s\nAuthorizedAmount: %s\nAuthorization Code: %s, getField( $reply, 'requestID' ), getField ($reply, 'ccAuthReply/amount' ), getField( $reply, 'ccAuthReply/authorizationCode' ) ) ); break; // Insufficient funds case '204': return( sprintf( "Insufficient funds in account. Please use a different card or select another form of payment." ) ); break; // add other reason codes here that you need to handle specifically. For all // other reason codes, return an empty string, in which case, you should // display a generic message appropriate to the decision value you received. default: return ( '' ); } }
51
Handling Reviews
If you use CyberSource Decision Manager, you may also receive the REVIEW value in the decision field. REVIEW means that Decision Manager has marked the order for review based on how you configured the Decision Manager rules. If you will be using Decision Manager, you have to determine how to handle the new REVIEW value. Ideally, you will update your order management system to recognize the REVIEW response and handle it according to your business rules. If you cannot update your system to handle the REVIEW response, CyberSource recommends that you choose one of these options:
If you authorize and capture the credit card payment at the same time, treat the REVIEW response like a REJECT response. Rejecting any orders that are marked for review may be appropriate if your product is a software download or access to a Web site. If supported by your processor, you may also want to reverse the authorization. If you approve the order after reviewing it, convert the order status to ACCEPT in your order management system. You can request the credit card capture without requesting a new authorization. If you approve the order after reviewing it but cannot convert the order status to ACCEPT in your system, request a new authorization for the order. When processing this new authorization, you must disable Decision Manager. Otherwise the order will be marked for review again. For details about the API field that disables Decision Manager, see the Decision Manager Developers Guide. Alternately, you can specify a custom business rule in Decision Manager so that authorizations originating from a particular internal IP address at your company are automatically accepted. If supported by your processor, you may want to reverse the original authorization.
52
CyberSource Corporation
your business needs, you might choose to capture these types of declined authorizations anyway. You can set the businessRules_ignoreAVSResult field to true in your combined authorization and capture request:
<businessRules> <ignoreAVSResult>true</ignoreAVSResult> </businessRules>
This tells CyberSource to continue processing the capture even if the AVS result causes CyberSource to decline the authorization. In this case you would then get reply fields for both the authorization and the capture in your reply. Note You are charged only for the services that CyberSource performs.
Search for the transaction in the Enterprise Business Center or the Business Center (depending on which one you normally use), look at the description of the error on the Transaction Detail page, and call your processor to determine if and why they are rejecting the transaction. Contact CyberSource Customer Support to confirm whether your error is truly caused by a CyberSource system issue.
If Vital is your processor, you may want to follow the first suggestion as there are several common Vital processor responses that are returned to you as system errors and that only Vital can address.
53
54
CyberSource Corporation
Appendix A
This appendix describes how to generate security keys for merchants using the Business Center and merchants using the Enterprise Business Center. If you are not sure which type of merchant you are, see Who Should Read This Guide on page 1. Preparing to Generate a Key Generating a Key
55
To create a security key pair: 1 2 3 Log in to the Business Center at https://businesscenter.cybersource.com. Click Settings > Account Info in the navigation pane. The Account Information page appears. In the Process Payment Transactions section, select Simple Order API.
4 5 6 7
In the Shopping Cart section, select Other. Scroll to the bottom of the page and click Update. In the navigation pane, click Transaction Security Keys. The Transaction Security Keys page appears. Proceed with Generating a Key on page 57.
56
CyberSource Corporation
Generating a Key
This figure shows the Transaction Security Keys page. Follow the instructions below to create a key.
Click Generate Key. The download may take several minutes during which the applet may appear as a large gray box. A warning message appears.
57
Generating a Key
Verify that the certificate is signed by CyberSource Corporation, and click Run. When the Generate Certificate Request button appears, the download is complete.
Click Generate Certificate Request. While a new key is generated, messages appear in the box. Your browser opens the Save As dialog box.
58
CyberSource Corporation
Choose a safe location for your key (<username>.p12). If you do not protect your security keys, the security of your CyberSource account may be compromised. The last line in the example below informs you that the process is finished and that a new key is stored in the location that you indicated:
Generating the certificate request. This may take several seconds. Certificate request generated successfully. Encoding the certificate request. Certificate request encoded successfully. Processing the certificate request. This may take several seconds. Certificate request processed successfully. Creating the key file contents. Key file contents created successfully. Please select a save location for your key file using the popup dialog. Writing the key file to the file system. Writing the key file to C:\Full_Path_that_you_chose. Key file written to the file system successfully. The password for the key file is your merchant id: <Merchant_ID>. The Certificate Manager has successfully completed all operations.
59
Generating a Key
To verify that your key is active, click Transaction Security Keys in the navigation pane. Your new key is listed at the bottom of the table.
60
CyberSource Corporation
Appendix B
The client uses a p12 security key to add a digital signature to every request that you send. During installation, you used a Java applet to generate that p12 key file (see Creating a Security Key on page 10). In the Business Center (for Business Center merchants) or the Enterprise Business Center (for enterprise merchants), you can view a list of the keys that you have generated. The keys, however, are listed there by their serial numbers, and not by their file names. If you are not sure which of your keys is the active one recognized by CyberSource, you may need to look at the serial numbers for the key files that you have stored locally to match them with the information shown in the Business Center or Enterprise Business Center. This section explains how to import a key file and view its serial number in a Web browser.
61
62
CyberSource Corporation
Click Certificates. The Certificates window shows a list of the certificates that have been imported. In this example, your key file is fstest.
5 6
Double-click the key file that you imported in the previous section. The Certificate window for that file opens. Click the Details tab. The window shows a list of fields and values, but the Serial Number field does not contain the serial number information that you want to see. Instead, the Subject field contains the correct information.
63
Click the Subject field. The lower window displays the serial number for the key file.
64
CyberSource Corporation
Appendix C
This appendix describes advanced configuration capabilities available with the client.
Namespace URI:
urn:schemas-cybersource-com:transaction-data-1.18.
Note When you go to the above URLs using a Web browser, you see a list of the supported versions of the APIs and the associated schema files. If in the future CyberSource changes these conventions, but we have not yet provided a new version of the client, you will be able to configure your existing client to use the new server and namespace conventions required by the ICS server.
65
the samples provided in the client package, you set the configuration parameters in cybs.ini file. All of the properties except merchantID can be prefixed with <merchantID>. to specify the settings for a specific merchant. Example Merchant-Specific Properties Settings If you have a merchant with merchant ID of merchant123, and you want enable logging only for that merchant, you can set the enableLog parameter to true for all requests that have merchant123 as the merchant ID:
merchant123.enableLog=true enableLog=false
66
CyberSource Corporation
Appendix D
This appendix explains the fields that you can use to describe your client application. Use these fields if you are building an application to sell to others, such as a shopping cart, that incorporates the client. Important Do not use the fields in this appendix if you are only integrating the client with your own store. Table 5 lists the client application fields that you can include in your request. You are not required to use any of these fields.
Table 5 Client Application Fields
Description Application or integration that uses the client (for example, ShoppingCart Pro or Web Commerce Server). Do not include a version number. The version of the application or integration (for example, 5.0 or 1.7.3). User of the application or integration (for example, jdoe).
clientApplicationVersion
String (50)
clientApplicationUser
String (30)
67
68
CyberSource Corporation
Index
A
alternate server settings 65 API version to use 18 authCaptureSample.php 6 authSample.php 6
E
enableLog 14 encoding 9 encrypting data 55 Enterprise Business Center 1, 11, 57 errors, system name-value pairs 39 XML 53
B
Business Center 1, 10, 55
C
ca-bundle.crt 15, 24 character set support 9 client application fields 67 configuration 13 configuration settings name-value pairs 30 XML 45 creating requests name-value pairs 30 XML 42 cybs.ini file 13
F
fields, adding to the request name-value pairs 31 XML 44
I
installation 11 IP addresses 10
J
Java applet 57
D
debugging 14 Decision Manager name-value pairs 36, 37 XML 49, 52 decisions name-value pairs 36 XML 49
K
keyFilename 14 keys creating 10, 55 viewing serial number 61 keysDirectory 13
L
log file 14
69
MT
M
merchantID 13 multiple merchant IDs 65 multiple services, requesting name-value pairs 38 XML 52
name-value pairs 39 XML 53 return status name-value pairs 32 possible values 23 XML 46 REVIEW decision name-value pairs 36, 37 XML 49, 52
S
sample code 5 sample PHP pages 6 sample scripts 15 security key creating 10, 55 viewing serial number 61 sendToProduction 13 server URL 65 serverURL 14 services adding to the request name-value pairs 31 XML 43 requesting multiple name-value pairs 38 XML 52 SSL certificate 55 sslCertFile 15 status name-value pairs 32 possible values 23 XML 46 Sun Java plug-in 57 system errors name-value pairs 39 XML 53 system requirements 9
N
namespace URI 43, 45, 65 namespaceURI 14 name-value pairs creating requests 30 handling replies 32
P
p12 file. See security key PHP example 5 PHP sample pages 6 private key 55 production server URL 65 proxyPassword 15 proxyServer 15 proxyUsername 15
R
reason codes name-value pairs 35 XML 49 replies name-value pairs 32 XML 46 requests with multiple services name-value pairs 38 XML 52 requests, creating name-value pairs 30 XML 42 requirements, system 9 resellers 10 retries
T
target API version 5, 14, 18 test server URL 65 testing the client 15 timeout 15
70
CyberSource Corporation
Index
U
UTF-8 9
V
Vital 39, 53
W
Web Services API 3
X
XML creating requests 42 example 5 handling replies 46 schema 42
71
XX
72
CyberSource Corporation