Thursday, November 13, 2008

Implementing St George Payment Gateway using asp.net or c#


St.George Internet Payment Gateway
In order to implement internet payment gateway using St George api,using asp.net and c# you require followings things


Reliable $1 Web Hosting by 3iX

1) webpay.dll and Org.Mentalis.Security.dll
2) Client Id from the st george bank
3) digital certificate and its pwd from the bank

then in the pay button click paste the following code

Int32 pay1 = Convert.ToInt32(amount.Text);
if (pay1>=pay)
{
//Set the following values appropriately for your Bank/Service Provider
//String responseURL = "http://www.gwipg.stgeorge.com.au/";
String responseURL = "";

//To avoid processing duplicate payments, for this user, check the
//if ( Session.Contents[ "WEBPAYOBJECT" ] == null )
//{
webpay.client.Webpay w = new webpay.client.Webpay("10000xxx", "e:\\net.pfx", "yourpwd");
Session.Contents["WEBPAYOBJECT"] = w;
responseURL = processPayment(w);
String expdate = mm.SelectedValue + "/" + yy.SelectedValue;
obj.Insert(Convert.ToInt32(Session["MId"]), Convert.ToDecimal(amount.Text), ddlpaymentmethod.SelectedValue, cardName.Text, txtCardData.Text, cvc2.Text, expdate.ToString());
//}
Response.Redirect(responseURL);
}
else
{
lblpayment.Text = "Payment Should be greater than " + pay;
}



use the following function


private String processPayment(webpay.client.Webpay w)
{
System.Random randObj = new System.Random(5325);
w.setServers("www.gwipg.stgeorge.com.au");
w.setPort(3006); //use 3005 for testing
w.setValue("CLIENTID", "10000xxx");

w.setValue("INTERFACE", "CREDITCARD");
w.setValue("TRANSACTIONTYPE", "PURCHASE");
//Set the following values based on user input, or calculations from other parts of
//your application.
//Please consult your service provider's documentation for
//required and optional fields.
w.setValue("CARDHOLDER_NAME", cardName.Text);
w.setValue("CARDDATA", txtCardData.Text);
w.setValue("CARDEXPIRYDATE", mm.SelectedValue + yy.SelectedValue);
w.setValue("CVC2", cvc2.Text);

w.setValue("TOTALAMOUNT", amount.Text);
w.setValue("CLIENTREF", "" + randObj.Next());

//Store the Webpay Object in the session. So it can be retrieved easily by other pages (results/errors, etc)
Session.Contents["WEBPAYOBJECT"] = w;

System.Exception ex = null;
for (int i = 0; i < 2; i++)
{
try
{
w.execute();
ex = null;
break;
}
catch (webpay.client.ConnectException cex)
{
//Log the error, and try again.
ex = cex;
continue;
}
catch (System.Exception ioex)
{
//If a TXNREFERENCE is available, check the status of the transaction.
//The number of times to loop, and the sleep time may vary depending on the
//requirements of your application.
ex = ioex;
w.setValue("TRANSACTIONTYPE", "STATUS");
for (int j = 0; j < 2; j++)
{
try
{
//In case we the connection was dropped part way thru,
//give the transacton time to complete at the back end
System.Threading.Thread.Sleep(1500);
}
catch (Exception e)
{
}
try
{
w.execute();
//If the responsecode is still "IP", then wait and check the status again.
if (w.getValue("RESPONSECODE") != "IP")
{
//We have a result, continue
break;
}
}
catch (System.Exception e)
{
ex = e;
}
}
}
}
if (ex != null)
{
//An exception was encounteded which could not be recovered, possibly
//while attempting to retry or check status. Set the redirect to a
//page/process which can handle error conditions.
Session.Contents["ERROR"] = ex;
return "ErrorPage.aspx";
}
//Processing completed normally - redirect and display the results to the user.
//NOTE: Your applicaton will need also need to inspect the RESPONSECODE parameter and
//store the transaction result somewhere. This should be done here, and not in the
//Result display code, as this code will only execute once, while the display code has the potential
//to be re-executed if the user clicks "Refresh" or attempts to re-process the transaction
//using the "Back" button.
return "ResultsPage.aspx";
}

}
// if you face any problem please feel free to ask

Thursday, October 30, 2008

HTC TOUCH : Reviews and Price

HTC touch is a great smart phone.It has latest windows mobile operating system.It has all the applications like word,ppt,excel,you can send emails.it has a 2 mega pixel camera and a very unique touch flow.1 gb memory card which is expandable upto 4 gb.
Reliable $1 Web Hosting by 3iX

Lots of great features.a must buy phone if you are looking for a cheap smartphone.In india its costs around rs 15k.

Feel free to post your reviews here....

Thursday, October 23, 2008

GoDaddy Reviews:GoDaddy Web Hosting Review

Webmaters,

if you are looking to get hosting from godaddy.com please think twice before getting a web hosting account from them.Their support is very bad...they always say..this is a coding or 3rd party scripting issue and we can not help.I have atleast 3-4 sites and everyone has some problem.If you are taking windows hosting..pls keep in mind they do not provide remote access to sql server.You have to use their sql server web admin which i feel is not good.so....think twice before going with godaddy.

I will recommend using 3ix...they have very cheap hosting..they have $1 web hosting packages and $3 web hosting packages.They have very good support.I have 2 personal sites with them check below

Reliable $1 Web Hosting by 3iX

Tuesday, October 21, 2008

SRS: Sample SRS Templates

1.Background

This document describes the requirements necessary for the Software Project.

2.Scope

Explain what the software product will do

3.Software Requirement Specification
3.1. System scope

list all the features for which specifications must be created, designed, coded and tested as part of the project.>

3.2. Definitions, Acronyms, Abbreviations

The following is a list of commonly used definitions used throughout this document

5. UI Prototype (Optional)

Attach screen shots and explain control flow.

Reliable $1 Web Hosting by 3iX



6. Assumptions and Dependencies

State any known assumptions and dependencies

7. Non-Functional Requirements

7.1. Environmental Requirements

Hardware and Software requirements

7.2. System Performance Requirements

7.3. Security


7.4. Design and Implementation Constraints

7.5. Standards


8. Evisioned Future Enhancements / Open Issues


9. References

10. Annexures