Ola Money Developer Hub

Welcome to the Ola Money developer hub. You'll find comprehensive guides and documentation to help you start working with Ola Money as quickly as possible, as well as support if you get stuck.

Documentation

Understanding response from Olamoney

Understanding the response from Olamoney Api's

In this section we will describe the status of transactions.

On return url we post the data in x-www-form-urlencoded format. A sample data posted on return url looks as follows:

type:debit
status:success
transactionId:bgi9-ge3g-k3un
merchantBillId:S2ubY
amount:1.00
hash:08edb2bc9f42d6d006f45abd743a4586e76feb925adbffe70c6b92dee357a6e040414036d1e0042660aba3a2efce2465a0d37092d4459a2f093164881b101fd0
timestamp:1439996462606
comments:zTq6C
udf:mY1Wx
isCashbackAttempted:true (This will be returned only couponCode is passed)
isCashbackSuccessful:true (This will be returned only couponCode is passed)
Parameter Type
Description
Type
Present

type

Type of Transaction with respect to the user
Possible Values : debit

Note: The command name would be exactly the same as possible value without the change in the case of the string

String

Always

status

Status of the transaction initiated by you
Possible values: success,error,pending

String

Always

transactionId

user-friendly Ola Money transaction Id generated by Ola Money (unique in the Ola Money context)

String

Always

merchantBillId

unique Id for every transaction, generated by the you - this is the same as 'uniqueId' as in Bill Generator

String

Always

amount

Amount for which you charged the customer

Double

Always

hash

Ola Money uses SHA512 to sign the resonse in order to prevent tampering attempts.

String

Always

timestamp

Epoch timestamp of the transaction.

Unix Timestamp

Always

comments

Extra comments you had sent as a part of the bill. (not empty)

String

Always

udf

User defined fields that you sent as a part of the bill. (not empty)

String

Always

isCashbackAttempted

Response to the coupon code applied in the bill

Possible Values
1.true : If the coupon code parameter was sent in the bill
2.If you have not sent the coupon code parameter you wont recieve this is resonse

String

Optional

isCashbackSuccessful

Response whether the coupon code applies was successful or not

Possible Values
1.true : coupon code sent in the bill was applied successfully against the user.
2.false:coupon code sent in the bill was not applied successfully either because the coupon was not applicable on the user or the code is no longer valid or is a invalid coupon code.
3.If you have not sent the coupon code parameter you wont recieve this is resonse

String

Optional

Response Hash calculation

data_string =  'type|status|merchantBillId|transactionId|amount|comments|udf|isCashbackAttempted|isCashbackSuccessful|timestamp|salt';
merchant_hash = sha512(data_string);

Hash Matching - why is it so important?

The hash computed this way, has to match with the hash posted in JSON.
If there is a mismatch, following could be the reasons.

  • You are using a wrong/test access key or secret key
  • Data may have been tampered with

If you don't do a hash matching at your end, you are vulnerable to a potential hacking attempt.

What is notify url and how is it different from return url?

Return url is mainly used for user navigation in the browser. This navigation depends on user's internet connection. This means that if the user data connection drops, return url won't load. To ensure that every transaction status is conveyed to the merchant, we implement a server to server call with notify url. Note that notify url needs to be different from return url.

What do we post on notify url and what is the format?
We post on notify url as an application/json type: Here is what it looks like

{
"type":"debit",
"status":"success",
"transactionId":"bgi9-g8pf-v3jz",
"merchantBillId":"JLhq2ZxZX",
"amount":"50.00",
"hash":"60ee5feab583c6fddbb308cc8216201632af4811457f1bd6206da13ed128dedabab6f9b82b2992bc96b784d89463fd442825c79c8fc5d298118361bd85ec1213",
"timestamp":1439995769451,
"comments":"test",
"udf":"test"
"isCashbackAttempted":"true" (This will be returned only couponCode is passed)
"isCashbackSuccessful":"true" (This will be returned only couponCode is passed)
}

Understanding response from Olamoney