Moneris Hosted Paypage Solution
Published: 2023-05-13 16:52:04

---
title: Moneris Hosted Paypage Solution
published: true
date: 2023-05-08 03:32:02 UTC
tags: 
canonical_url: 
---

Moneris is a Canadian financial technology company that specializes in payment processing. Using Moneris payment solutions you can securely accept payment information from customers on your website. Moneris Hosted Paypage solution is one of the easiest ways to integrate Moneris payment methods in your application.

In this short blog, we will create a Moneris Hosted Paypage configuration using Moneris Resource Center (MRC) and create a simple [ASP.NET](http://ASP.NET) MVC 6 application to integrate the payment solution.

So, fire up your browser and open [https://esqa.moneris.com/mpg](https://esqa.moneris.com/mpg) This is the MRC sandbox environment.

Use the demo account credentials:

username: demouser

store id: store3

password: xxxx

Go to **Admin** -> **Hosted Paypage Config** and **Click Generate a New Configuration**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683514474212/e8c97fd3-0089-47bc-826b-a79e8f8aff5b.jpeg)

It will open up a page with our new store id and key. Fill in a description for the new Hosted Paypage configuration. Keep the Transaction type as purchase and Payment Methods as Credit Cards Keep the response method option as the default "Moneris Gateway will generate a receipt". After processing the payment, Moneris will generate a receipt with the Order and Transaction Id on its server. Click "Save Changes".

This will create a new Hosted Paypage config for our store.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683514607526/faa34ee1-b322-40a4-9438-a99a28c4061e.jpeg)

Now head over to Visual Studio and create a new [ASP.NET](http://ASP.NET) MVC 6 application. For this demo I am using Visual Studio 2022

Open the appsettings.json file and add the below highlighted settings for our storeid, key and Moneris sandbox payment gateway hosted page that will process our payments.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683515302490/78a3660f-f55f-416b-b2fa-2f1e30118f26.png)

Now open HomeController.cs file and update the Controller to read the configuration values into ViewBag.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683515418726/61b3ef08-62ca-4242-8c76-e2f3332be211.png)

In Solution Explorer, go to Views -> Home -> Index.cshtml and add the below code.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683515840103/aeda9d68-fc9c-4e95-8d37-6c5240aea7ae.png)

Here, we created a simple form and will send the needed information to Moneris to process our payment. On clicking the checkout button, it will redirect to the Moneris Hosted gateway page where the customers will be able to provide their credit card information to process the payment.

Run your application from Visual Studio and click Checkout. This will redirect us to the Moneris gateway-hosted page. I will use a test card number. You can also easily search for other Moneris test card numbers. Click Process Transaction and once the payment will be approved, the customers will be redirected to a thank you page.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683515964263/4178217a-c14e-48e8-add0-8c9bfe75aee3.jpeg)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683515973029/678d9691-4254-4b36-8b06-968b445f43d3.jpeg)

Moneris will show the Order Id that we passed as a Guid from our code and the transaction reference number

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683516040271/6affc943-9fd5-4530-9168-d03abc4e746f.jpeg)

We can also search for our transactions on the MRC panel. Go to **Reports** -> **Transactions** and Under the **Other Criteria** , uncheck all options and keep **Order Id** checked. Copy the Order Id from the Thank you screen and paste it into the textbox. Click submit search and it should display our transaction with the amount and the card number we used.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683516414237/f9d1da6f-40bf-45b1-8ac2-485f1a324d07.jpeg)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1683516424071/5eb29fe5-8ba7-416d-bce1-5544b8780433.jpeg)

Hope you liked this article.

You can find the complete source code on my GitHub link.

[Moneris Hosted Paypage Demo](https://github.com/ufaruki/MonerisHostedPaypageDemo/tree/main)