it is required to integrate the paypal donation button in asp.net c# web form, on clicking the donate button an email should be sent to the receiver with capturing the details of the donor like donor name, occupation, address and donation amount etc.
Please any help from anyone will be appreciated.
thanks
First u go through with Paypal Documentaion... It is best source for to learn all the things which u require.
Paypal SDK Documentation
DOnation of paypal using Asp.Net : Custom Control
How to Use Paypal SDK.. Sample applicaiton.
Use this code for asp.net page for a simple donation button
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="myemail">
<input type="hidden" name="item_name" value="Item name">
<input type="hidden" name="item_number" value="Item ID">
<input type="hidden" name="amount" value="12.00">
<input type="hidden" name="buyer_credit_promo_code" value="">
<input type="hidden" name="buyer_credit_product_category" value="">
<input type="hidden" name="buyer_credit_shipping_method" value="">
<input type="hidden" name="buyer_credit_user_address_change" value="">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input name="cbt" value="Click here to confirm the payment" type="hidden"/>
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input name="CANCELURL" value='<%=errorurl %>' type="hidden"/>
<input name="return" value='<%=url %>' type="hidden"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
'errorurl' and return url 'url' can be defined from codeback.
Also you can avoid unwanted parameters from the code.
You can set a custom image in the 'img' tag of the code.
Create a button of your own by using this link
https://www.paypal.com/cgi-bin/webscr?cmd=_donate-intro-outside
Resources mentioned are pretty good. To go through a live-setup example, you can visit this LINK and learn how you can achieve the same on your website.
NOTE: PayPal is integrated within a website, and doesn't offer a one-click solution like Web-API.
Related
Currently, We are assigning the values in the below form and post the data to payfort. Which works fine!!
<form method="post" action="https://sbcheckout.payfort.com/FortAPI/paymentPage" id=form1 name=form1>
<input type="hidden" name="signature" />
<input type="hidden" name="command" />
<input type="hidden" name="merchant_reference" />
<input type="hidden" name="amount" />
<input type="hidden" name="access_code" />
<input type="hidden" name="merchant_identifier" />
<input type="hidden" name="currency" />
<input type="hidden" name="language" />
<input type="hidden" name="customer_email" />
<input type="hidden" name="payment_option" />
<input type="hidden" name="order_description" />
<input type="hidden" name="return_url" />
But when we post the data throw above method it shows the credential information to others
Is there any way that we can post the data to payfort from our controller and redirect to posted URL ?
You can use: https://github.com/payfort/payfort-dotnet-sdk/
this is official dotnet SDK from payfort
Yes you can post data to payfort using .Net Client library https://github.com/payfort/start.net
steps to call payfort.
1) Generate card Token
pass open key and card detail.
2) create charge using card token
3) capture charge amount
I'm trying to get my Buy Now button in PayPal Sandbox to work. However when I make a purchase using it, it does not show up on my business transaction overview. And in the personal account, it shows as "Unclaimed" and "The recipient of this payment is Unregistered". Here is the ASP.NET code I'm using for the button:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="notify_url" value="censored" />
<input type="hidden" name="item_name" value="Aktivt kontigent" />
<input type="hidden" name="item_number" value="1" />
<input type="hidden" name="amount" value="240" />
<input type="hidden" name="tax_rate" value="25" />
<input type="hidden" name="undefined_quantity" value="0" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="handling" value="5" />
<input type="hidden" name="business" value="censored" />
<asp:ImageButton ID="btnPayNow" runat="server" ImageUrl="~/images/btn_buynowCC_LG.gif" PostBackUrl="https://www.sandbox.paypal.com/cgi-bin/webscr"/>
</form>
I know I'm using the right business ID, because my Business name appears on the checkout page on PayPal. And the IPN is also working, I can see that on my server. However the transaction does not appear on seller account, and the personal account is having this weird status. Does anyone know how to fix this please?
Thank you in advance.
The problem with this was my e-mail was not veryfied. It worked after that.
I am trying to link a registration form to an online payment website and I was given code from the payment website similar to the one below in order to link the two pages together. I don't see how I would implement this unless it's attributed to an asp:Button like below.
How would I make it so on the button click it would run through this form and this information would be sent? All this information is necessary and if it isn't sent then I just get an error page from the payment server.
<asp:Button ID="submitButton" runat="server" Text="Submit" OnClick="submitButton_Click" />
<form id="input_form" action="https://secure.checkout" method="post">
<input name="LMID" type="hidden" value="000935" />
<input name="unique_id" type="hidden" value="4567"/>
<input name="sTotal" type="hidden" value="150.00"/>
<input name="webTitle" type="hidden" value="2013 Conference" />
<input name="Trans_Desc" type="hidden" value="Conference Registration" />
<input name="contact_info" type="hidden" value="Contact web admin" />
</form>
Why not just do this?
<form id="input_form" action="https://secure.checkout" method="post">
<input name="LMID" type="hidden" value="000935" />
<input name="unique_id" type="hidden" value="4567"/>
<input name="sTotal" type="hidden" value="150.00"/>
<input name="webTitle" type="hidden" value="2013 Conference" />
<input name="Trans_Desc" type="hidden" value="Conference Registration" />
<input name="contact_info" type="hidden" value="Contact web admin" />
<input type="submit" value="submit"/>
</form>
I am working on a ASP.NET + Paypal Express project,
Website only have 1 $10 product but customer can buy it in quantities (i.e 1 or 4 or 20 etc )
Its like a paypal cart but only with 1 product with quantities.
I have searched a lot but unable to find some suitable one.
Also I want to redirect my customer to a form after paying money on paypal website.
Can you just tell me the simplest method ?
Also I have few more question :-
using minicart Paypal is suitable for this?
Do I need to configure Paypal Express account & what to configure ?
Thanks a lot :)
=================================================================
Update : Use Paypal mini cart if you need simple integration
Add cart script.js before the body tag ( https://minicart.paypal-labs.com/ )
After that All you need to add this code in your html
<div class="demo container" align="center" >
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<fieldset>
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="business" value="#gmail.com">
<input type="hidden" name="item_name" value="Buy Our Services">
<input type="hidden" name="amount" value="6.00">
<%--<input type="hidden" name="discount_amount" value="1.00">--%>
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="https://minicart.paypal-labs.com/?success">
<input type="hidden" name="cancel_return" value="https://minicart.paypal-labs.com/?cancel">
<strong>Service</strong>
<ul>
<li>Price: $6.00</li>
</ul>
<input type="submit" name="submit" value="Add to cart" class="button">
</fieldset>
</form>
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" class="last">
<fieldset>
<input type="hidden" name="business" value="#gmail.com">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="display" value="1">
<input type="submit" name="submit" value="View your cart" class="button">
</fieldset>
</form>
</div>
Change parameter accordingly & remove link to paypal instead of sandbox
You Paypal cart is ready to go.
If you want a more flexible solution then you should check this URL http://www.codeproject.com/KB/aspnet/paypal_c_aspnet.aspx
Thanks
Panky are you sure is it the right way ?
Customer come on site
Choose product/s and quantity/ies
Before do that you should store in session/database/cookies info that you need and pass to paypal only the stuff that you need with an id or other stuff which could be used to recognized customer too.
then move to pay to paypal.
Customer pay on paypal and paypal send back info about transaction
With these details you may re-create all the info that you need ans can use to complete first step back office tasks or even you may only show some message to cusotmer.
then you will wait ipn's(Instant Payment Notification) callback in order to make all tasks needed in backoffice automation.
This is the right way to do it.
Also you may able to make a good exception handling in order to prevent issue within it.
I have a website with all my photos, I would like people to be able to click on my pictures and order prints, etc through a third party service (Shutterfly, etc). Does anyone have any best practices or code examples of doing this in C#, ASP.NET?
I have no idea if this information is still up to date, but here is a description of the Shutterfly API. The API seems to consist in a simple HTTP form post with embedded name-value pairs.
Example:
<form action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="post">
<input type="hidden" name="addim" value="1">
<input type="hidden" name="protocol" value="SFP,100">
<input type="hidden" name="pid" value="C4P">
<input type="hidden" name="puid" value="AFFL">
<input type="hidden" name="imnum" value="1">
<input type="hidden" name="imraw-1" value="http://images.partner.com/foo/12345.jpg">
<input type="hidden" name="imrawheight-1" value="1800">
<input type="hidden" name="imrawwidth-1" value="1200">
<input type="hidden" name="imthumb-1" value="http://images.partner.com/foo/12345_thumb.jpg">
<input type="hidden" name="imthumbheight-1" value="150">
<input type="hidden" name="imthumbwidth-1" value="100">
<input type="hidden" name="returl" value="http://www.partner.com/alice">
<input type="submit" value="Submit">
</form>
It should not be a difficult task to write some C# wrapper for it.