|
This post relates only to Express Checkout using web service and ASP.NET/C#.
I downloaded great sample application from http://www.codeproject.com/KB/aspnet/paypal_c_aspnet.aspx. I reconfigured it so that it would use my own test accounts on developer.paypal.com and it worked perfectly. Cash was substracted from client's account and added into business account.
The problem began, when I deleted the web service reference and added exactly the same reference afterwards (referencing the same address: https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl). This brought compile error in the following code snippet:
DoExpressCheckoutPaymentRequestDetails = new DoExpressCheckoutPaymentRequestDetailsType()<br />
{<br />
Token = resp.GetExpressCheckoutDetailsResponseDetails.Token,<br />
PaymentAction = PaymentActionCodeType.Sale,<br />
PayerID = resp.GetExpressCheckoutDetailsResponseDetails.PayerInfo.PayerID,<br />
PaymentDetails = new PaymentDetailsType()<br />
{<br />
OrderTotal = new BasicAmountType()<br />
{<br />
currencyID = CurrencyCodeType.USD,<br />
Value = "10.00"<br />
}<br />
},<br />
}
PaymentDetails is not of type PaymentDetailsType anymore. Now it became of type PaymentDetailsType[]. So I rewritten the code as follows:
DoExpressCheckoutPaymentReq payReq = new DoExpressCheckoutPaymentReq()<br />
{<br />
DoExpressCheckoutPaymentRequest = new DoExpressCheckoutPaymentRequestType()<br />
{<br />
Version = UtilPayPalAPI.Version,<br />
DoExpressCheckoutPaymentRequestDetails = new DoExpressCheckoutPaymentRequestDetailsType()<br />
{<br />
Token = resp.GetExpressCheckoutDetailsResponseDetails.Token,<br />
PaymentAction = PaymentActionCodeType.Sale,<br />
PayerID = resp.GetExpressCheckoutDetailsResponseDetails.PayerInfo.PayerID,<br />
PaymentDetails = new PaymentDetailsType[]{ new PaymentDetailsType()<br />
{<br />
OrderTotal = new BasicAmountType()<br />
{<br />
currencyID = CurrencyCodeType.USD,<br />
Value = "1.00"<br />
},<br />
PaymentAction = PaymentActionCodeType.Sale<br />
},<br />
}<br />
}<br />
} <br />
};
This however brings me the error 81115, altough PaymentAction is set twice in my code.
Could you please tell me what may be wrong? I`m really stuck now. The zip with whole small solution is available under: https://www.x.com/servlet/JiveServlet/download/175795-8095/paypal_src%20-%20copy.zip. If you have any questions please let me know.
Thank you for help in advance
|
|
|
|
|
|
Hi....did u find any solution
found the problem----->
in web.config change ==
<add key="APIVersion" value="57.0" />
change 57.0 to 63.0
that is-------->
<add key="APIVersion" value="63.0" />
|
|
|
|
|
Hello Every One,
i have a function that loop inside the controls inside my asp.net page and put all of this controls in an array list but This page Implement the master page which already has controls inside ,so i do not want to add these controls i want to add only the controls in the content place holders .
i will appreciate it if any one can help me ,thanks in advance .
Eslam Soliman Adam
Attached code:
public class MyBasePage : System.Web.UI.Page
{
public ArrayList controlList = new ArrayList();
protected override void OnLoad(EventArgs e)
{
ListControlCollections();
base.OnLoad(e);
}
public void ListControlCollections()
{
ArrayList controlList = new ArrayList();
AddControls(Page.Controls, controlList);
foreach (string str in controlList)
{
Response.Write(str + "<br/>");
}
Response.Write("Total Controls:" + controlList.Count);
}
public void AddControls(ControlCollection page, ArrayList controlList)
{
foreach (Control c in page)
{
if (((c.ID != null) && (c.GetType().ToString().IndexOf("WebControl") >= 0)) || (c.GetType().ToString().IndexOf("CalendarControl") >= 0 || (c.GetType().ToString().IndexOf("OrienControls") >= 0)))
{
controlList.Add(c.ID);
}
if (c.HasControls())
{
AddControls(c.Controls, controlList);
}
}
}
public MyBasePage()
{
}
}
modified on Wednesday, June 16, 2010 7:01 AM
|
|
|
|
|
Inspite of people telling you repeatedly that use 'PRE' tags to format code such that your post is readable, you keep posting code without them.
It's really difficult for people to go through the code without it. You can still edit your question. Use 'code block' present in the formatting options. Place your code in between those code blocks pre tag.
|
|
|
|
|
Sorry It is the first time to join Forum and write code inside message ,I have already edit it to be able to read.
thanks.
|
|
|
|
|
The simple way is that you should replace your code [AddControls(Page.Controls, controlList);] in method ListControlCollections by the code [AddControls(Page.Master.FindControl("ContentPlaceHolder1").Controls, controlList);]
In above code I assume that your ContentPlaceHolder ID is "ContentPlaceHolder1". The idea of this code is that you first search your ContentPlaceHolder then only search all controls in the searched ContentPlaceHolder control.
Make it better.
|
|
|
|
|
The Problem is Have more than one contentplaceholder so ,I will not search for a specific
One but all I need is to search only in the contentplaceholders controls without getting any controls from master page
i tried your idea but it do work only with one contentplaceholder.
and the out put is:
==============================
Irange-------------------------> inside master page
LoginStatus1------------------------->inside master page
ContentPlaceHolder1------------------>Contain the following
Panel1
TextBox1
Label1
Button1
ImageButton1
LinkButton1
DropDownList1
HyperLink1
ListBox1
txt_startDate
CheckBox1
Calendar1
gv_List
Button2
ContentPlaceHolder2--------------------->contain the following
Eslam
EslamTXT
Total Controls:20
==============================
the idea that i want it loop only through the contentplaceholders
Thanks.
|
|
|
|
|
Ok, I see.
So I think first we should implement a method that list all ContentPlaceHolder control such as GetAllContentPlaceHolders.
Then we will loop all get controls and search all inside controls.
The GetAllContentPlaceHolders could be implemented as following code:
private IEnumerable<Control> GetAllContentPlaceHolders()
{
Queue<Control> controls = new Queue<Control>();
foreach (Control c in Page.Controls)
{
controls.Enqueue(c);
}
while (controls.Count > 0)
{
Control c = controls.Dequeue();
if (c is ContentPlaceHolder)
{
yield return c;
}
foreach (Control ic in c.Controls)
{
controls.Enqueue(ic);
}
}
}
After that in your orginal ListControlCollections method, you should replace AddControls(Page.Controls, controlList); by
foreach (Control c in GetAllContentPlaceHolders())
{
AddControls(c.Controls, controlList);
}
Hope it helps
Best regards,
HauLD
Make it better.
|
|
|
|
|
|
Hi all,
I need yours openions in following scenario
I have a web application where we allow to import data from xml file and the xml file could be larger like 10 to 20 MB containng more than 100000 record.
For this thing we have increased the maxrequestlength upto 20MB as well as executiontimeout upto 1 hr.
Can anybody confirm it is good to allow such processing via web application? if no then plese suggest me some alternative way to handle such case.
Thanks
Rohit
|
|
|
|
|
You could allow your clients to FTP the files to you and then process them with a dedicated application rather than through the web application?
|
|
|
|
|
Thanks dear for your kind suggestion. I will suggest to my client to do so but I would welcome the another approach for such case.
|
|
|
|
|
Probably this may help you.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Thanks dear but our problem is not related to loading of file but processing the file content which contains looping for data validation for each tags and number of tags could be more than lacs
|
|
|
|
|
I think you have understood that it <i>will</i> take a long time to process.
The problem if I am correct is how to make the user wait for the result?
My suggestion would be to decouple the processing and the status reporting.
So, the once the file is submitted by the user,
1. Save the file to disk, save the location to a queue table and tell the user that the application is processing his file.
2. On the server, write a service to read that queue table periodically and process the file. You could use fire and forget threads here.
3. The service would write some progress update to a progress table.
4. The status page shown to the user can read this progress table with the file id as the filter.
You could also expose a web service to check on status of a file
Shreekar
|
|
|
|
|
Hi there,
I am working on a datagrid that has a column with checkboxes… the checkboxes should be checked when the page loaded. The problem is that whenever I trigger a postback, all the checkboxes will be unchecked!!
I don’t know what is causing this or what should I do to prevent it from unchecking the checkboxes.
Any idea?
|
|
|
|
|
Try to do this:
CheckBox ckbox = DataGrid1.FindControl("yourcheckboxcontrolId");
chkbox.checked = true;
Check this outside of IsPostBack during PageLoad event so that it will always be checked. Hope this helps.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
This code solved it ^__^ thanks
|
|
|
|
|
Try enableviewstate as true and dont bind your gridview on postback again
|
|
|
|
|
hi!dudes,
can i know how to directly get the rowindex of a gridview in the SelectedIndexChanged event of the dropdownlist present in the gridview.
help ne ouuuuuut.
it's urgent.
T.Q.
regards..
|
|
|
|
|
There may be an option to get the rowindex in the row related events of gridview, especially RowdataBound. I am not so sure. Can you check this?
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
|
If you want to advertise something PAY FOR IT.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
nils illegitimus carborundum
|
|
|
|
|
I want to pass data from one page to another
is it correct process using 15 session objects for this process
or is there any other way of passing data from one page to another
|
|
|
|