Next: Making a payment

This is unique and proprietary feature enables you to provide a single click experience without requiring the customer to enter their mobile number.
It works for customers accessing via carrier partner networks only.

On successful discovery, iPayy will generate an IPayyUserToken for msisdn, operator pair.  IPayy will push this token to the callback URL the merchant has provided in the detection request or merchants can also get it by using ismsisdndetected API.

What is an IPayyUserToken?

IPayyUserToken is a hashed value of msisdn and operator nameA valid token can be used by the merchants to hit consent APIs without doing a mobile number detection each time. IPayyUserToken becomes invalid when the end user has opted out of the operator on which the merchant has to do mobile number detection again and get a valid IPayyUserToken

 

JavaScript Based Detection Technique

iPayy will provide a detection URL and the merchant will load this URL using the <script> tag while loading the payment page  to identify the mobile number and operator ,where parameter encrypted string is formed using map for the parameter key-values and iPayy Encryption Library.

To access this API you need to pass required parameters along with merchant-key and application-key(provided by iPayy)

URL: http://discovery.ipayy.com/discovery-service/c/dc/getjs?gh=<encrypted String>

Example:

How it works ?

You have to send merchant key, application key,  request token id , a callback function name and an optional call back url as parameters.

These parameters need to form an encrypted string using iPayy Encryption Library

You need to add a script tag in your payment check-out page with the “src” parameter pointing to the iPayy URL and the “gh” parameter set to the encrypted string generated in the previous step.

When the check-out page is loaded in the end-user browser iPayy system identifies the end-user and in response it sends a javascript code which invokes the callback function specified in the parameter.

Request Parameter Description :

Request ParametersDescription
mMerchant Key as provided by iPayy System
aApplication Key as provided by iPayy System
cfName of the call back function to be called after discovery
rRequest token id to uniquely identify each transaction
ruCall back URL of the merchant to which iPayy will push the IPayyUserToken

On successful discovery , the javascript code received from iPayy shall invoke  the callback function specified with a boolean value: true along with other parameters like operator name, end-user unique Id and IPayyUserToken.
If either msisdn or operator cannot be detected, then the function would be invoked with a boolean value: false. 

Sample Code :

Image Based Detection Technique

 

iPayy will provide a detection URL and the merchant will load this URL using the <img> tag while loading the  payment page  to identify the mobile number and operator ,where parameter encrypted string is formed using map for the parameter key-values and iPayy Encryption Library.

To access this API you need to pass required parameters along with either merchant-key and application-key(provided by iPayy)

URL : http://discovery.ipayy.com/discovery-service/c/dc/getimage?gh=<encrypted String>

iPayy System will send a pixel image file as response.
The merchant would send merchant key, application key, request token id and an optional callback url as url parameters. iPayy system would detect the mobile number and the operator.

Example

Request Parameter Description :

Request ParametersDescription
mMerchant Key as provided by iPayy System
aApplication Key as provided by iPayy System
cfName of the call back function to be called after discovery
rRequest token id to uniquely identify each transaction
ruCall back URL of the merchant to which iPayy will push the IPayyUserToken

Sample Code

Check Discovery API:

The merchant can use the iPayy API to check if Mobile Number and Operator has been discovered  successfully and get operator, msisdn, customer code and IpayyUserToken.

URL:  https://discovery.ipayy.com/discovery-service/c/dc/ismsisdndetected 

Parameter: requestTokenId

Request Type: POST

Header: Authorization

Header Value Format:

 ‘Basic <Base 64 Encoded value <Merchant Key: Application Key>>

E.g. If merchant key is ‘hac42JpvdXT9Jb9bVzKuzR’ and application key is ‘7ADYdcB3xGxw3psxqKx57m’ then the header value is going to  be: ‘Basic aGFjNDJKcHZkWFQ5SmI5YlZ6S3V6Ujo3QURZZGNCM3hHeHczcHN4cUt4NTdt’

Steps to arrive at this value (using merchant-key (hac42JpvdXT9Jb9bVzKuzR) and application-key (7ADYdcB3xGxw3psxqKx57m):

  1. Concatenate merchant-key followed by application-key separated by a colon delimiter‘:’.
    Result: hac42JpvdXT9Jb9bVzKuzR:7ADYdcB3xGxw3psxqKx57m.
  2. The value above needs to be encoded in Base-64 format.
    Result: aGFjNDJKcHZkWFQ5SmI5YlZ6S3V6Ujo3QURZZGNCM3hHeHczcHN4cUt4NTdt
  3. Concatenate the string ‘Basic’ with the Base-64 value generated in step 2 separated by a space.
    Result: ‘Basic aGFjNDJKcHZkWFQ5SmI5YlZ6S3V6Ujo3QURZZGNCM3hHeHczcHN4cUt4NTdt’
  4. Set the resultant string generated in step 3 as the value for the Header with name: ‘Authorization’

Request

Sample POST Request:

Response

Response XML Structure: 

Success:

<check-discovery-response>
<request-token-id></request-token-id>
<ipayy-user-token></ipayy-user-token>
<status></status>
<customer-code></customer-code>
<msisdn></msisdn>
<operator-name></operator-name>
</check-discovery-response>

Failure:

<check-discovery-response>
<request-token-id></request-token-id>
<status></status>
</check-discovery-response>

Sample XML Response:

XML TagDescription
request-token-idTransaction request id.
The request id is unique for a given merchant and application. The request id should not be repeated for a given merchant and application.(should be unique and between 8-40 character)
statusDescribes the result of the discovery-
success - Mobile Number and operator name was discovered successfully.
failed - Mobile number and operator name was not discovered.
ipayy-user-tokenUnique token for the msisdn-operator. This token can be further used for Payment requests
msisdnNumber of the subscriber
operator-nameName of the operator to which subscriber's number belongs to
customer-codeHashed value of msisdn

 

Next: Making a payment