Hello Guys,
I am in Big Trouble,please Help me out.
i want to Implement Paypal Payment Gateway in my project,Situation is ..If the payment is canceled then it should return some value on my aspx.cs code and if the payment is success then it should also return some confirmation value on code Behind.
value like ...True/False or 1/2 anything but it should return some value.
Please HELP me how can i do that .
its VERY-VERY URGENT !!
Thanks
Loading
satyamkumar sethPosted Dec 10, 2008, 12:36 AM
Thanks for the Reply.
if i copy and paste the code which you have given me it will run and how will i take the value for cancel the payment and value for full payment that need to be store in the database.
i am not getting <%@ Import namespace="com.paypal.soap.api"%>
if i give the same way on my page will it run .
Nipun TomarPosted Dec 9, 2008, 6:48 AM
download the sample from paypal website it has demontrated everything in there...
Receipt.aspx page
<%
@ Register tagprefix="PP" tagname="Errors" src="../Errors.ascx"%><%
@ Page language="c#" CodeFile="Receipt.aspx.cs" AutoEventWireup="false" Inherits="PayPalSample.wppro.Receipt" %><%
@ Import namespace="com.paypal.soap.api"%>DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<
HTML> <HEAD> <title>PayPal .NET SDK - DoDirectPayment APItitle> <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"> <meta name="CODE_LANGUAGE" Content="C#"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> <LINK href="../sdk.css" rel="stylesheet" type="text/css"> HEAD> <body alink="#0000ff" vlink="#0000ff"> <form id="Form1" method="post" runat="server"> <asp:PlaceHolder Runat="server" ID="SuccessfulPlaceholder"> <BR> <CENTER><FONT face="Verdana" color="black" size="2"><B>Do Direct PaymentB>FONT> <BR> <BR> <B>Thank you for your payment!B><BR> <BR> <TABLE width="400"> <tr> <td>Transaction ID:td> <td><asp:Literal id=TransactionIDLiteral Runat="server" Text="<%#DoDirectPaymentResponse.TransactionID%>">asp:Literal>td> tr> <tr> <td>Amount:td> <td><asp:Literal id=CurrencyIDLiteral Text="<%#DoDirectPaymentResponse.Amount.currencyID%>" Runat="server">asp:Literal><asp:Literal id=AmountValueLiteral Runat="server" Text= "<%#DoDirectPaymentResponse.Amount.Value%>">asp:Literal>td> tr> <TR> <td>AVS:td> <td><asp:Literal id=AVSCodeLiteral Runat="server" Text="<%#DoDirectPaymentResponse.AVSCode%>">asp:Literal>td> tr> <tr> <td>CVV2:td> <td><asp:Literal id=CVV2CodeLiteral Runat="server" Text="<%#DoDirectPaymentResponse.CVV2Code%>">asp:Literal>td> tr> TABLE> asp:PlaceHolder> <PP:Errors runat="server" id="Errors">PP:Errors> CENTER> <a id="CallsLink" href="../Calls.aspx">Homea> form> body> HTML>Receipt.aspx.cs
using
System;using
System.Web.UI.WebControls;using
com.paypal.soap.api;namespace
PayPalSample.wppro{
///{
private void Page_Load(object sender, EventArgs e){
}
public DoDirectPaymentResponseType DoDirectPaymentResponse{
get{
return this.PayPalResponse as DoDirectPaymentResponseType;}
}
protected override void OnPreRender(EventArgs e){
base.OnPreRender (e); this.DataBind();}
public override void DataBind(){
this.SuccessfulPlaceholder.Visible = this.IsTransactionSuccessful; if (this.DoDirectPaymentResponse != null && this.IsTransactionSuccessful){
this.SuccessfulPlaceholder.DataBind();}
}
}
}