Payment Response
Payment Response
Payment Response
Table of Contents
About this Book.......................................................................................................................... 2
Copyright................................................................................................................................ 2
Introduction ................................................................................................................................ 3
What is Payment Response?................................................................................................. 3
The Payment Response Process .......................................................................................... 4
Reference .................................................................................................................................. 5
Setting Up .............................................................................................................................. 5
Payment Message ................................................................................................................. 6
Testing ................................................................................................................................. 17
Shopper Response .............................................................................................................. 26
Dynamic Payment Response............................................................................................... 28
Recurring Payment Responses ........................................................................................... 30
Change description
Date
Affected Pages
4.3
September 2012
All pages
4.2
Fixed errors.
May 2012
All pages
4.1
February 2012
Page 18
4.0
December 2011
All pages
3.1
October 2011
Pages 6-7
3.0
WorldPay rebrand.
July 2011
All pages
Copyright
WorldPay (UK) Limited
While every effort has been made to ensure the accuracy of the information contained in this
publication, the information is supplied without representation or warranty of any kind, is
subject to change without notice and does not represent a commitment on the part of
WorldPay (UK) Limited. WorldPay (UK) Limited, therefore, assumes no responsibility and
shall have no liability, consequential or otherwise, of any kind arising from this material or any
part thereof, or any supplementary materials subsequently issued by WorldPay (UK) Limited.
WorldPay (UK) Limited has made every effort to ensure the accuracy of this material.
Introduction
What is Payment Response?
After a payment has been processed, either through to success or to cancellation,
information about that payment is sent to you by using the Payment Response feature.
The Payment Response feature posts the payment information from our server to a URL on
your server via HTTP(s). This enables you to validate the information, update the order and if
required display your own shopper result pages.
Benefits
The Payment Response enables you to:
Get more information about the payment than you would receive in the merchant
confirmation email.
Send the shopper additional information about their order in your own result pages or
an order confirmation email.
Use the information received to trigger actions in your own order system.
Pass your own order variables through our payment service and then back to your
server.
Check and validate all the payment data that WorldPay received and processed.
Examine any available fraud check results, such as those arising from verification of
Address, Security Code and Authentication information.
Maintain any recurring payment agreements.
Reference
This section provides detailed information about the Payment Response feature for your
reference. It includes detailed descriptions of:
Setting Up
Payment Message
Testing
Shopper Response
Dynamic Payment Response
Recurring Payment Responses
Setting Up
This section provides details on configuring your server to receive the Payment Message,
creating a server-side script to examine the message and how to enable the payment
response for an installation.
Use
Enabling Payment Response - change your installation to enable Payment
Response.
Configuring your server - configure your server to accept the Payment Message.
If your Payment Response URL starts with HTTPS:// you will need to make
sure that your server supports either SSL 3.0 or TLS 1.0.
The payment response server-side script can be used to trigger actions in your order system
or shopping cart facility and can send a shopper response to the shopper's browser via
WorldPay.
If your system requires a full redirect to your own Webpage, you can
include a META refresh (with a short delay) in the output of your payment
response script (shopper response).
Payment Message
Purpose
The Payment Message is a collection of parameters and related values detailing a shoppers
authorised or cancelled transaction. The Payment Message is sent to a server-side script
located on your server using the POST request method and via HTTP(s).
Below is an example of what the body of Payment Message looks like for an authorised
transaction:
region=Cambridgeshire&authAmountString=%26%23163%3B10.99&_SP.charE
nc=UTF8&desc=&tel=0870+366+1233&address1=WorldPay+Ltd&countryMatch=S&car
tId=test&address2=270289+The+Science+Park&address3=Milton+Road&lang=en&callbackPW=your_
password&rawAuthCode=A&transStatus=Y&amountString=%26%23163%3B10.9
9&authCost=10.99¤cy=GBP&installation=211616&amount=10.99&cou
ntryString=United+Kingdom&displayAddress=WorldPay+Ltd%0A270289+The+Science+Park%0AMilton+Road%0ACambridge%0ACambridgeshire&tr
ansTime=1331631533596&name=CARD+HOLDER&testMode=100&routeKey=VISASSL&ipAddress=62.249.232.76&fax=&rawAuthMessage=cardbe.msg.authori
sed&instId=211616&AVS=0001&compName=Admin++Company+Name&authAmount=10.99&postcode=CB4+0WE&cardType=Visa&cost
=10.99&authCurrency=GBP&country=GB&charenc=UTF6
8&email=support%40worldpay.com&address=WorldPay+Ltd%0A270289+The+Science+Park%0AMilton+Road%0ACambridge%0ACambridgeshire&tr
ansId=129170095&msgType=authResult&town=Cambridge&authMode=A
This section provides details of what is included in the Payment Message and how you can
add your own variables.
Use
Parameter descriptions - description of the parameters included in the Payment
Message.
Changing the Request Method - Use the GET Request Method to receive the
Payment Message.
Adding your own variables - pass your own variables from the purchase token back
to you in the Payment Message.
Payment Message Header - description of what is included in the Payment Message
Header.
description
cartId
desc
cost
amountString
currency
authMode
testMode
name
address1
address2
address3
town
region
Shoppers country/region/state or
area.
postcode
Shopper's postcode.
country
countryString
tel
fax
delvName
delvAddress1
delvAddress2
delvAddress3
delvTown
delvRegion
delvPostcode
delvCountry
delvCountryString
compName
transStatus
transTime
authAmount
10
authCurrency
authAmountString
rawAuthMessage
cardbe.msg.authorised - Make
Payment (test or live)
trans.cancelled - Cancel
Purchase (test or live)
rawAuthCode
callbackPW
cardType
countryMatch
Y - match
N - no match (i.e. mismatch)
B - comparison not available
I - contact country not supplied
S - card issue country not
available
11
AVS
wafMerchMessage
0 - Not supported
1 - Not checked
2 - Matched
4 - Not matched
8 - Partially matched
authentication
ARespH.card.authentication.0 =
Cardholder authenticated
ARespH.card.authentication.1 =
Cardholder/Issuing bank not
enrolled for authentication
ARespH.card.authentication.6 =
Cardholder authentication not
available
ARespH.card.authentication.7 =
Cardholder did not complete
authentication
ARespH.card.authentication.9 =
Cardholder authentication failed
12
charenc
_SP.charEnc
As charenc.
futurePayStatusChange
Callback Examples
Example: One-time payment
The following callback example shows a message returned for an authorised one-time
payment.
POST /fail?installation=XXXXXX&msgType=authResult HTTP/1.0ContentType: application/x-www-form-urlencoded; charset=UTF-8Host:
www.worldpay.comContent-Length: 973User-Agent: WJHRO/1.0 (WorldPay
Java HTTP Request
Object)region=new+format+region&authAmountString=%26%23163%3B10.00
&_SP.charEnc=UTF13
8&desc=&tel=&address1=new+format+address1&countryMatch=N&cartId=15
615166165&address2=new+format+address2&address3=new+format+address
3&town=city®ion=county&callbackPW=&lang=en&rawAuthCode=A&transS
tatus=Y&amountString=%26%23163%3B10.00&authCost=10.00¤cy=GBP
&installation=205844&amount=10.00&wafMerchMessage=waf.warning&coun
tryString=United+Kingdom&displayAddress=new+format+address1%0Anew+
format+address2%0Anew+format+address3%0Anew+format+town%0Anew+form
at+region&transTime=1313762603546&name=AUTHORISED&testMode=0&ipAdd
ress=192.168.90.15&fax=&rawAuthMessage=cardbe.msg.authorised&instI
d=205844&AVS=2004&compName=BG+Address+change&authAmount=10.00&post
code=postcode&cardType=Visa&cost=10.00&authCurrency=GBP&country=GB
&charenc=UTF8&email=test%40test.worldpay.com&address=new+format+address1%0Anew
+format+address2%0Anew+format+address3&transId=1300002227&msgType=
authResult&town=new+format+town&authMode=A
Example: Payment made within a FuturePay agreement
For an authorised payment made within a FuturePay agreement, the desc parameter
includes the following:
The Payment X of FuturePay agreement ID XXXXXXX string, where:
X is the payment number made within the agreement.
XXXXXXX is the FuturePay Agreement Id.
The &futurePayId= parameter.
The following example shows a FuturePay callback message, with the sensitive data
removed:
POST /fail?installation=XXXXXX&msgType=authResult HTTP/1.0ContentType: application/x-www-form-urlencoded; charset=UTF-8Host:
www.website.co.ukContent-Length: 800User-Agent: WJHRO/1.0
(WorldPay Java HTTP Request
Object)region=&authAmountString=%26%23163%3B59.99&_SP.charEnc=UTF8&desc=Payment+X+of+FuturePay+agreement+ID+XXXXXXX&tel=0770+XXX+XX
XX&address1=&countryMatch=S&cartId=CartId&address2=&address3=&lang
=en&callbackPW=&rawAuthCode=A&amountString=%26%23163%3B59.99&trans
Status=Y&authCost=59.99¤cy=GBP&installation=XXXXXX&amount=59
.99&countryString=United+Kingdom&displayAddress=20+Test+Road&name=
Mr+Smith&testMode=0&transTime=1343438417376&routeKey=ECMCSSL&ipAddress=&fax=&rawAuthMessage=cardbe.msg.authorised&instId=XX
XXXX&AVS=0111&compName=Company+Ltd&futurePayId=XXXXXXX&authAmount=
59.99&postcode=XXXXXX&cardType=MasterCard&cost=59.99&authCurrency=
GBP&country=GB&charenc=UTF8&email=mail%40test.com&address=20+Test+Road&transId=XXXXXX&msgTyp
e=authResult&town=&authMode=A
14
For parameters like name, address1, address2, town, region and email where the shopper
has entered the value, we recommend that you add a -urlenc modifier to the WPDISPLAY
ITEM tag, as shown above. This encodes certain characters so that they can be correctly
sent and decoded by you payment response server-side script. The characters that require to
be encoded are less than ASCII 34 ("), greater than ASCII 122 (z), and characters in the
following list:
!#$%^&()+=[]\`':;?@/<>
15
For further information about how to add your own variables to the purchase token, please
refer to the Hosted Payment Page (HTML Redirect) Guide.
If you customise your payment page to include paymentTopFields.html,
paymentMiddleFields.html or paymentBottomFields.html and these files
have input fields to collect additional information during the payment
process. If the shopper cancels the purchase, the additional information
collected will not be returned to you in the Payment Message.
The values collected using your own variables are not stored by us once
the Payment Message has been sent to your server.
Send: Details of the Request Method, the URL query string for the location of your payment
response server-side script and the protocol of how it is sent.
We insert the msgType and installation parameters to the end of the URL
query string.
Content-Type: Details the encoding of the message and the character set used. The charset
value may not always be set ISO-8859-1, as it is set to the charset used to display the
payment page to the shopper.
Content-Length: A count of the number of characters that is contained in the body of the
Payment Message.
Host: The name and port of the web server that the Payment Message is sent to.
User-Agent: We use a non standard user-agent to send you the Payment Message and
therefore, may have an impact on the configuration of some server-side scripting.
16
If you are using the User-Agent to control what is displayed to the shopper
in the Shopper Response, we recommend that you capture the User-Agent
that the shopper is using and include this value in your purchase token
using a M_ variable.
Testing
Purpose
This section provides details on how you can test if you are receiving the Payment Message
and how you can check its content.
Use
Enabling the failure email - to change your installation to enable the failure email.
Failure Messages - to view or edit the description of the failure messages included in
the failure email.
Suspension of Payment Response - to view the explanation for when is the Payment
Response feature suspended and to reactivate the Payment Response after a
number of failures.
Checking the Transaction Status - to check if a shopper's transaction has been
authorised.
Validate the Payment Response - to check if the Payment Message was sent from
our server and review the fraud indicators.
17
As a default the failure email will include the Payment Message and any error logs created. If
you no not wish to receive these attachments in your failure email:
1. Log in to the Merchant Interface.
2. Select Installations from the left hand navigation.
3. Choose an installation and select the Integration Setup button for either the TEST
or PRODUCTION environment.
4. Uncheck the Attach Payment Message to the failure email checkbox.
5. Select the Save Changes button.
Failure messages
The table below details all of the possible failure messages that are included in the Payment
Response failure email:
failure messages
meaning
A value is required
Broken pipe,
Cannot create output stream,
Socket closed
18
19
Destination address is
prohibited
20
running.
no longer running.
- Connection refused
Failed to do merchant HTTP
request. Check that you have the
correct URL and that the
merchant server is up and
running.
- Connection reset by peer
- javax.net.ssl.SSLException:
Unrecognized SSL handshake
Failed to do merchant HTTP
request. Check that you have the
correct URL and that the
merchant server is up and
running.
- No route to host
Failed to do merchant HTTP
request. Check that you have the
correct URL and that the
merchant server is up and
running.
- Read timed out
Failed to do merchant HTTP
request. Check that you have the
21
22
When Payment Response feature is temporarily suspended, we will still attempt to send you
the Payment Message for the next 200 transactions. If all the 200 attempts fail, the Payment
Response feature is fully suspended and you will not receive any further payment messages
or failure emails.
If any of the attempts were successful, the Payment Response feature is automatically
reactivated and the failure count is reset to zero.
Manually Reactivating the Payment Response
Based on the information provided in the failure email, you will need to fix the problem with
either your payment response server-side script or the server connectivity, before you can
reactive the Payment Response.
To reactive the Payment Response after it has been suspended:
1. Log in to the Merchant Interface.
2. Select Installations from the left hand navigation.
3. Choose an installation and select the Integration Setup button for the TEST
environment.
4. Review the Payment Response failure count to see how many attempts have
failed.
5. Un-check the Suspension of Payment Response checkbox.
6. Select the Save Changes button.
7. Submit a test transaction.
8. If this is successfully, the Payment Response is reactivated and the failure count is
reset to zero.
9. Repeat the process on the PRODUCTION environment.
We recommend that you store critical information about the shopper's
order before submitting a Purchase Token, so the information is not lost in
the event of a Payment Response Failure.
23
24
countryMatch
The countryMatch parameter displays the value for the comparison of the cardholder country
with the issue country of the card used by the shopper.
AVS
The AVS parameter displays a value for each of the checks done on the Card Verification
Value, postcode, address and country comparison
wafMerchMessage
The wafMerchMessage parameter is included in the Payment Message, only if the Risk
Management service has identified that an authorised transaction should be investigated
further.
The value waf.caution will be returned if there are inconsistencies in the transaction
characteristics that warrant further checks. These inconsistencies are likely to be based on
discrepancies in the billing address details (e.g. address verification mismatches).
The value waf.warning will be returned if there is a significant discrepancy in the billing
address details and/or a Card Security Code mismatch and/or an unusual pattern of shopping
activity (e.g. a higher rate of purchases containing the same shopper or card detail than we
would normally expect).
authentication
The authentication parameter is included in the Payment Message, only if you have enrolled
into the Verified By Visa, MasterCard SecureCode or American Express SafeKey
authentication schemes.
For further information about the fraud indicator listed above, refer to Parameter descriptions.
We recommend that you record the values of the fraud indicators and IP
address and validate the content after the Payment Response process has
been completed.
25
Shopper Response
Purpose
The shopper response feature enables you to present a customised response to the
shopper's browser after a payment has been authorised or cancelled. This requires that your
payment response server-side script generates a valid HTML output, which we then retrieve
from your server and display to the shopper.
This section provides details of how to display your own response to the shopper.
Use
Enabling - change your installation to enable shopper response.
Creating - requirements for creating a shopper response.
Testing - reviewing the look and feel of the shopper response.
26
Displaying images
The HTML output generated by your payment response server-side script will be presented
to the shoppers' browser as if it had come from us. As such, any images that you wish to
display will need to be uploaded to your installation folder, and referred to within the HTML
output generated as follows, where xxxxx is your installation ID:
<img src="/i/xxxxx/imagename.gif">
You could also replace the installation ID with the WPDISPLAY item tag: <wpdisplay
item=instId> as we will replace this with the correct installation ID before the response is
displayed to the shopper.
<img src="/i/<wpdisplay item=instId>/imagename.gif">
This is helpful if you are running the same shopper response across a number of different
installations.
Including your own resources files and variables
You may wish to include your own resource file to the shopper response, i.e Cascading Style
Sheet files (.css). We recommend that you upload these files to your installation folder and
reference them in the HTML output as follows:
<link rel="stylesheet" href="/i/<wpdisplay
item=instId>/stylesheetname.css" type="text/css" />
To reference or link to any resource outside of your installations folder, the link included in the
HTML output must be absolute, in other words the full URL must be used.
If any resources used in the HTML output are fetched from an http:// address the shopper
may see a warning message from their browser that states that there is a mixture of secure
and insecure items is being used on the page. This warning message may be of concern to
shoppers who have just entered their payment details on our payment service. Therefore, we
recommend that you try to avoid referencing resources outside of your installation folder or
that you reference the resource files from a secure server that has an https:// address.
To include additional payment parameters in the Shopper Response, you will need to add
your own variables to the purchase token with either the C_ or MC_ prefix. Variables prefixed
with M_ are not available for use in the shopper response. For more information refer to:
Adding your own variables.
27
meaning
To get full details about of any shopper response failure, enable the failure email and select
that you wish to attach the Payment Message and error logs to the email. The errors logs will
indicate to you what we tried to retrieve from your server and therefore, what has caused the
failure.
28
Once included in your purchase token you will need to configure your installation to accept
the dynamic URL variable, refer to Configuring your installation to accept a dynamic payment
response.
29
This will then send the Payment Message to the default URL stated in the empty property,
unless we receive a payment response URL from the purchase token.
30
31
Example 1
<wpdisplay item=MC_callback-ppe
empty="http://www.myserver.com/callback.cgi">
Example 2
<wpdisplay item=MC_callback-ppe empty="<wpdisplay
item=rawAuthCode-ppe pre='http://www.myserver.com/fppayment.cgi?'
empty='http://www.myserver.com/fpcancel.cgi'>">
32