Monday, March 17, 2014

C# - Access Moneris Payment Gateway in Local Environment – Part 1

Testing payment related functionalities are more critical developing systems which enables payment through the payment gateway. In Canada, one of the famous online payment gateway is "Moneris". Following article shows how to configure Moneris payment gateway to test payment functionalities in local development environment.

Following URL navigates the Moneris website which can use to configure store for testing purposes.

https://esqa.moneris.com/mpg/

Following screen shows login screen for their Testing site

Moneris Login Page
Then navigates to Admin -> “hosted config” section (see following screen)

Moneris Hosted Config Page

Then generate new configuration. When entering Approved and Decline URLs Moneris does not allowed you to add localhost or any IP address. Due to that reason we need to put valid address. However to overcome that issue we can add host entry to local development machine (add new host entry in host file located in “C:\Windows\System32\drivers\etc”) and use that host address as an address of web site. For the demonstration use address - http://localdev.payment/.


User can configured three different pages as an approved return page, Cancel return page and decline page. Based on the requirement it can configure response as a POST or GET or POST with XML. If you enable the "Use enhance Cancel" you can filter-out the cancel response and decline response separately without using two different pages for cancel and decline.  There are several key fields we need to extract from the Moneris response. Following list shows some of required fields and values. For more details please visit Moneris (http://www.moneris.com/)


Configuration Fields

Create request for payment gateway


To create payment request need to send set of required fields to the payment gateway. Following code snippet shows how to create payment request for Moneris payment gateway. Following knowledge base provide relevant request fields and response fields

http://docs.abvma.ca/documents/eSELECTplusHPPIG/eSELECTplusHPPIG.pdf

  protected void Page_Load(object sender, EventArgs e)

        {

            ClientScript.RegisterHiddenField("ps_store_id", "MB5YEtore3");

            ClientScript.RegisterHiddenField("hpp_key", "hpL9K5APKH49");

            ClientScript.RegisterHiddenField("order_id", "ord000001");

            ClientScript.RegisterHiddenField("charge_total", "100.00");



            btnSubmitPayment.PostBackUrl = "https://esqa.moneris.com/HPPDP/index.php";

        }


Following code snippet shows how get response from Moneris and extract.

    protected void Page_Load(object sender, EventArgs e)

        {

            lblResponseOrderIdValue.Text = Request.Form["response_order_id"];

            lblReseponseCodeValue.Text = Request.Form["response_code"];

            lblDateStampValue.Text = Request.Form["date_stamp"];

            lblTimeStampValue.Text = Request.Form["time_stamp"];

            lblBankApprovalCodeValue.Text = Request.Form["bank_approval_code"];

            lblResultValue.Text = Request.Form["result"];

            lblTotalAmountValue.Text = Request.Form["charge_total"];

        }



Following screen captures shows payment request and sample payment response


Payment Request

Moneris Payment Gateway - Test Details

Cancel Payment Response

Decline Payment Response



Tuesday, February 25, 2014

TFS Tips: Exporting Test Cases from Microsoft TFS without using Test Manager

We need to export test cases from TFS for various purposes (mainly document purposes). Microsoft visual studio test client 2012 does not support to export test case with details in user friendly manner. We can use Export functionality of web client to export test cases with steps and related work items. Following figures illustrates how export test cases using web client.

Web client only allow to export test cases which include in the test plan. First of all need to create proper test plan before export test cases. Following Screenshot illustrates the test plan and test cases which assigned to test plan.

Test Plan


Then right click on test plan and select Export option from menu. It will allowed to select details which need to include in to the list. Online TFS facilitates to print or mail the test case details.

Export Menu

Test Case Export Settings

Exported Test Case List

Friday, February 21, 2014

Microsoft Dynamic 2011 on Internet Explorer 11

Microsoft Dynamic CRM 2011 does not support Internet Explorer 11 (IE11). If user try to navigate to CRM 2011 using IE 2011 then user will automatically redirects to the Dynamic CRM 2011 mobile site.

CRM 2011 Mobile Site

To avoid that issue can use compatibility settings of Internet Explorer 11. Following screen shows how set compatibility settings for Dynamic CRM 2011 site.

IE 11 compatibility Settings 
Add URL to compatibility view
CRM 2011 in IE 11 in compatibility mode