On this page you will be guided on how to integrate the ISW IPG to your website to handle payment processing.

Scope

On this page you will be guided on how to integrate the ISW IPG to your website to handle payment processing.

Flow Overview

When a customer is ready to pay the integrating merchant is expected to make HTTP POST request containing checkout information such as merchant id and amount to the IPG backend.
The IPG backend logs the information under a unique session id and redirects the customer to the IPG frontend where they can proceed to enter payment specific details like card or phone details and pay.
Once the payment has been made the IPG frontend redirects to the merchant’s site with the payment response appended to the url as a query parameter. In case the payment processing failed this response will contain the failure reason.
Steps #
Merchant website constructs payment/checkout information including such things as amount, order id, transaction ref, and redirect url.
When the customer proceeds to pay the merchant site should then make a POST request to https://{host}/ipg-backend/api/checkout (the IPG backend url).
The IPG backend then processes the POST requests and redirects to a frontend url with a unique session id for the payment where the customer can enter payment specific details such as card or mobile number.
Once the customer submits the payment details the frontend handles processing between it and the ISW or other payment provider APIs.
If successful the IPG frontend redirects to the merchant’s specified redirect url with the response appended as a query parameter called response.
In case a payment attempt fails the user gets the option to try again using the same or other payment option, only the last response gets forwarded to the merchant-provided redirect url.

Initiating a payment

A payment is initiated by POSTing to https://gatewaybackend-uat.quickteller.co.ke/ipg-backend/api/checkout or the equivalent live URL as shall be provided.
The POST request’s Content-Type header must be application/x-www-form-urlencoded

Sample request using cURL #

curl --location --request POST 'https://gatewaybackend-uat.quickteller.co.ke/ipg-backend/api/checkout' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'merchantCode=ISWKEN0001' \
--data-urlencode 'domain=ISWKE' \
--data-urlencode 'transactionReference=f5qva' \
--data-urlencode 'orderId=qu20iz' \
--data-urlencode 'expiryTime=2021-04-13T17:16:44.981Z' \
--data-urlencode 'currencyCode=KES' \
--data-urlencode 'amount=100' \
--data-urlencode 'narration=Test+from+new+gateway' \
--data-urlencode 'redirectUrl=https://uat.quickteller.co.ke/' \
--data-urlencode 'iconUrl=' \
--data-urlencode 'merchantName=' \
--data-urlencode 'providerIconUrl=' \
--data-urlencode 'cardTokensJson=[{"panLast4Digits":"1895","panFirst6Digits":"506183","token":"C48FA7D7F466914A3E4440DE458AABC1914B9500CC7780BEB4","expiry":"05/20"},{"panLast4Digits":"1111","panFirst6Digits":"411111","token":"3105E927EF17A245977CDA0ED62B257E4378592E8D7C7A5272-016153570198200","expiry":"02/22"}]' \
--data-urlencode 'reqId=' \
--data-urlencode 'field1=' \
--data-urlencode 'dateOfPayment=2016-09-05T10:20:26' \
--data-urlencode 'terminalId=3TLP0001' \
--data-urlencode 'terminalType=What?' \
--data-urlencode 'channel=WEB' \
--data-urlencode 'fee=0' \
--data-urlencode 'preauth=0' \
--data-urlencode 'customerId=1002' \
--data-urlencode 'customerFirstName=Japheth' \
--data-urlencode 'customerSecondName=Ongeri' \
--data-urlencode '[email protected]' \
--data-urlencode 'customerMobile=86-13012345678' \
--data-urlencode 'customerCity=NBI' \
--data-urlencode 'customerCountry=KE' \
--data-urlencode 'customerPostalCode=wstlnds' \
--data-urlencode 'customerStreet=1002' \
--data-urlencode 'customerState=NBI'

Complete POST parameters ref

The following table contains all the expected form fields that can be submitted when initiating a payment.

FieldRequiredDescription
transactionReferencetrueA unique identifier of the transaction on the merchant’s side – maximum 15 characters, duplicates will be rejected.
merchantCodetrueThe merchant id assigned by ISW
currencyCodetrueThe ISO currency code e.g. KES
amounttrueTransaction Amount – in minor denomination (cents)
dateOfPaymentfalseDate of the payment
orderIdtrueMerchant’s orderId for the payment item, similar to receipt number, duplicates allowed.
terminalIdfalseThe terminal id
terminalTypetrue
redirectUrltrueThe url of the merchant page to which IPG will redirect the user and pass the response once payment completes.
channelfalse
domaintrueThe domain the merchant is assigned to, provided by ISW – default ISWKE
narrationfalseDescription for the transaction
feefalseFee – default 0
preauthfalsePreauth – default 0
iconUrlfalseA web-accessible url of the merchant icon to be used in the IPG frontend. If none is given the ISW logo will be shown.
providerIconUrlfalse
cardTokensJsonfalseJSON string array containing one or more json objects representing saved card tokens, for example [{"panLast4Digits":"1111","panFirst6Digits":"411111","token":"DBA747BC30109711E8A1A2FDAFCD27A851B37DDA24F8BE2724","expiry":"04/20"}]
reqIdfalse
merchantNamefalse
field1false
customerIdtrueThe customer’s id from the merchant’s point of view e.g. email, phone, or database/registration id.
customerFirstNamefalseCustomer’s first name
customerSecondNamefalseCustomer’s second name
customerEmailfalseCustomer’s email
customerMobilefalseCustomer’s mobile
customerCityfalseCustomer’s city
customerCountryfalseCustomer’s country
customerPostalCodefalseCustomer’s postal code
customerStreetfalseCustomer’s street
customerStatefalseCustomer’s state
expiryTimefalse
displayPrivacyPolicyfalse
applyOfferfalseEnable or disable application of configured offers for a specific payment. False by default which means true has to be passed for an offer to be applied
primaryAccentColorfalseA hex code for colour to set the primary accent colour for links, titles, and buttons