Repository navigation
Installation Guidance
- Download and unzip
MOLPay.dlllibrary file 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.
- Payment Page Integration
- Payment Endpoint Integration
- IPN (Instant Payment Notification)
- Requery
- Seamless Integration
- FAQ
Add using MolPayCS;
Create MOLPayCS object in order to access the properties of Base:
MolPayCS.Payment object = new MolPayCS.Payment();Set the values to Post data for MOLPay's payment request
object.Vkey = "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.TypeID = "sandbox" // "sandbox" or "production"If want to set channel for normal integration, add channel values and ask our Technical Support to close the payment options
object.Channel = "CIMBCLICKS"; //channel parameter can refer our API SPECIFICATION FOR MOLPAY INTEGRATION.pdfUse object.Pay(); to trigger POST data function
Add using MolPayCS;
Create MOLPayCS object in order to access the properties of Base:
MolPayCS.Payment object = new MolPayCS.Payment();Set the values received from MOLPay's payment response
object.SecretKey = "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.Domain = 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.TypeID = "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
Response.Write(obj.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.Payment obj = new MolPayCS.Payment();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.Vkey = "zzzzzzzz"; // Replace zzzzzzz with your verify key
obj.Url = "http://exampleurl"; // The URL to receive POST response from MOLPay
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 function 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.Vkey = "zzzzzzzz"; // Replace zzzzzzz with your verify key
obj.Url = "http://exampleurl"; // The URL to receive POST response from MOLPay
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 function 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.Vkey = "zzzzzzzz"; // Replace zzzzzzz with your verify key
obj.Url = "http://exampleurl"; // The URL to receive POST response from MOLPay
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 function 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.Vkey = "zzzzzzzz"; // Replace zzzzzzz with your verify key
obj.Url = "http://exampleurl"; // The URL to receive POST response from MOLPay
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 function 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.Vkey = "zzzzzzzz"; // Replace zzzzzzz with your verify key
obj.Url = "http://exampleurl"; // The URL to receive POST response from MOLPay
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 function 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 Merchant login username provided by MOLPay
obj.Vkey = "xxx"; //Replace xxx with your verify key
obj.Orderid = "xxx"; //Replace xxx with Bill / Invoice no. provided by merchant
obj.Country = "MY"; //Buyer country
obj.ReturnUrl = "xxx"; //Replace xxx with your return URL
obj.CancelUrl = "xxx"; //Replace xxx with URL to redirect when the payment is time out. Mandatory when timer is enable.
obj.Failureurl = "xxx"; //Replce xxx with URL to redirect when transcation fail
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
- Add
<input type="hidden" name ="molpaytimer" value="3" />in form (Value in minutes. Set 0 to disable this feature) - Add
<div id="counter"></div>outside form
Latest RazerMS Seamless Integration
1. Exception of type 'System.IO.FileLoadException' occurred
- Simply right-click the "References" folder and select "Manage NuGet Packages...".
- Select the Browse tab.
- In the search bar in the upper left type "Newtonsoft.Jason".
- Click "Install" and you're done.
OR
-
Remove Newtonsoft.Jason on reference.
-
If payment keep loading wont proceed
If you are using c# webform (aspx.cs file) to set the value of Seamless Intergration, please make sure empty your aspx file except the first line of the file. For example:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Seamless.aspx.cs" Inherits="MolPayUI.Seamless_function" %>
