Bill Desk Payment Gateway Integration Approach

Shantanupatel
Posted by in ASP.NET category on for Intermediate level | Points: 250 | Views : 52501 red flag
Rating: 4.25 out of 5  
 4 vote(s)

This post is just a guide/approach for the bill desk payment gateway integration.

Introduction

The approach between the merchant (i.e. User/Service Provider) website and BillDesk is described below:

BillDesk Payment Gateway Integration Approach


Payment Request 

The merchant constructs a string separated by [‘|’] pipe with some important input data. Let’s take an example of shopping cart with following input:

  • Order Number
  • Transaction Amount
  • Product Number
  • Product Type
  • Comments
  • Return Response URL

Message Details Format

MerchantID|CustomerID|NA|TransactionAmount|NA|NA|NA|CurrencyType|NA|TypeField1|SecurityID|NA|NA|
TypeField2|AdditionalInfo1|AdditionalInfo2|NA|NA|NA|NA|NA|R’URL

Sample message with checksum value generation details

MYSITE|ALPHA5689|NA|5656.00|NA|NA|NA|INR|NA|R|abcd|NA|NA|F|NB|NB|NA|NA|NA|NA|NA|https://MySite.Com

Note: The data is to be generated and arranged in a single line.

The checksum is an important part while some one receives the message from BillDesk.

Once the User (site owner) gets the response from BillDesk, a new checksum is generated at the user site to verify the received one. Any differences in the checksum indicate that the messages has been modified or received erroneously.

BillDesk provides a checksum component to the user (site owner) to generate the checksum.

The Checksum component will require a message string and common string, i.e. password shared by bill desk to generate checksum.

Let’s assume that the checksum is 5598765478

Sample transaction Message to be sent to Bill Desk URL as parameter ‘msg’ through “POST” mechanism

MYSITE|ALPHA5689|NA|5656.00|NA|NA|NA|INR|NA|R|abcd|NA|NA|F|NB|NB|NA|NA|NA|
NA|NA|https://MySite.Com|5598765478

Payment Response

The payment response is sent to the Return URL which was specified dynamically by Merchant for each transaction.

This response is a browser response and the message will be posted to the Merchant’s Return URL as a parameter – msg

Sample Response Message Details:

MerchantID|CustomerID|TxnReferenceNo|BankReferenceNo|TxnAmount|BankID|BankMerch antID|TxnType|CurrencyName|ItemCode|SecurityType|SecurityID|SecurityPassword|TxnDa te|AuthStatus|SettlementType|AdditionalInfo1|AdditionalInfo2|AdditionalInfo3|AdditionalInf o4|AdditionalInfo5|AdditionalInfo6|AdditionalInfo7|ErrorStatus|ErrorDescription|CheckSum

Sample Response Message from Bill Desk:

MYSITE|ALPHA5689|TRNI0412001668|NA|00005656.00|CIT|33388907|NA|INR|DIRECT|NA|NA|NA|1 -12-2011 17:08:16|0300|NA|NB|NB|NA|NA|NA|NA|NA|NA|NA|5598765478

AuthStatus - Status Reason - Proposed Transaction Status

0300 - Success - Successful Transaction

0399 - Invalid Authentication at Bank - Cancel Transaction

NA - Invalid Input in the Request Message - Cancel Transaction

0002 - Billdesk is waiting for Response from Bank - Cancel Transaction

0001 - Error at Billdesk - Cancel Transaction

APPROACH:

 1.    You can store some of the key information in the config file 

<add key="MerchantId" value=" MYSITE "/>

<add key="CurrencyType" value="INR"/>

<add key="TypeField1" value="R"/>

<add key="SecurityId" value="mysite"/>

<add key="TypeField2" value="F"/>

<add key="AdditionlaInfo1" value="NA"/>

<add key="AdditionlaInfo2" value="NA"/>

<add key="ReturnUrl" value="http://www.mysite.com/ReturnFromBillDesk.aspx"/>

<add key="BillDeskUrl" value="https://www.billdesk.com/pgidsk/PaymentEntry.jsp"/>

<add key="CheckSumKey" value="9FGcERMK1GfF"/>

 

2.    Read all the config value and create the message string. Generate the checksum key and pass the same along with message string created earlier through post method to bill desk URL.

3.    Receive the information from bill desk through response and extract the required information. Store and display as per your requirement.


Conclusion

I hope this helps! 

Page copy protected against web site content infringement by Copyscape

About the Author

Shantanupatel
Full Name: Shantanu Patel
Member Level:
Member Status: Member
Member Since: 2/19/2010 8:01:15 AM
Country: India
Shantanu
http://www.dotnetfunda.com

Login to vote for this post.

Comments or Responses

Posted by: Lokesh76 on: 5/2/2011 | Points: 25
This will really helpful for high level understanding to Intergrate with Billdesk.

Login to post response

Comment using Facebook(Author doesn't get notification)