config my own secure payment system on nop project step by step.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
I want to use my own secure payment system.
It have a sample project and pdf document to guide.
here is Summary of that:
//*******************************************************************************
files in sample project:
Pasargad.cs include classes that explain on bellow.
Web.cofig include default specs to communicate with a secure payment system
Default.aspx is the sample web page that show the sample shopping cart
Purchase.aspx is the sample web page that show verify the transaction

pdf document:


Setting:
First of all, you must complete the following information and put in the web.config file. This information will be used later by the code.
<appSettings>
<add key="merchant_code" value="xxxxxxxxx"/>
<add key="terminal_code" value="yyyyyyyyyy"/>
<add key="redirect_address" value="http://www.example.com/response.php"/>
<add key="referrer_address" value="http://www.exampl.ecom/cart.php?error=bank"/>
<add key="delivery_days" value="5"/>
<add key="key_file" value="~/App_Data/key.xml"/>
</appSettings>

Merchant_code and Terminal_code will be available to you by the Bank.
Redirect_address is the default Address that user return there after successful payment.
Referrer_address is the default Address that user return there after unsuccessful payment.
Delivery_days is The maximum number of days to reach the product to the customer after payment.
Key_file is the private key in xml format that provide by bank.


Create shopping cart object:

1.Copy pasargad.cs in App_Code folder and import it.
Using pasargad in .cs files and <%@ import Namespace="Pasargad" %> in .aspx files.

2.Create shopping cart that include information about store, customer's information, purchase information, purchase date and array of purchase objects. Then create purchase object and initialize them with addProductItem and add them to cart.
Now we built an shopping cart object that is ready to convert in xml.

In the next steps you will use pasargadUtil class and convert shopping cart to xml , make electronic signatures, send it to the portal and see the result of transaction by pasargadUtils methods. These methods are defined as static.

Shopping cart in xml:  
String xml = PasargadUtil.createXML(cart);  

After create shopping cart in xml, you should make its sign by store's private key.
      
Make sign:      
String sign = PasargadUtil.sign(xml);

Send information to secure payment system:

RemotePost myremotepost = new RemotePost(content, sign);
myremotepost.Url = "https://paypaad.bankpasargad.com/PaymentController";
myremotepost.Post();

Get transaction result from secure payment system:

When transaction finished, the user will come back to redirect_address. On this page, bank send 3 variable to you. Tracking Number, factor date and factor number.
string tref = Request["tref"];
string i_date = Request["iD"];
string i_number = Request["iN"];
By these variables we can check the result of transaction that have successful or not.
Etc…
//*******************************************************************************

This is Summary of my payment system documentation.  Please help me to use it in nopcommerce project step by step. How can do it?
7 years ago
????
pleassssssssseee!!!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.