Open VISA API Uganda

Open VISA API Uganda

Open VISA API – EasyPay provides an easy Restful API that makes the process of integrating card payments  within your website or system a breeze. Start collecting money instantly for your products or services.

The card payments API works for all major cards ie VISA, Mastercard, Discover etc.

Requirements for Open VISA API

  1. Easypay account; First things first, you need to register for an easypay account. registration is free and painless. Register for an easypay account. Once you have registered and signed in, you will have to enable your API from within the app, so as you can get your credentials in real time.  The process is explained in detail below.
  2. The API is very simple and live so there is no sandbox environment. This helps you get integrated in a matter of minutes,test and get the feel of the API. The Gotcha.  By default all accounts are limited to transactions worth 10USD/month for the purpose of testing. To remove this limitation, you will have to contact us with your company details (KYC) and fill in the API application form we provide.

Enable VISA API within Easypay Wallet Uganda

 

Enable Mobile Money API for Airtel and MTN Uganda 1. Go to https://www.easypay.co.ug/app/ or download app and create an account.

2. Sign in and tap the API button shown on the home screen as shown in the image to the left.

3. The enable API screen will load up and offer you a green button to enable API. Tap this button and we proceed to creating and enabling API services for your account.

 

Open Mobile Money API

Step 1 – Fill in your Information

  • Name – This can be your brand or company name.
  • Description – Please describe why you need the API and what you will be using it for.
  • website – The URL to your website
  • IPN URL – Whenever a transaction is confirmed, this is the url that will be posted to with transaction details. IPN – stands for Instant Payment Notification. You will have to provide us a callback (ipn) url to notify your system when payments are made.
  • PIN – Please enter your easypay PIN to confirm enabling your API.

Using instant payment notification model, all your transactions should be marked as pending and only be marked as confirmed from this notification. It is also known as the callback url.

After you click save, your API will be enabled and live. You will be given a client Key and client Password that you will need for authenticating the API functions below.

 

 

Easypay will provide you with the following credentials to make the process quicker;

  1. URL – This is the url you will call to access the API. It is also known as the api entry point or end-point. https://www.easypay.co.ug/api/

Anatomy of Request

The API expects a POST request with a JSON encoded string of request. Every call to the API must have at least the format below. Some methods require extra fields depending on the call.

Payload

{
"username": "your_clientId",
"password": "your_secret",
"action": "do_something",
"paramater":"value"
}

username

This is the API clientId that you are given within app after you enable API. see above

password

This is the API secret that you are given within app after you enable API. see above

action

This is the API method being called.

parameter

This is any extra parameter that the action reguires.

Anatomy of Response

A success response comes in the following JSON format . You have to test the success field to either 1 for success or 0 for failed.

Successful Response

{
"success": 1,
"data": object
}

success This is an integer describing response. 1 for success, 0 for failed transaction
data This is a json object. It can be an array or boolean or integer depending on the request.

Failed Response

{
"success": 0,
"errormsg": "error message here describing failure"
}

VISA API methods

This API contains one methods that facilitate collecting of money using the different assortments of accepted cards like VISA, master card or discover.

VISA API Flow

The VISA process flow involves you asking the user for their card details, billing address etc. It is important to note that easypay does not store credit card details on its servers, we simply relay this information to VISA.

When successful, VISA supplies a link to attached bank for confirmation either using OTP (code in sms) or email confirmation. Once successful we shall call back your website or IPN url with valid post fields about the transaction.

VISA Charges

These charges vary depending on card. But the ceiling is around 4.5% of the transaction amount.

VISA API action

 

cardpayment

This method is called when a user wants to move funds from his VISA account into easypay. VISA mastercard or discover cards.

POST URL: https://www.easypay.co.ug/api/

Payload
{
"username": "your client Id",
"password": "your secret",
"action":"cardpayment",
"amount":"amount in usd",
"currency":"USD",
"name":"name on card",
"cardno":"card number",
"cvv":"security code back of card",
"month":"expiry month eg 01 for jan",
"year":"year of expiry",
"email":"card holders email",
"address":"billing address",
"city":"billing city",
"state":"state",
"zip":"zip code",
"country":"billing country",
"phone":"phone number",
"reference":"your order reference",
"reason":"Reason eg book payment"}
  • action – The action for all card payments is ‘cardpayment’. Leave this as-is ie cardpayment
  • amount – Amount to pay in USD.
  • currency – The currency leave as USD.
  • name – the name of the card holder as printed on card
  • cardno – This is the number on the cardholders card. E.g. 5399 6701 2349 0229.
  • cvv – This is the 3-digit number at the back of the card.
  • month – This is the month of card expiration as written on a cardholder’s card. Format is ‘MM’.
  • year – This is the year of card expiration on as written on a cardholder’s card. Format is ‘YY’.
  • email –This is the email address of the customer.
  • address – card holders address or billing address
  • city – card holders city
  • state – card holders state
  • zip – card holders zip code.
  • country – card holders country.
  • phone – card holders phone number.
  • reference – Your order Id, This will be returned in the instant payment notification to your ipn url. It is an integer number.
  • reason – This could be the description of the transaction.

Success Result

{
"success":1,
"data": Object holding transaction receipts
}

Failure Result

{“success”:0,”errormsg”:”Transaction timed out”}

Understanding a Successful “cardpayment” Response

{
 "success":1,
 "data": {
		  "otpInfo":{
                            "authurl":"https://..."
                            },
		  "requiresOTP":0,
		  "requiresPIN":0,
		  "suggestedAUTH":""
	}
}

If you are having an international VISA card that requires no authentication, you receive a result in the JSON format above. It is important to note that all transactions should have a pending status. The best way to truly know a transaction was completed is by using the Instant Payment Notifications as described below.

requiresOTP

if a value other than 0 is returned, you will need to redirect the user to a authurl provided within the otpInfo object. The easiest way would be through an IFRAME. When requiresOTP is 1, user is redirected to bank portal where he will have to confirm payment using either OTP (one time password) sent through his phone or through email.

requiresPIN

if requiresPIN is 1, you will have to re-post the payload above with PIN and suggestedAUTH.
{
"username": "your client Id",
"password": "your secret",
"action":"cardpayment",
"auth":"suggestedAUTH above",
"pin":"card pin",
"amount":"amount in usd',
"currency":"USD",
"name":"name on card",
"cardno":"card number",
"cvv":"security code back of card",
"month":"expiry month eg 01 for jan",
"year":"year of expiry",
"email":"card holders email",
"address":"billing address",
"city":"billing city",
"state":"state",
"zip":"zip code",
"country":"billing country",
"phone":"phone number",
"reference":"your order reference",
"reason":"Reason eg book payment"}

 

Instant Payment Notification

When a VISA payment has been successfully completed, we notify your system using the IPN url you supplied to us when enabling the API. we POST raw JSON data to you.

The important values to note here are;

reference – This is essentially your order id, you can now change its status to successful to match your system.

transactionId – This is the easypay payment ID. save it to your order id in the database for cross reference.

 

{
"phone": "phonenumber",
"reference": "your order id",
"transactionId": "Easypay Transaction ID",
"amount": "amount",
"reason":"your reason or narrative",
"PaymentType":"card"
}

Was this article helpful?

Related Articles