-
Notifications
You must be signed in to change notification settings - Fork 1
Installation Guidance
- Download
MOLPayCS.zip
file. - Extract the zip file.
- Open Visual Studio project, right click on your project name in
Solution Explorer
and chooseAdd Reference
. - Click
Browse
to search for downloaded MOLPayCS.dll. ClickOK
to add.
- Create MOLPayCS object in order to access the properties of Payment:
Dim objectMolpay As New MOLPayVB.MOLPay.Base
- Set which type of enviroment with either Sandbox or Production
objectMol.TypeID = "sandbox" ' "sandbox" or "production"
Set these needed objects that will send the buyer infromation to MOLPay hosted payment page.
'Value set are examples
objectMolpay.Domain = "MOLPay" 'Replace with your Merchant ID provided
objectMolpay.Vkey = "xxxx" 'Replace xxxxxxxxxx with your MOLPay Secret_Key
objectMolpay.Amount = "1.1"
objectMolpay.Orderid = "Testing123"
Optional objects. Details can be key in at the payment page as well.
'Value set are examples
objectMolpay.Bill_name = "Molpay Tester"
objectMolpay.Bill_email = "molpay@molpay.com
objectMolpay.Bill_desc = "Send me money"
objectMolpay.Currency = "MYR"
objectMolpay.Country = "Malaysia"
It is not needed to set all the Endpoint URLs. If not set,by default the Endpoint URLs would be taken from Merchant Portal's End Point settings.
'Value set are examples
objectMolpay.ReturnUrl = "molpay.com" 'Desired returned page after payment page
Objects that are set will be send to hosted payment page by calling a function.
objectMolpay.Pay()
Set the values received from MOLPay's payment page.
objectMolpay.Vkey = "xxxxxxx" 'Replace xxxxxxxxxx with your MOLPay Secret_Key
objectMolpay.TranID = request.Form("tranID")
objectMolpay.Orderid = request.Form("orderid")
objectMolpay.Status = request.Form("status")
objectMolpay.Domain = request.Form("domain")
objectMolpay.Amount = request.Form("amount")
objectMolpay.Currency = request.Form("currency")
objectMolpay.Appcode = request.Form("appcode")
objectMolpay.Paydate = request.Form("paydate")
objectMolpay.Skey = request.Form("skey")
Additional object must be set when using IPN
objectMolpay.Treq = "1" 'Value is always 1. Do not change
Call the IPN function
objectMolpay.IPN()
Set additional object for Notification & Callback URL
objectMolpay.Nbcb = request.Form("nbcb")
objectMolpay.Key1checked()
Return value of the function is a string which contains the key1 value.
E.G
return & notification URL
'invalid transaction if the key is different. Merchant might issue a requery to MOLPay to double check payment status with MOLPay.
If objectMolpay.Skey() <> objectMolpay.Key1checked() then
objectMolpay.Status= "-1"
End if
If objectMolpay.Status = "00" then
'checking the validity of cart amount & orderid.
'if the verification test passed then can update the order status to paid.
'you can also do further checking on the paydate as well
Else
'failure action
'Merchant might send query to MOLPay using merchant requery
'to double check payment status for that particular order.
End if
'Merchant is to implement IPN to ack on receiving of payment status
'regardless the payment status
E.G
callback URL
If objectMolpay.Skey <> objectMolpay.Key1checked then
objectMolpay.Status= -1
End if
If objectMolpay.Status = "00" then
'write your scripe here....
Else
'failure action
'write your script here .....
End if
'callback IPN feedback to notify MOLPay
response.write(objectMolpay.IPN)
There are several types of status requery on MOLPay system:
- Query by unique transaction ID (recommended)
- Query by order ID & get latest matched result (single output)
- Query by order ID & get all matched results (batch output)
- Query by multiple order ID (batch output)
- Query by multiple transaction ID (batch output) *For bulk requery, best practice is to utilize the 4th or 5th APIs once every half an hour for unknown status transactions only
Set the values to requery
objectMolpay.Amount = "100.00" ' 2 decimal points numeric value
objectMolpay.TxID = "xxxxxxxx" ' Replace xxxxxxxxx with Merchant transaction ID , which might be duplicated.
objectMolpay.Domain = "XXXXXXXX" ' Replace XXXXXXX with your MOLPay Merchant ID
objectMolpay.Vkey = "zzzzzzzz" ' Replace zzzzzzz with your verify key
objectMolpay.Url = "http://exampleurl" ' The URL to receive POST response from MOLPay
objectMolpay.Type = "0" ' 0 = plain text result (default), 1 = result via POST method
objectMolpay.TypeID = "sandbox" ' Set which type of environment with either **sandbox** or **production**
Use RequeryTransactionID function to trigger
objectMolpay.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
objectMolpay.Amount = "100.00" ' 2 decimal points numeric value
objectMolpay.OID = "xxxxxxxx" ' Replace xxxxxxxxx with the Order id that you want to check
objectMolpay.Domain = "XXXXXXXX" ' Replace XXXXXXX with your MOLPay Merchant ID
objectMolpay.Vkey = "zzzzzzzz" ' Replace zzzzzzz with your verify key
objectMolpay.Url = "http://exampleurl" ' The URL to receive POST response from MOLPay
objectMolpay.Type = "0" ' 0 = plain text result (default), 1 = result via POST method
objectMolpay.Req4token = "1" ' 0 = No (default), 1 = Yes for more card related information
objectMolpay.TypeID = "sandbox" ' Set which type of environment with either **sandbox** or **production**
Use equeryOrderIDSingle function to trigger
objectMolpay.RequeryOrderIDSingle()
Set the values to requery
objectMolpay.OID = "xxxxxxxx" ' Replace xxxxxxxxx with the Order id that you want to check
objectMolpay.Domain = "XXXXXXXX" ' Replace XXXXXXX with your MOLPay Merchant ID
objectMolpay.Vkey = "zzzzzzzz" ' Replace zzzzzzz with your verify key
objectMolpay.Url = "http://exampleurl" ' The URL to receive POST response from MOLPay
objectMolpay.Type = "0" ' 0 = plain text result (default), 1 = result via POST method
objectMolpay.Format = "0" ' 0 = result string with delimiter ( | ), 1 = result in array
objectMolpay.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
objectMolpay.RequeryOrderIDBatch()
Set the values to requery
objectMolpay.OIDs = "xx|yy|zz" ' e.g) xx & yy & zz are the order id you want to check (separate with "|")
objectMolpay.Delimiter = "|" ' Single character, default is "|". Avoid using any symbol that might exist in order ID,
' and also any of these: “,%, *, <, >, ? , \, $, &, =
objectMolpay.Domain = "XXXXXXXX" ' Replace XXXXXXX with your MOLPay Merchant ID
objectMolpay.Vkey = "zzzzzzzz" ' Replace zzzzzzz with your verify key
objectMolpay.Url = "http://exampleurl" ' The URL to receive POST response from MOLPay
objectMolpay.Type = "0" ' 0 = plain text result (default), 1 = result via POST method
objectMolpay.Format = "0" ' 0 = result string with delimiter ( | ), 1 = result in array
objectMolpay.Req4token = "1" ' 0 = No (default), 1 = Yes for more card related information
objectMolpay.TypeID = "sandbox" ' Set which type of environment with either **sandbox** or **production**
Use RequeryMultiOrderID function to trigger
objectMolpay.RequeryMultiOrderID()
Set the values to requery
objectMolpay.TIDs = "xx|yy|zz" ' e.g) xx & yy & zz are the transaction id you want to check (separate with "|")
objectMolpay.Domain = "XXXXXXXX" ' Replace XXXXXXX with your MOLPay Merchant ID
objectMolpay.Vkey = "zzzzzzzz" ' Replace zzzzzzz with your verify key
objectMolpay.Url = "http://exampleurl" ' The URL to receive POST response from MOLPay
objectMolpay.Type = "0" ' 0 = plain text result (default), 1 = result via POST method
objectMolpay.Format = "0" ' 0 = result string with delimiter ( | ), 1 = result in array
objectMolpay.Req4token = "1" ' 0 = No (default), 1 = Yes for more card related information
objectMolpay.TypeID = "sandbox" ' Set which type of environment with either **sandbox** or **production**
Use RequeryMultiTransactionID function to trigger
objectMolpay.RequeryMultiTransactionID()
Create MOLPayCS object in order to access the properties of Seamlesspayment:
Dim objSeamless As New MolPayCS.Seamlesspayment
Set the values for seamless integration
objSeamless.Merchantid = "xxx" ' Replace xxx Merchant login username provided by MOLPay
objSeamless.Vkey = "xxx" ' Replace xxx with your verify key
objSeamless.Orderid = "xxx" ' Replace xxx with Bill / Invoice no. provided by merchant
objSeamless.Country = "MY" ' Buyer country
objSeamless.ReturnUrl = "xxx" ' Replace xxx with your return URL
objSeamless.CancelUrl = "xxx" ' Replace xxx with URL to redirect when the payment is time out. Mandatory when timer is enable.
objSeamless.Failureurl = "xxx" ' Replce xxx with URL to redirect when transcation fail
objSeamless.ProcessRequest() ' Used to trigger seamless integration
- Download
Seamless.zip
and extract the file. - Open the solution inside Seamless file.
- Right click on "WebForm1.aspx" file and select "View Code".
- Set which type of environment by assigning variable "demo_type" to either sandbox or production.
- Set your
MerchantID
andVkey
on the fileseamlessHandler.ashx
. - Build Solution and Debug the project.