PayWay API Developers Guide
PayWay API Developers Guide
Page 2
Table of Contents
1 Introduction ..................................................................................................... 5
2.3.2 Support..................................................................................................... 12
Page 3
3.3.1.1 Using Recurring Billing and Customer Vault to hold Credit Card Details........... 24
Page 4
1 Introduction
Westpac is utilising technology developed by our Qvalent subsidiary in conjunction with
existing market leading transactional banking products to provide comprehensive
receivables management solutions.
This document describes the solution offered to meet the business needs of customers
requiring on-line credit card processing through a software API in Australia. This is
provided as a component of PayWay.
Pre-authorisations reserve funds from a nominated credit card and capture later
The API supports multiple connectivity options (Internet, Leased Line) and technologies
(Java, COM, ASP, .NET, PHP and SOAP) so there is a solution to suit most customers. All
major credit and charge card types such as Visa, Mastercard, Bankcard, Amex, JCB and
Diners1 may be processed through PayWay. EFTPOS debit card transactions can not be
processsed.2
The actual concept of the API is simple. The Customer System will send a Credit Card
API Request to PayWay, containing either:
1
A separate merchant agreement is required for accepting American Express and Diners
Club and Japanese Credit Bureau (JCB) charge card transactions.
2
In order to process a EFTPOS Debit Card, the card must be physically swiped by a
approved device.
3
This mode of operation requires that your PayWay facility also have the Recurring
Billing and Customer Vault module.
Page 5
PayWay will send back an API Response, containing details on whether the transaction
was successful or not.
For ad-hoc transactions it is recommended that the customer use the virtual terminal
facility that is available through the PayWay customer web interface
(https://www.payway.com.au). If a customer has a batch of credit card transactions that
are not required to be processed in real-time, then it is recommended that they
investigate a complementary Westpac product called Batch advantage
(https://www.batchadvantage.qvalent.com).
1.2 Is it Secure?
For a solution of this nature, security is critical. Westpac must be absolutely confident
that they are receiving a credit card processing request from an authorised source. To
ensure the source of the request is valid:
The Merchant must be registered before credit card processing will begin. Part of this
registration will be to issue the customer with a username and password. This
username/password combination must be passed in with every request.
For high volume customers Qvalent will recommend that a leased line (i.e. Frame
Relay) be installed between the customers site and Qvalents data centre. If you
intend to perform more than 100,000 transactions per month through the Credit
Card API, please discuss this option with your Westpac implementation manager.
For added security a card verification number (CVN) can be supplied with the credit
card API call.
Page 6
All transaction data will be communicated via HTTPS with 128-bit encryption and
each message digitally signed (MAC). A digital certificate is provided to each
customer for this purpose.
Using the API in conjunction with the PayWay Recurring Billing and Customer Vault
module means that the merchant does not need to store or handle credit card details
in their system.
Leased line. Dedicated link between the customers site and Westpacs credit card
server. In this scenario, no data would be transmitted over the Internet. Username /
password and digital certificate are required.
Internet. Credit card transactions are passed over the Internet. Username / password
and digital certificate are required.
In both cases above, Qvalent will provide you with a digital certificate (via download),
username and password. This certificate will be in the form of a file that you will deposit
into a directory on your server. Qvalent also will ask you to set up the IP addresses
which are allowed to send transactions for your company.
All attempts to use the credit card service are logged. This includes Internet connections,
API calls and the success or failure of those calls. Logs will be written to permanent
storage. Logging will include the IP address of the caller and all the information sent and
received to that destination.
Credit card numbers and expiry dates are stored in encrypted form in the
database. Credit card numbers are recorded in truncated form in system logs (ie
first few and last few digits only)
Card verification number (CVN) is not stored in the database or in system logs.
The value is passed on as is to the banking network and only a record of whether
a value was provided or not is retained.
Finally, refunds are restricted to only be allowed against previous captures so there is no
risk of fraudulent activity within your business.
This document has lots of pages and sections. We have tried to include as much detail as
possible for customers wishing to implement the PayWay Credit Card API solution so you
have all the information you need at your fingertips. Due to its contents, it can be quite
daunting at first read, however not all sections are relevant to all customers.
We recommend that the document be examined by your IT staff with a quick skim
through at first and then start working through the steps documented in Section 1 in
order to implement the solution. If you have any questions that cannot be answered
Page 7
from the document, please direct these to your Westpac implementation contacts.
Page 8
2.1 Setup
Follow these steps:
1. Sign-in to the PayWay website using the login name and password provided to you
by your implementation manager.
2. Download the API software for your technology from the PayWay web site. The
supported technologies are Java, Microsoft .NET, Microsoft COM/ASP, PHP and
SOAP. Click on Setup API in the menu and then Downloads.
3. Extract the software bundle (which is a ZIP file) to a folder, and review the
PayWay API for PDF document in that folder. Follow the instructions in that
document to install the API software.
4. In necessary, configure your firewall to allow outbound SSL traffic (port 443) and
determine if you need to use a proxy server to communicate with the PayWay
server.
5. Get your API username and password from the PayWay web site and record these
details for use in your application. This is information listed on the Security
page under the Setup API heading. Note that this username and password is for
your application to connect with the PayWay API server and is different from the
username and password that you use to access the PayWay web site.
6. Download your certificate from the PayWay web site on the Certificate page
under the Setup API heading. You must first select the technology you are using
and press the Go button, since different certificate formats are required
depending on your application technology. Record the location of the certificate
file for use in the initialisation of the PayWayAPI object.
7. Develop your API solution by integrating the API into your application (section 3
provides more detail on this).
Page 9
2.2 Testing
For any customer wishing to implement our credit card API, we provide a test merchant
which simulates responses rather than sending the transaction to the live banking
network. This test merchant is accessed through the normal production URL, but the
customer merchant specified is TEST.
When using the test merchant, only the card numbers in Table 2.1 are valid. All other
card numbers will return a response of 42 No Universal Account. Each card number
will return a specific response as detailed in Table 2.1, so if you want to test a card
which has low funds, you would use card number 4564710000000020 with an amount
higher than $10. Note that if you enter an incorrect expiry date for one of the test
cards, you will get a response of 54. If you enter an incorrect CVN, you will get a
response of 01 or 05 depending on the card type.
The test merchant simulates a live gateway but may be used without any risk of
transactions actually being processed through the banking system.
Refer to the technology specific API documentation provided on how to carry out a test
transaction.
Page 10
1. Sign-in to PayWay
2. Click Search and Refund under the Transactions menu item
3. Select the Settlement Date4 of the transaction and Test Test Merchant
4. Click Search
1. Sign-in to PayWay
2. Click Add Customer
3. Choose a customer number (e.g. TESTCUSTOMER1) and enter a name
4. Select Variable Debit
5. Click Next
6. Choose Credit Card
7. Click Next
8. Enter one of the test card numbers listed above.
9. Click Next
10. Confirm the details and click Save
You can now call the Credit Card API and pass in the customer number you selected
instead of card details (see Using Recurring Billing and Customer Vault to hold Credit
Card Details, page 24). In your API request specify:
customer.mercant=TEST&customer.customerReferenceNumber=TESTCUSTOMER1
If you wish to disable the test customer, you can do this as follows:-
1. Sign in to PayWay
2. Click Search and Edit in the menu
3. Enter the customer number of the test customer (e.g. TESTCUSTOMER1)
4. Click Search
5. Click Edit Customer
6. Choose Recurring Billing Setup and click Go
7. Click Stop Remaining Payments
8. Confirm that you wish to Stop Remaining Payments
The customer is now stopped and can not be charged through the API.
2.3 Production
4
Transactions processed after 6pm Sydney time settle on the following day.
Page 11
Once you press this button, you may perform live transactions against your live
merchant id. However, you may still use your TEST merchant id to perform test
transactions. Transactions to your TEST merchant will not appear on the cardholder
statement or your bank account.
We recommend that you process one live transaction before you start sending all your
transactions to the new system. The day after you perform this test transaction, you
should check your settlement account to make sure that the funds from this transaction
arrived in your account. Once this verification is done, you can then switch all your live
transactions to the new system.
2.3.2 Support
For issues relating to your Merchant agreement with Westpac, contact Merchant
Business Solutions on 1800 029 749.
For issues relating to your Merchant agreement with American Express, contact
Amex on 1300 363 614.
For issues relating to your Merchant agreement with Diners Club, contact Diners
on 1300 360 060.
For issues relating to the Payway website or Credit Card API, contact your
Implementation Manager or Payway Customer Care by phone on 1300 727 111
(available Monday to Friday, 8:30 am. to 5:30 pm AEST)
For issues relating to Credit Card API development, email Payway Customer Care
([email protected]). Please include your name, client number, description of
the issue and a copy of the log file in the email. The log file can be found in the
logDirectory you selected (see section 3.1.3).
Page 12
1. Customer calls the API initialise method. This loads the URL, loads the certificate and
initialises SSL.
2. The Customer uses the processCreditCard client command to submit a credit card
transaction. The API digitally signs the request to allow the PayWay server to verify
the request originator and sends the request to the PayWay server.
3. The Customer waits for a response to be returned through the API connection.
4. The PayWay server verifies the digital signature, merchant username / password
and IP address of the originating request. If all these are valid, the server verifies the
other credit card request parameters.
5. The PayWay server contacts the issuing bank and requests authorisation for the
credit card transaction.
6. The PayWay server returns the Response to the Customer through the HTTPS
connection established in step 1.
7. The API reads the Response and returns it to the process that initiated the API
request.
Depending on the technology used, this process is then can the repeated from step 2 for
further Request/Response cycles to process additional credit cards. Refer to your
Page 13
technology specific API document for more details on whether the API object can be re-
used for additional transactions.
Java
Microsoft Component Object Model (COM) and Active Server Pages (ASP)
Microsoft .NET
PHP
This software API provides an object in the relevant programming language which
performs all the communication with the Westpac PayWay server. The objects contain
the same methods/functions regardless of the technology, and these are listed below.
The method names start with lower case for Java and PHP, and upper case for Microsoft
technologies, according to the relevant conventions
Page 14
The parameters are still sent and received in the same format as for all other
technologies (i.e. one long string containing all request parameters, delimited by an
ampersand (&)). Section 3.1.3 on initialising the API will not be relevant to you, but all
other sections of this document still apply.
The SOAP method to process a credit card is called processCreditCard and has the
same signature and behaviour as described in Table 3.1.
Page 15
Where you store this information in your application is up to you. The best solution is to
make this information of your applications standard configuration. For example, if your
configuration is stored in an XML file, add this information to that XML file and read it
from your application. It is unwise to hard-code values for these parameters in your
software, since you may wish to change them in the future.
certificateFile=d:\payway\payway.q0&logDirectory=d:\payway
Note that there should be no spaces or line breaks in the parameters string.
Any errors during initialisation will be reported through your technologys usual
mechanisms (e.g. the Java and .NET objects will throw an exception, the PHP object will
raise an error). These errors normally relate to invalid parameters being specified (such
as a non-existent certificate file), or invalid system configuration (such as missing
required libraries). By default, a 60 second timeout will apply for the initialisation.
Once the object has been initialised, you may call the processCreditCard method to
process credit card transactions. It is possible to call processCreditCard multiple times
on the same object from multiple threads depending on your technology. Refer to your
technology specific API document for more details.
Page 16
The same format applies regardless of whether you are using Qvalent PayWay API
software or the SOAP interface.
Only use standard ASCII characters in your parameter values. Do not use any of the
following special characters in your parameter values:
Page 17
Page 18
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 19 - API Developer's Guide
PayWay
Page 19
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 20 - API Developer's Guide
PayWay
Page 20
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 21 - API Developer's Guide
PayWay
Page 21
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 22 - API Developer's Guide
PayWay
Page 22
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 23 - API Developer's Guide
PayWay
Page 23
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 24 - API Developer's Guide
PayWay
The above parameters string has been split at the ampersand (&) markers for
readability. When you construct your parameters string, you should not include any
spaces or line breaks.
The above parameters string has split at the ampersand & markers for readability. The
response parameters you receive will not contain these extra line breaks.
If you have both the PayWay API and Recurring Billing and Customer Vault modules, you
can:
register a customer number and associated credit card details via a web page or
via the API (see section 3.5),
charge the customer by passing the customer number and amount using the
Application Programmer Interface (API).
Your software has full control over transaction processing without needing to store credit
card details. This solution can potentially reduce your obligations under Payment Card
Industry Data Security Standards (PCI DSS) compliance.
Page 24
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 25 - API Developer's Guide
PayWay
When the card-holder registers his/her credit card details using the Recurring Billing and
Customer Vault module, the details are recorded against a customer reference number
that you supply. The customer reference number must be unique each card-holder
may only register one credit card.
Customers can be registered by you. Sign in to PayWay and click Add under the
Customers menu item. Alternatively, you can have them self-register on a Westpac
hosted web page (See Internet Sign Up for Recurring Billing in the PayWay User Guide,
which is available from the Downloads section of the PayWay website).
Alternatively, customers can be registered via the API. See section 3.5 for more details.
A list of registered customers can be found by signing into PayWay and selecting
Search and Edit under the Customers menu item.
An Electronic Commerce Transaction is one where the cardholder enters their card
details into a merchants website and the transaction is processed immediately.
According to Card Scheme rules, merchants must collect the Card Verification Number
(CVN) for all electronic commerce transactions. This means that if you provide an ECI
value from the table below that represents an Electronic Commerce Transaction, you
must also provide the CVN in the card.CVN parameter.
Note: PCI DSS requires that the CVN must never be stored in any card processing
system.
Page 25
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 26 - API Developer's Guide
PayWay
1
The REC ECI value is only applicable to Visa and MasterCard transactions that satisfy
the Visa Recurring and MasterCard Recurring scheme rules.
2
The numeric ECI values are only available when the transaction contains the 3D Secure
order.xid and order.cavv fields. Depending on your 3D Secure MPI software, you may
need to convert the MasterCard ECI values to the Visa ECI values depicted above.
Although all parameters should be supplied as per normal, the following includes an
explanation of the key API parameters required for a refund against an original capture:
order.type=refund
Page 26
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 27 - API Developer's Guide
PayWay
order.type=query
For most transactions, the response will include the previously returned response code.
However, if this was previously a summary code of 2 (ie Transaction Erred), the API will
attempt to determine an updated response code for the transaction if available. Since
order numbers are only unique per merchant, make sure you are using the same
merchant ID as for the original transaction.
If you perform a query and receive a Q2 response, the original transaction is still being
processed. You should re-attempt the query after 60 seconds.
When executing a Query order, it is important to note that it is possible that the
response code indicates a failure with the query itself rather than the original transaction
itself. For example, the original transaction may have been successful but the
subsequent query fails due to a network issue. If this has occurred, a QI is returned for
the query.
One special case for queries is that a QG is returned if the order number supplied is
unknown. This may occur if your system has attempted a transaction that failed prior to
being attempted (eg network issues between your server and PayWay). In this case, the
original transaction was not attempted, and can be safely retried if required.
Firstly, the most common causes of customers performing duplicate payments via
ecommerce applications are:
Customer does not wait sufficient time for the transaction response to be
returned and they retry the transaction.
Due to a system or network issue, the customer does not receive a response from
your system and they retry the transaction.
Page 27
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 28 - API Developer's Guide
PayWay
In each case, safeguards can be put in place which virtually eliminate duplicate
payments.
If providing a web or screen interface, ensure that the Make Payment button can
only be clicked once and double-clicking will not attempt two transactions.
Once a customer has confirmed that they wish to pay, check if you have any
approved (summary code 0), pending or incomplete (summary code 2)
transactions for the same customer number, credit card number5 and amount
within a recent time period (eg 24 hours). If you do find a match, inform the
customer of the situation (eg Possible duplicate payment attempt. Please check
your statement and confirm whether transaction has been processed before
retrying.) but optionally give them the opportunity to proceed with executing the
payment if they wish.
Furthermore, the settlement date does not necessarily mean that the funds will be
5
For customers that do not wish to store credit card details in their system, we
recommend that a one-way hash algorithm instead be used for check if the same card is
being used.
Page 28
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 29 - API Developer's Guide
PayWay
credited on the settlement date returned. Again, this is up to the relevant acquiring bank
(see 3.3.2.2 for a list). However, for reconciliation purposes, all successful transactions
through a given acquirer that return the same settlement date will be credited together
on the same day.
Westpac credits your account the same day, except on weekends and public holidays
when the settlement is delayed until the next banking day. The amount credited is the
total of approved transactions. Any merchant service fees will be deducted as separate
transactions per your service agreement.
American Express and Diners Club may credit your account a number of days later and
may be a net amount (ie approved transactions less the merchant service fees),
depending on your contract with them. Although Westpac facilitates the processing of
the transaction, we do not control settlement for these schemes and therefore any
queries should be made to American Express and Diners Club directly.
The settlement date will be returned for all approved transactions. It will often be
returned for declined transactions but not all declined transactions. It will be returned
only if the transaction is stored in the PayWay database, but not transactions rejected
prior to this (for example: QJ - Incorrect Customer Password). For customers receiving a
transaction log, the settlement date may be used to reconcile the log with your own
records.
Table 3.4 lists the common values and their meanings. Note that the issuing bank may
potentially return some other CVN response code not listed in Table 3.4, or may not
return a CVN response at all.
1. If the transaction is approved, you do not need to check the CVN response.
Page 29
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 30 - API Developer's Guide
PayWay
3. Otherwise, ask the card holder to confirm that they entered all their card details
correctly. If all the card details are correct, ask the card holder for an alternative
form of payment.
Every transaction will be using a card from a particular card scheme, such as Amex or
Visa. However, the creditGroup indicates which transactions will be grouped together in
a single credit to the customers bank account. This occurs for Visa, Mastercard and
Bankcard transactions where Westpac will group all such transactions into a single credit.
However, Amex and Diners will be credited separately.
Table 3.5 Card scheme, credit group and acquiring bank relationships
3.3.3 Pre-Authorisations
Most of the transactions you perform using the Credit Card API will be capture
transactions. These transactions are equivalent to a purchase using an EFTPOS device
(i.e. someone in a shop purchasing something and paying by credit card).
Capture transactions consist of these two parts, and they happen seamlessly to the API
user. However, the API allows customers to split the process into its two separate
components when this is required by a customers business model. This is the purpose
of the preauth and captureWithoutAuth transactions. The preauth transaction
Page 30
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 31 - API Developer's Guide
PayWay
reserves the funds, and the captureWithoutAuth transaction adds the transaction to
the list of clearances that will occur at the end of the day.
An example usage would be if a company had separate order processing and shipping
systems. The order processing system could first check the available funds using the
preauth transaction, and then send the order to the shipping system. When the goods
are ready to be shipped, the order processing system would send the
captureWithoutAuth transaction to complete the purchase. Separating these two
functions allows for the case where the goods are out of stock, or discontinued, since no
money has been taken from the card holders account.
An important consideration is the length of time that a pre-authorisation will last. This
time depends solely on the issuing bank and cannot be controlled by Westpac. Most
issuers will keep the funds reserved for at least three banking days. You should certainly
not assume that you can safely perform a preauth then perform the
captureWithoutAuth 4 weeks later.
This short lifetime of pre-authorisations is the main reason that most companies do not
use this feature. Most companies interested in pre-authorisations have a much longer
time between ordering and shipping (such as several weeks). The danger in sending the
captureWithoutAuth after the preauth has expired is that the issuing bank will raise a
charge back for the transaction.
Each pre-authorisation is given an identifier by the issuing bank so that the capture can
be matched to the reserved funds. To ensure that this matching occurs, you must
specify the order number of the preauth transaction in the
customer.originalOrderNumber parameter for the captureWithoutAuth transaction
request. You must generate a new order number for the captureWithoutAuth
transaction.
order.type = preauth
Page 31
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 32 - API Developer's Guide
PayWay
order.type = captureWithoutAuth
Remember:
Page 32
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 33 - API Developer's Guide
PayWay
order.type = captureWithoutAuth
3.3.4 Reversals
As described in section 3.3.3, each capture transaction is comprised of two parts behind
the scenes. Since the transaction value does not actually appear on the card holders
statement until the end of that day, it is possible to cancel, or reverse, a transaction
before it is cleared. Declined transactions do not need to be reversed.
The cut-off time for reversals is 6pm EST each day. For example, the settlement day of
25 Jan 2006 starts at 6pm on 24 Jan 2006, and ends at 6pm on 25 Jan 2006. Thus, any
transaction processed with during the 25 Jan 2006 settlement day can be reversed until
6pm 25 Jan 2006. You cannot reverse any such transactions after this time. Instead,
you should perform a refund if the original transaction was a capture, or perform a
capture if the original transaction was a refund.
To reverse a transaction, you create the request message and specify the order type as
reversal. You must also place the order number of the transaction you wish to reverse
in the original order number parameter. You should also specify the card number and
expiry date of the original transaction if you have them since extra checking of the
transaction will be performed in this case. Below are the details of the parameters for a
reversal transaction:
order.type=reversal
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 34 - API Developer's Guide
PayWay
If the reversal succeeds, a response code of 00 will be returned, and the response code
of the original transaction will be updated to 91. If you attempt to query the original
transaction, or view it through the administration screens, this is the status that you will
see. Your software should also update the response code of the original transaction to
91 for consistency.
Because of the limited time you have to reverse a transaction, the main use of reversal
transactions is to ensure that both your system and the PayWay system have a
consistent status for a transaction. For example, if you perform a capture and before
you receive a response, a network error is encountered, you could then reverse the
original transaction so that both systems mark the transaction with a 91 response code.
The following table lists the various reasons that a reversal will not be accepted, and the
response code you can expect to receive in that situation.
If the response is 00 or 21, then either the transaction has been reversed, or
does not need to be reversed.
If the response is 12, you should check the details of the transaction you are
trying to reverse. For example, you may be specifying the wrong original order
number.
Page 34
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 35 - API Developer's Guide
PayWay
You can think of your system like a physical EFTPOS terminal. A terminal transactions
on behalf of a user and displays the response. It must also deal with error conditions
like communications link failures.
Page 35
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 36 - API Developer's Guide
PayWay
When implementing the API, you should take care to correctly handle summary code 2
responses. In an ideal world, all transactions would simply succeed or fail. Unfortunately,
certain circumstances can mean that your system will not know the status of the
transaction. For example, a transaction may be received and processed by PayWay but a
network error may occur such that a response is not returned to your system. In this
case, your system will receive the Transaction Erred summary code or some other
network/timeout error. The network outage may last for some time and therefore your
exception handling process must handle this rare but possible situation.
When this situation arises in the EFTPOS world, the terminal performs the following
actions:
1. The terminal records the transaction as declined and informs the merchant and
cardholder of the declined status
2. A reversal message is sent to the bank to ensure that the transaction never takes
place
Your system needs to perform these same actions to ensure that the payment status is
always known. In addition to these actions, your system should alert your support staff
that a network error has occurred so that they can investigate the root cause. If they
cannot identify the cause of the issue and the issue is ongoing, they should contact
PayWay customer care as per Appendix B.
Firstly, your system should record the transaction status as 91 Issuer or switch
inoperative. This status should also be presented to the person using your system (e.g.
the card holder or one of your operators).
Secondly, your system must ensure that the transaction is reversed. You have two
options to accomplish this:
1. Your system can queue the reversal and keep sending it to PayWay until it is
successful.
Page 36
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 37 - API Developer's Guide
PayWay
2. Your system can inform an operator that a transaction must be reversed and they
can manually perform the reversal through the screens available on the PayWay
web site.
The manual option makes your system development simpler, but makes your support
processes more complicated. In either case, you must record the order number of the
original transaction for future reference. Pseudo-code for both options is provided below.
Manual Reversing
// Initial transaction attempt
ccResponse = processCreditCard ( capture/refund, other API parameters )
if ccResponse.summaryCode != 2 or network error
// This is the normal condition - transaction attempt is complete
Store transaction response and handle response
else
{
// Transaction status is unknown
Store transaction status as 91
Alert support personnel to perform a manual reversal
Alert support personnel to investigate network connectivity
}
Your support personnel will search for the transaction by order number, so ensure that
the order number is included in the alert that is sent to them.
Automatic Reversing
Building a system to reliably reverse a failed transaction can be a complex task. You will
need to permanently store a record to indicate that the transaction requires reversing.
These records need to be added to a reversal queue and this queue must be processed
by a separate background thread in your application. When a reversal is successful, your
system will update the reversal record accordingly and remove it from the reversal
queue. You will also need to ensure that when your system starts up, any outstanding
reversal records are added to the queue.
Page 37
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 38 - API Developer's Guide
PayWay
Repeat
Wait 60 seconds
Remove next reversal from the queue
ccResponse = processCreditCard ( reversal, other API parameters )
if ccResponse.responseCode = 12 (invalid transaction)
// Reversal details are incorrect
Record that reversal failed
Alert support personnel that reversal cannot be completed
else if ccResponse.responseCode = 00 or ccResponse.responseCode = 21
// Reversal was successful
Record that reversal was successful
else
// Reversal must be retried
Add this reversal back on to the queue
End Repeat
When creating the reversal request, you must include the order number of the original
transaction. See section 3.3.4 for more information. The reversal record that you store
should include this information.
Page 38
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 39 - API Developer's Guide
PayWay
capture
refund
preauth
captureWithoutAuth
reversal
To use the registered card details, you must provide the parameter
customer.customerReferenceNumber. This field can be provided as an alternative to
card.cardHolderName, card.expiryYear, card.expiryMonth, card.CVN and card.PAN.
Page 39
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 40 - API Developer's Guide
PayWay
Page 40
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 41 - API Developer's Guide
PayWay
The table below lists the most commonly received response codes. As a general rule you
should use the summary response code, which is supplied to determine whether a
transaction is approved or declined. The actual reason for a decline is often not
important, and the situation can usually be resolved by verifying the card details with
the customer, or asking them for a different card number.
If an unknown response code is returned please contact Westpac with the appropriate
transaction details.
Please note that there are no response codes specific to card verification number
mismatches. This is because no financial institutions in Australia currently return any
such information if declining a transaction.
Both the code and description of a response will be supplied by the API.
Summary Description
Code
0 Transaction Approved
1 Transaction Declined
2 Transaction Erred
3 Transaction Rejected
Page 41
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 42 - API Developer's Guide
PayWay
Page 42
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 43 - API Developer's Guide
PayWay
Page 43
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 44 - API Developer's Guide
PayWay
01 - Refer to Issuer
This indicates an error or problem on the issuer's side. The problem may be related to
the card holder's account. In general the reason for this response code may be any of
the following:-
Suspected Fraud
Insufficient Funds
Stolen Card
Expired Card
Invalid CVN
Any other rule imposed by the card issuer that causes a decline (e.g. daily limit
exceeded, duplicate transaction suspected, etc).
03 - Invalid Merchant
This can be returned by Westpac when there is a problem with the merchant
configuration. This can also be returned for AMEX transactions when there is a problem
with the setup at American Express. This code can be returned from an issuing bank if
they don't like the acquiring bank. An example of this would be someone trying to pay
their speeding fine with an overseas credit card. The overseas issuing bank would return
a 03, indicating that they wouldn't allow the transaction over the internet for an
Australian bank.
04 - Pickup Card
Error code 04 normally means that the card has been reported as lost or stolen. In all
cases where this response code is being returned and the customer does not know why
they need to follow this up with the issuing bank.
05 - Do Not Honour
This code is usually returned from Westpac for Westpac issued cards for similar reasons
that other issuers return 01. It can indicate any of the following:-
Suspected Fraud
Insufficient Funds
Stolen Card
Expired Card
Invalid CVN
Any other rule imposed by the card issuer that causes a decline (e.g. daily limit
exceeded, duplicate transaction suspected, etc).
08 Honour with identification. This indicates that the transaction has been
authorised. What authorisation DOES mean:-
Page 44
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 45 - API Developer's Guide
PayWay
12 - Invalid Transaction
This code is often returned from the issuer when they do not accept the transaction. This
can possibly be when a transaction for the same amount and merchant is attempted
multiple times quickly for the same card. The best approach is for the card holder to
contact their issuing bank.
22 - Suspected Malfunction
Westpac returns this code if the card number does not pass the check digit algorithm.
This is considered a malfunction, since Westpac expect the terminal to check the card
number before transmission.
42 - No Universal Account
This error is returned from some issuers when the credit account does not exist at the
issuing bank. This situation is similar to the 14 response code - the card number passes
the check digit algorithm, but there is no credit account associated with the card
number.
54 Expired Card
This error is returned when the wrong expiry date has been entered for the credit card.
Check that the expiry date is correct and attempt the transaction again. If the
Page 45
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 46 - API Developer's Guide
PayWay
transaction still does not work, check with the card holder to see if they have a new card
with a new expiry date.
QA - Invalid Parameters
Invalid parameters passed to API, for example, missing credit card number or customer
number. The response text will contain more detail about which parameters are invalid.
QI - Transaction incomplete
This response code indicates that a request message was sent to the PayWay server but
no response was received within the timeout period. This could be caused by incorrect
proxy configuration, so you should verify that your proxy information is correct. This
could also be caused by a network connectivity issue between your server and the
PayWay server. See Appendix B for more information.
QK - Invalid Merchant
The merchant Id passed in the request is not recognised by PayWay. Check that you are
specifying either TEST or your 8-digit Westpac merchant Id in the customer.merchant
request parameter. You can check your 8-digit merchant Id by clicking the 'Merchants'
link on the PayWay website. If the correct Merchant Id does not appear, contact your
implementation manager.
Note: You must press the Go Live button in the PayWay website in order to enable live
transactions against your 8-digit Westpac merchant Id (see section 2.3.1). After you
have pressed the Go Live button, you may continue to use you TEST merchant to
develop and test your implementation. Transactions to your TEST merchant will not
appear on the cardholder statement or your bank account.
QT Invalid Currency
You must always pass "AUD" for the card.currency parameter.
The PayWay API only accepts transactions in Australian Dollars. However, you can
charge credit cards from outside Australia. You will receive funds in Australian Dollars.
Page 46
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 47 - API Developer's Guide
PayWay
The transaction will appear on the cardholder statement in their currency using an
exchange rate determined by the card scheme (Visa, Bankcard, American Express, etc).
QQ - Invalid Card
This error code indicates that the credit card details (card number, expiry date or CVN)
are invalid. This could be because the card number does not meet check digit validation,
an invalid expiry date was entered or an invalid CVN was entered.
If you receive a response code starting with Q that you do not understand, you should
contact Customer Care as per section 2.3.2.
Page 47
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.
- 48 - API Developer's Guide
PayWay
If you have followed the recommendations in section 3.4, your software should correctly
handle the QI response code using one of the following options:
1. Reversing the transaction via the API to ensure that the card holder is not debited
(see section 3.3.4), or
Your support staff can always determine the final status of the transaction using the
search pages in the PayWay web site at https://www.payway.com.au/6. Depending on
your business procedures, your support staff can either enter this status into your
system, or can void the transaction through the PayWay pages. If a transaction does
not appear on these pages, the transaction was not received or processed by the
PayWay server.
Network errors can be almost impossible to investigate after the fact, so it is vital that
you investigate while you are experiencing an issue. You should try these steps:
1. If you use a proxy, check that your proxy settings are correct, and check that
there are no other issues with your proxy server.
2. If you do not use a proxy server, login to your server and telnet to
www.payway.com.au on port 443. Record the results of this test for use by your
network administrator.
3. Contact your network administrator and ask him/her to investigate the issue.
The results of the telnet test can help him/her to begin the investigation.
4. If you still cannot locate the cause of the QI responses you should contact
PayWay support for assistance on 1300 727 111. Your network administrators
will need to be available to work through the problem with the PayWay network
administrators.
6
It may take a few minutes for the transaction to appear on the PayWay search pages.
Page 48
Copyright 2005, Westpac Banking Corporation, ABN 33 007 457 141. All rights reserved.