Monday, May 28, 2012

Online Payments Using Paypal with Asp.Net with C#

Introduction

this code for Online Payments Using Paypal with Asp.Net
Description

I am going to explain Step by Step Procedure, about integrating PayPal account with asp.

Step-1  Create a First Paypal Merchant Account.
            --this Account Create for Salling purpose.

Step-2  Create a Second Paypal Buyer Account.
             --this Account Create for purchasing purpose.

Using the code
I am going to explain Step by Step Procedure, about integrating PayPal account with asp.net Code.

you want to do online transaction using paypal. Use this Example in your project..

This Code is Declare on your Button Click Event.

const string Server_URL = "https://www.sandbox.paypal.com/cgi-bin/webscr?";
const string return_URL = "https://www.paypal.com/xclick/Sample@gmail.com";
const string cancelreturn_URL = "http://www.PageWhenCancel.com/cc.fail.aspx";

//Assigning Cmd Path as Statically to Parameter
string cmd = "_xclick";

//Assigning business Id as Statically to Parameter
string business = "tejasn_1338137871_biz@gmail.com";// Enter your business account here

//Assigning item name as Statically to Parameter
string item_name = "balagi waffers";

//Passing Amount as Statically to parameter
int amount = 1000;

//Passing Currency as Statically to parameter
string currency_code = "USD";

string redirect = "";

//Pass your Server_Url,cmd,business,item_name,amount,currency_code variable
redirect += Server_URL;
redirect += "cmd=" + cmd;
redirect += "&business=" + business;
redirect += "&item_name=" + item_name;
redirect += "&amount=" + amount;
redirect += "&currency_code=" + currency_code;
redirect += "&return=" + return_URL;
redirect += "&cancel_return" + cancelreturn_URL;
//Redirect to the payment page
Response.Redirect(redirect);


After Click on Send Button just follow this step
--when you purchase any one value using your seller id..
--Enter your id and password run time on paypal payment time..
Example of :- tejasbhalani_per@gmail.com 
This Code Sucessfully Run

4 comments:

Post a Comment

Followers