Zimswitch Vpayments-API-and-Developer-Documentation PDF
Zimswitch Vpayments-API-and-Developer-Documentation PDF
Document Control
Conventions
Font: Calibri
Font Size: 11
Office Template: Office
Bullets:
Critical Note
General Note
Warning Note
Revision Record
Date Edited By Comments Version
Issue Control
This document is issued by the ZimSwitch Shared Services RnD Manager, to whom any change
requests or queries should be directed.
Distribution
Copy No. Name Title Address
Public Release Vpayments API and
01 Master
Developer
Documentation
02
03
04
05
The master for this document is held electronically and only signed copies are valid. An unsigned, printed
document is not copy controlled and is to be used for INFORMATION ONLY, as it will not be automatically
updated. It is therefore the responsibility of the reader to ascertain that it is a currently valid copy.
1|Page
Copyright 2012
ZimSwitch Shared Services
Research and Development
Contents
Document Control ............................................................................................................................................................ 1
Conventions ................................................................................................................................................................... 1
Revision Record............................................................................................................................................................ 1
Issue Control .................................................................................................................................................................. 1
Distribution .................................................................................................................................................................... 1
Scope ...................................................................................................................................................................................... 4
Overview .............................................................................................................................................................................. 4
Vpayments Model ........................................................................................................................................................ 5
BuySafe ............................................................................................................................................................................ 5
Further disputes ...................................................................................................................................................... 6
Is it safe to use a non BuySafe merchant? ..................................................................................................... 6
Vpayments - BuySafe Model ............................................................................................................................... 7
API ...................................................................................................................................................................................... 8
HTTP API .................................................................................................................................................................... 8
Merchant Setup............................................................................................................................................................. 8
Test Mode ................................................................................................................................................................... 8
Migrating to Live ..................................................................................................................................................... 8
Process Flow .................................................................................................................................................................. 9
Initiate Transaction .................................................................................................................................................... 9
Initiate Transaction Fields .................................................................................................................................. 9
Successful Response Fields .............................................................................................................................. 10
Failed Response Fields ...................................................................................................................................... 11
Checking Transaction Status ................................................................................................................................ 11
Unprocessed Transactions.................................................................................................................................... 12
The Hash Variable .................................................................................................................................................... 13
Example Message with Hash ........................................................................................................................... 13
2|Page
Copyright 2012
ZimSwitch Shared Services
Research and Development
3|Page
Copyright 2012
ZimSwitch Shared Services
Research and Development
Scope
Who should read this?
The scope of this document is limited to the merchant integration to the Vpayments API.
Overview
Vpayments is an online payments system (eCommerce) provided by Zimswitch Shared Services to
allow card not present payments from the customers bank account directly to the merchants
bank account or into a bank controlled suspense account (BuySafe Option).
The Vpayments Gateway enables merchants to offer their customers the convenience of paying
directly from their bank account.
Customers will already have a Vpayments account that is linked to their bank accounts. The
experience to the customer is as follows:
Select goods and services available on the merchant site and add them to their virtual shopping
cart.
Click the merchant site Check Out button.
Choose a payment method:
Cash on delivery
RTGS
Transfer or Cash deposit
Vpayments
If Vpayments is selected, the customer will be re-directed from the merchant site to the
Vpayments site along with additional information as specified in this document. (amount,
merchant ID etc)
The customer will then be able to log in to Vpayments using their Vpayments username and
password and process the payment securely
Once payment is completed, the customer will be re-directed to the merchant site with the
appropriate payment status
For merchants who do not have access to the appropriate development resources, pre-built
Vpayments payment modules for popular shopping cart systems are available from our preferred
partner (sales@webdevworld.com) integration is available at discounted prices for C#, java and
PHP. Prices start from $90.
4|Page
Copyright 2012
ZimSwitch Shared Services
Research and Development
Vpayments Model
Items marked with *, do not have to occur and are in place as fail safes in the event of a
communications breakdown.
BuySafe
BuySafe is a technology intended to protect the customer. It is an extra layer of security to ensure
the customer gets their goods delivered on time and in good condition. Not all merchants are
BuySafe, on the payment page you will see a notice and logo indicating if the merchant is BuySafe or
not. If a merchant is BuySafe certified, funds paid by a customer will be held in a control account at
the merchants bank until the merchant has actually delivered the goods or services. Once the
merchant has updated the status of the order to delivered, the customer is notified and has at
5|Page
Copyright 2012
ZimSwitch Shared Services
Research and Development
least a 24 hour period to dispute the status. If no dispute is raised, the funds are moved from the
banks control account into the merchants bank account. This extra step is designed to give
customers peace of mind when they purchase goods or services that are not delivered or available
immediately after the time of purchase. BuySafe is an optional service and is not compulsory for any
merchant. The BuySafe process is as follows:
Further disputes
In the event the merchant is not BuySafe registered or the delivery dispute period has expired
and the merchant has received their money the customer can still dispute a transaction. But in
this case no funds are held in suspense, the merchant still has access to the funds, but the
customer, merchant and bank are notified and a manual resolution process is started.
6|Page
Copyright 2012
ZimSwitch Shared Services
Research and Development
7|Page
Copyright 2012
ZimSwitch Shared Services
Research and Development
Items marked with *, do not have to occur and are in place as fail safes in the event of a
communications breakdown.
API
Currently the only supported API Interface is the HTTP POST Protocol. As more supported API
Protocols are exposed by the Vpayments application they will be added to this document.
HTTP API
The HTTP API exposes URLs that will accept and announce updates with the HTTP POST
requests. All messages from the merchant and successful responses from Vpayments must
include a valid hash (This will be explained further).
Merchant Setup
Before a merchant can integrate with Vpayments they need to sign up for the service with the
connected Financial Institution. Once the Financial Institution has completed their setup the
merchant will be emailed with a URL to setup their first account. At this point the account will be in
Test Mode (sandbox).
Test Mode
Test Mode means that all integration is possible but no funds are transferred and every transaction
is automatically failed when the customer clicks make payment. Once the merchant is complete with
their integration they can request that their account is moved out of Test Mode and moved into
Live. At this point live transactions will be sent through and funds will move.
Migrating to Live
After first login the merchant will be able to retrieve their Merchant ID and Merchant Secret Key. It
is strongly recommended that the merchant regenerates this key when moving from Test Mode to
Live, and every annual quarter thereafter. The Merchant Secret Key serves as unique identifier for
verifying a response from the merchant. It is to be kept confidential at all times.
8|Page
Copyright 2012
ZimSwitch Shared Services
Research and Development
Process Flow
The payment process is multi step and requires interaction between the customers browser,
the merchant server and Vpayments. The following flow is for a complete transaction, if the user
closes their browser, there is a communications breakdown, cancels the payments
authorization, or the transaction fails at any point, the flow is incomplete.
Initiate Transaction
The first message sent from the merchant server to Vpayments is to create the transaction and
get the subsequent URLs use in processing.
https://secure.zss.co.zw/Vpayments/Interface/InitiateTransaction
confirmurl URL Encoded String The URL the Vpayments server can use to YES
announce transaction results to the
merchant site
returnurl URL Encoded String The URL on the merchant website the YES
client will be redirected to after
processing the transaction
reference URL Encoded String The merchant reference as you would YES
9|Page
Copyright 2012
ZimSwitch Shared Services
Research and Development
confirmurl=http%3a%2f%2fwww.mysite.me%2fconfirm&returnurl=http%3a%2f%2fwww.mysite.me
%2freturn&reference=12345&amount=10.00&storefrontid=1&additionalinfo=Some+other+info&sta
tus=Message&Hash=71FA7362C603E3265E8DAE315703BC64CF48874E3D736D63DFDBB9CA61533A
EF715266FAE84D9D116598A4113278F651E00B5D6D0A443DC2380FA3D13AA8A743
Vpayments will respond with a String formatted as if it were an HTTP POST i.e. an equals (=)
sign between fields and fields separated by an ampersand (&).
Status=Ok&ProcessUrl=https%3a%2f%2fsecure.zss.co.zw%2fVpayments%2fInterface%2fMake
Payment%2f%3fguid%3d4c538282-469e-4238-abc5-
47a0fdddbe87&CheckUrl=https%3a%2f%2fsecure.zss.co.zw%2fVpayments%2fInterface%2fCh
eckPayment%2f%3fguid%3d4c538282-469e-4238-
10 | P a g e
Copyright 2012
ZimSwitch Shared Services
Research and Development
abc547a0fdddbe87&Hash=8EC843AA03005AEFEB02E175E0EC818E6A1B2ACAADA97B613E2
0D643A14BAFFE30D58D3EC528AF9063CF63FAFF0F2AAB5E941B1FFEB7EB9E09E96045DFC
2C373
Status=Error&Error=Invalid+amount+field
Alternatively the merchant server can poll the check URL provided by Vpayments to check the
status of their transaction. While the merchant server can check a transaction status at any time,
this should only be at following times however
The user has been redirected back to the merchant site. Regardless of whether the
merchant server has been notified of a transaction status change or not it advisable to
poll for the latest transaction status to confirm it is valid.
Before any unpaid transaction is deleted from the merchant server. Before removing a
pending transaction from the merchant site it is vital you poll to confirm its status, it is
possible that the transaction has been paid but the update was never received by the
merchant server. If the transaction is still pending on Vpayments do not delete it from
the merchant server as it is possible it will still be processed in future.
When a user wants to manually verify a transaction from the merchant site.
To poll for the current transaction status the merchant server needs to make an empty HTTP
POST to check the URL provided by Vpayments in the initiation response message. Vpayments
will reply with a message in the same format as before. As example check URL might be
https://secure.zss.co.zw/Vpayments/Interface/CheckPayment/?guid=bf885024-3087-48ca-9cc9-
eef251faa741
11 | P a g e
Copyright 2012
ZimSwitch Shared Services
Research and Development
Whether Vpayments is replying to a poll or posting the results the merchant server, the message will
contain the following fields.
FIELD NAME FIELD TYPE FIELD DESCRIPTION MANDATORY
Reference=570&Amount=0.15&Status=Paid&ProcessDate=2012-08-
21+14%3a53%3a05Z&BankReference=000233-
00000001&CheckUrl=https%3a%2f%2fsecure.zss.co.zw%2fVpayments%2fInterface%2fCheckPaymen
t%2f%3fguid%3dbf885024-3087-48ca-9cc9-
eef251faa741&Hash=673932DCDA36547E3D8C4BD6749E81EDE8B79F0E4C95442545F6A01F999599
1EDAF4655CD6AE63D698AE2DCADA26CB98C64FB4B9FE8A61E4E5753C4751D2EEE7
An invalid check URL GUID will reply with an error message as explained above
Unprocessed Transactions
In the event a transaction has not been complete by the customer Vpayments will cancel any
transaction from that day at midnight that night and announce the failure to the merchant server.
If by the next morning the merchant server still has transaction from the previous day with a
pending status the merchant must poll Vpayments for the transaction status as network issue have
12 | P a g e
Copyright 2012
ZimSwitch Shared Services
Research and Development
probably resulted in a failure to update the merchant server overnight? It is also possible some of
these transactions may have been successful but neither Vpayments nor the customer could get
back to the site to confirm. As such a merchant should not automatically cancel old payments but
keep them open until they have been able to poll for a status update.
It is important that a merchant knows the status of pending transactions, as network problem could have
interfered with status updates. As such it is mandated that a transaction can only be processed on the same
that it is created. This means the merchant site can confirm the status of any old payments and perform house
keeping the side the next day.
First, too ensure data integrity; if the value of any of the fields in the message is changed
then the hash will be invalid.
Second, is to validate the source integrity, As the hash also include the Merchant Secret
Key, it is possible for the merchant and Vpayments to confirm each others identity as
they are the only ones that know the secret key.
Concatenate all the message values (but not the field names), before URL encoding and
in the same order as they appear in the message.
Append the Merchant Secret Key.
UTF8 encode to generate byte array. (If applicable to your development language)
SHA512 Hash
Output byte array in Uppercase Hexadecimal
Add back to the message as the Hash variable.
Under the merchant login on Vpayments there is a test centre which the developer can use to
enter dummy data and generate the appropriate hash to check their implementation.
13 | P a g e
Copyright 2012
ZimSwitch Shared Services
Research and Development
confirmurl=http%3A%2F%2F10.91.20.174%3A9000%2FApplication%2FconfirmReturn&returnurl=http%3A%2F
%2F10.91.20.174%3A9000%2FApplication%2FpaymentReturn&reference=From+PlayFramework&amount=10.0&
storefrontid=2&additionalinfo=Hopefully+this+works&status=MesSagE&hash=0463A23BED35B4E9155EC3A
5DEFCDB7F3E214CC2D05057B89099086DC6F69197768461404676D0414791995DD2DFE16870F69ACEB99B9BDBDA91C
831A71B656E
HTTP/1.1 200 OK
Date: Thu, 08 Dec 2011 09:18:54 GMT
X-AspNet-Version: 4.0.30319
X-AspNetMvc-Version: 3.0
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 400
Connection: Close
Status=Ok&ProcessUrl=https%3a%2f%2fsecure.zss.co.zw%2fVpayments%2fInterface%2fMakePayment%2f%3
fguid%3de8c86898-3f9a-4d2b-9608-f31663d5119d&CheckUrl=https%3a%2f%2fsecure.zss.co.zw%2fVpaymen
ts%2fInterface%2fCheckPayment%2f%3fguid%3de8c86898-3f9a-4d2b-9608-f31663d5119d&Hash=F8363F8F2B
49B4B3E870433C5357A15DDC02C510BB5C9D462BCF178D2861E410A06050C7DA0BEEE08AAC3C23574783695EBE304D
EB236C45026F63B53FF3CBAB
14 | P a g e
Copyright 2012
ZimSwitch Shared Services
Research and Development
On behalf of ZimSwitch Shared Services, we hope you found this document informative.
15 | P a g e
Copyright 2012