now we have cart and when user click on check out button then we have a code which run and redirect user to paypal web site and from there user purchase.
now i like to show how we pass user selected product data and user details to paypal web site.
here is the sample code
i am interested to know is there any web service paypal offer as a result we can use that and we can pass user and cart data to paypal by calling their web service as a result we can stay in our web site page and do not have to push user to paypal page.
basically i am looking for a way to pass information from my web site to paypal web site internally or silently by using their web service. so just redirect me to relevant paypal page or article which guide me how to use paypal web service if any exist.
please guide me. thanks
now i like to show how we pass user selected product data and user details to paypal web site.
here is the sample code
NameValueCollection data = new NameValueCollection();
data.Add("cmd", "_cart");
data.Add("business", "test@gmail.com");
data.Add("invoice", 1);
data.Add("item_name_1", "Audi part1");
data.Add("amount_1" , 200);
data.Add("item_name_1", "BMW part1");
data.Add("amount_1" , 300);
data.Add("item_name_2", "carriage");
data.Add("amount_2" , 500);
data.Add("item_name_2" , "insurance");
data.Add("amount_100" , 100);
data.Add("item_name_2", "VAT Amount");
data.Add("amount_2" , 100);
data.Add("country", "GB");
data.Add("currency_code", "GBP");
data.Add("cn", "How did you hear about us?");
data.Add("upload", "1");
data.Add("address_override", "1");
data.Add("first_name", "customer first name");
data.Add("last_name", "customer last name");
data.Add("address1", "customer address1");
data.Add("city", "customer city");
data.Add("state", "customer state");
data.Add("zip", "customer post code");
data.Add("return", "http://abc.mysite.net/catalogue/order/PayPalSuccess.aspx");
data.Add("cancel_return", "http://abc.mysite.net/catalogue/order/PayPalFailure.aspx");
data.Add("notify_url", "http://abc.mysite.net/catalogue/order/PayPalNotify.aspx");
HttpHelper.RedirectAndPOST(this.Page, "https://www.paypal.com/cgi-bin/webscr", data);
publicstaticvoid RedirectAndPOST(Page page, string destinationUrl, NameValueCollection data)
{//Prepare the Posting formstring strForm = PreparePOSTForm(destinationUrl, data);//Add a literal control the specified page holding the Post Form, this is to submit the Posting form with the request.
page.Controls.Add(new LiteralControl(strForm));
}
i am interested to know is there any web service paypal offer as a result we can use that and we can pass user and cart data to paypal by calling their web service as a result we can stay in our web site page and do not have to push user to paypal page.
basically i am looking for a way to pass information from my web site to paypal web site internally or silently by using their web service. so just redirect me to relevant paypal page or article which guide me how to use paypal web service if any exist.
please guide me. thanks
tbhattacharjee