Version 1.2.0 (updated)
- Visual Studio 2012 or above.
- MOLPay Development or Production ID.
- MOLPay General API.
- Download
MOLPay.dlllibrary inside MOLPayCS.zip file - Open Visual Studio project, right click on your project name in
Solution Explorerand chooseAdd Reference. - Click
Browseto search for downloaded library. ClickOKto add.
Add using MolPayCS;
Create MOLPayCS object in order to access the properties of Base:
MolPayCS.MOLPay object = new MolPayCS.MOLPay();Set the values to Post data for MOLPay's payment request
object.Verifykey = "xxxxxxx"; //Replace xxxxxxxxxx with your MOLPay Verify Key
object._Domain = "XXXXXXX"; //Replace XXXXXX with your MOLPay Merchant ID
object._Amount = "100.00"; //2 decimal points numeric value
object._Orderid = "Testing321"; //alphanumeric, 32 characters
object.Bill_name = "MOLPay Test";
object.Bill_email = "example@gmail.com";
object.Bill_desc = "This is used for initiation of payment request";
object._Currency = "MYR"; //2 or 3 chars (ISO-4217) currency code
object.Country = "MY"; //2 chars of ISO-3166 country code
object.Returnurl = "http://exampleurl"; //Desired returned page after payment page
// All 3 type of url is already combine in this returnurlSet which type of environment with either Sandbox or Production
object._Type = "sandbox" // "sandbox" or "production"Use object.Pay(); to trigger POST data function
Add using MolPayCS;
Create MOLPayCS object in order to access the properties of Base:
MolPayCS.MOLPay object = new MolPayCS.MOLPay();Set the values received from MOLPay's payment response
object.Vkey = "xxxxxxx" //Replace xxxxxxxxxx with your MOLPay Secret_Key
object.TranID = String.Format("{0}", Request.Form["tranID"]);
object.Orderid = String.Format("{0}", Request.Form["orderid"]);
object.Status = String.Format("{0}", Request.Form["status"]);
object.DomainID = String.Format("{0}", Request.Form["domain"]);
object.Amount = String.Format("{0}", Request.Form["amount"]);
object.Currency= String.Format("{0}", Request.Form["currency"]);
object.Paydate = String.Format("{0}", Request.Form["paydate"]);
object.Appcode = String.Format("{0}", Request.Form["appcode"]);
object.Skey = String.Format("{0}", Request.Form["skey"]);Set which type of enviroment with either Sandbox or Production
object.Type = "sandbox" // "sandbox" or "production"Additional object must be set when using IPN
object.Treq = "1" //Value is always 1. Do not changeCall the IPN function
object.IPN()Set additional object for Notification URL
object.Nbcb = String.Format("{0}", Request.Form["nbcb"]); E.G return & notification & callback URL (all 3 url are using this structure)
//invalid transaction if the key is different. Merchant might issue a requery to MOLPay to double check payment status with MOLPay.
if (object.Skey != object.Key1checked())
object.Status = "-1";
If status == "00" then
/*** NOTE : this is a user-defined function which should be prepared by merchant ***/
// action to change cart status or to accept order
// you can also do further checking on the paydate as well
// write your script here .....
Else
// failure action. Write your script here .....
// Merchant might send query to MOLPay using Merchant requery
// to double check payment status for that particular order.
}We have 5 type of requery method. On first, same we create MOLPayCS object in order to access the properties of Base:
MolPayCS.MOLPay obj = new MolPayCS.MOLPay();Set the values to requery
obj.Amount = "100.00"; // 2 decimal points numeric value
obj.TxID = "xxxxxxxx"; // Replace xxxxxxxxx with Merchant transaction ID , which might be duplicated.
obj.Domain = "XXXXXXXX"; // Replace XXXXXXX with your MOLPay Merchant ID
obj.Verifykey = "zzzzzzzz"; // Replace zzzzzzz with your verify key
obj.Url = "http://exampleurl"; // Desired page to get requery data
obj.Type = "0"; // 0 = plain text result (default), 1 = result via POST method
obj.TypeID = "sandbox"; // Set which type of environment with either **sandbox** or **production**Use RequeryTransactionID() fucntion to trigger
obj.RequeryTransactionID();Example response with type=0 (default output, plain text with linebreaks)
/*
StatCode=00
StatName=captured
TranID=65234
Amount=3899.00
Domain=shopA
Channel=fpx
VrfKey=xxxxxxxxxxxxxxxxx
*/Example response with type=1 (POST result sent to URL)
/*
$_POST [StatCode] => “00”;
$_POST [StatName] => “captured”;
$_POST [TranID] => “65234”;
$_POST [Amount] => “3899.00”;
$_POST [Domain] => “shopA”;
$_POST[Channel] => “fpx”;
$_POST[VrfKey:]=> “456cf69e5bddfe8ed47371096”;
*/Set the values to requery
obj.Amount = "100.00"; // 2 decimal points numeric value
obj.OID = "xxxxxxxx"; // Replace xxxxxxxxx with the Order id that you want to check
obj.Domain = "XXXXXXXX"; // Replace XXXXXXX with your MOLPay Merchant ID
obj.Verifykey = "zzzzzzzz"; // Replace zzzzzzz with your verify key
obj.Url = "http://exampleurl"; // Desired page to get requery data
obj.Type = "0"; // 0 = plain text result (default), 1 = result via POST method
obj.Req4token = "1"; // 0 = No (default), 1 = Yes for more card related information
obj.TypeID = "sandbox"; // Set which type of environment with either **sandbox** or **production**Use equeryOrderIDSingle() fucntion to trigger
obj.RequeryOrderIDSingle();Set the values to requery
obj.OID = "xxxxxxxx"; // Replace xxxxxxxxx with the Order id that you want to check
obj.Domain = "XXXXXXXX"; // Replace XXXXXXX with your MOLPay Merchant ID
obj.Verifykey = "zzzzzzzz"; // Replace zzzzzzz with your verify key
obj.Url = "http://exampleurl"; // Desired page to get requery data
obj.Type = "0"; // 0 = plain text result (default), 1 = result via POST method
obj.Format = "0"; // 0 = result string with delimiter ( | ), 1 = result in array
obj.Req4token = "1"; // 0 = No (default), 1 = Yes for more card related information
obj.TypeID = "sandbox"; // Set which type of environment with either **sandbox** or **production**Use RequeryOrderIDBatch() fucntion to trigger
obj.RequeryOrderIDBatch();Set the values to requery
obj.OIDs = "xx|yy|zz"; // ex) xx & yy & zz are the order id you want to check (separate with "|")
obj.Delimiter = "|"; /* Single character, default is "|". Avoid using any symbol that might exist in order ID,
and also any of these: “,%, *, <, >, ? , \, $, &, = */
obj.Domain = "XXXXXXXX"; // Replace XXXXXXX with your MOLPay Merchant ID
obj.Verifykey = "zzzzzzzz"; // Replace zzzzzzz with your verify key
obj.Url = "http://exampleurl"; // Desired page to get requery data
obj.Type = "0"; // 0 = plain text result (default), 1 = result via POST method
obj.Format = "0"; // 0 = result string with delimiter ( | ), 1 = result in array
obj.Req4token = "1"; // 0 = No (default), 1 = Yes for more card related information
obj.TypeID = "sandbox"; // Set which type of environment with either **sandbox** or **production**Use RequeryMultiOrderID() fucntion to trigger
obj.RequeryMultiOrderID();Set the values to requery
obj.TIDs = "xx|yy|zz"; // ex) xx & yy & zz are the transaction id you want to check (separate with "|")
obj.Domain = "XXXXXXXX"; // Replace XXXXXXX with your MOLPay Merchant ID
obj.Verifykey = "zzzzzzzz"; // Replace zzzzzzz with your verify key
obj.Url = "http://exampleurl"; // Desired page to get requery data
obj.Type = "0"; // 0 = plain text result (default), 1 = result via POST method
obj.Format = "0"; // 0 = result string with delimiter ( | ), 1 = result in array
obj.Req4token = "1"; // 0 = No (default), 1 = Yes for more card related information
obj.TypeID = "sandbox"; // Set which type of environment with either **sandbox** or **production**Use RequeryMultiTransactionID(); fucntion to trigger
obj.RequeryMultiTransactionID();Add using MolPayCS;
Create MOLPayCS object in order to access the properties of Base:
MolPayCS.Seamlesspayment obj = new MolPayCS.Seamlesspayment();Set the values for seamless integration
MolPayCS.Seamlesspayment obj = new MolPayCS.Seamlesspayment();
obj.Merchantid = "xxx"; //Replace xxx with your merchant id
obj.Vkey = "yyy"; //Replace yyy with your verify key
obj.ReturnUrl = "zzz"; //Replace zzz with your return url
obj.ProcessRequest(); // used to trigger seamless integration-
Open the visual studio solution inside SeamlessIntergration.zip file
-
Set which type of environment with either Sandbox or Production in the User_Interface.aspx
-
Set the
<form action =""to the link you used to Set the value for seamless integration on above -
Debug User_Interface.aspx
Latest MOLPay Seamless Integration
Merchant Technical Support / Customer Care : support@molpay.com
Marketing Campaign : marketing@molpay.com
Channel/Partner Enquiry : channel@molpay.com
Media Contact : media@molpay.com
R&D and Tech-related Suggestion : technical@molpay.com
Abuse Reporting : abuse@molpay.com
Any amendment by your end is at your own risk.
- 2018-04-18 - v1.0.0 - Initial Release
- 2018-04-24 - v1.1.0 - Add 5 requery method
- 2018-04-26 - v1.2.0 - Add seamless integration, add a UI file inside zip to test seamless integration