Paypal Sandbox integration in asp.net website by using Website Payments Standard - asp.net

I have integrated paypal sandbox in my asp.net using Website Payments Standard as follow.
<form name="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="abc_131556943_biz#gmail.com" />
<input type="hidden" name="item_name" value="MyItem" />
<input type="hidden" name="amount" value="0.01" />
<input type="hidden" name="return" value="http://stackoverflow.com/questions/ask" />
<input type="hidden" name="cancel_return" value="http://stackoverflow.com" />
<input type="hidden" name="notify_url" value="http://stackoverflow.com" />
<input type="hidden" name="no_shipping" value="1" />
<input type="submit" value="Please Wait....." style="visibility: hidden" />
</form>
Now issue is that when i am redirected to paypal then first it asks to login into paypal sandbox account. I want to ask that is it necessary to login into paypal sandbox for making the payment. Is there any parameter whcih we can send in hidden field so that it does not ask for sandbox login.
Thanks, Rajbir

I usually pre-authenticate into the Sandbox to skip/keep a normal code flow when testing. I don't know of anything that can be done to by pass it other than using a real account.

Related

I want to replace my paypal email address with some text on Paypal Checkout

I have a problem with PayPal custom checkout. I want to replace my PayPal email address on the custom shopping cart checkout form:
Here is my code:
<form action="https://www.paypal.com/us/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="yourmail#gmail.com">
<input type="hidden" name="item_name" value="Test">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="0.00">
<input type="hidden" name="quantity" value="2">
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
How can I do this in Wordpress?
Upgrade the receiving PayPal account to a Business account, and choose a business name.
See https://www.paypal.com/gf/smarthelp/article/how-do-i-upgrade-from-a-personal-premier-account-to-a-business-account-faq1317

Paypal integration questions

I have some code that i wrote many years ago to integrate Paypal within my site. So a user adds multiple products to their cart and then checks out which then automatically takes the user to the paypal site.
I decided to revisit it today and created the following HTML
<form name="myForm" method="POST" action="https://www.sandbox.paypal.com/cgi-bin/webscr" >
<input type="hidden" name="cmd" value="_cart"/>
<input type="hidden" name="business" value="myemail-facilitator#myDomain.com"/>
<input type="hidden" name="item_name" value="Product 1"/>
<input type="hidden" name="amount" value="500.00"/>
<input type="hidden" name="quantity" value="1"/>
<input type="hidden" name="upload" value="1"/>
<input type="hidden" name="currency_code" value="GBP"/>
<input type="hidden" name="return" value="http://XX/paypal/completed.aspx"/>
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cancel_return" value="http://XX/paypal/Cancel.aspx"/>
<input type="hidden" name="shopping_url" value="http://XX/paypal/MyShop"/>
<input type="hidden" name="notify_url" value="http://XX/paypal/MyShop/checkout.aspx"/>
<input type="hidden" name="lc" value="GB"/>
<input type="hidden" name="image_url" value="http://XX/paypal/shop.gif"/>
<input type="hidden" name="no_note" value="1"/>
<input type="hidden" name="invoice" value="ZZZ1234567890"/>
<script type="text/javascript">document.myForm.submit();</script></form>
This came up with an error "Error Detected Your shopping cart is empty".
Logged into my sandbox account and no error listed to determine what ive done wrong.
Googled around which suggested to change _cart to _xclick - which resolved the issue, however when i read the documentation at
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
I dont understand why _cart didnt work? Is there a more appropriate way to do this or _xclick fine with my site setup as described above?
For multiple items i was looping the item_name and amount and adding each value, but this doesnt work the way i expected i.e. I've seen sites where they display each product, quantity and amount for each product in the cart and then total - where did i go wrong?
Finally once a transaction is complete i have set up the IPN value to send the details to my site..... Do i need the site to be using https in order for this to work or would http work?
I tried searching for these answers but some are quite dated or using 3rd part components.
Please make below changes to your HTML codes to make your form work again.
<input type="hidden" name="item_name" value="Product 1"/>
<input type="hidden" name="amount" value="500.00"/>
<input type="hidden" name="quantity" value="1"/>
↓↓
<input type="hidden" name="item_name_1" value="Product 1"/>
<input type="hidden" name="amount_1" value="500.00"/>
<input type="hidden" name="quantity_1" value="1"/>

How to get Transaction Id from sandbox paypal

This is my question .
<form name="_xclick" action="https://www.sandbox.paypal.com/in/cgi-bin/webscr" method="post" style="opacity:0;height:42px;background:red;left:0;top:0; width:100%;margin:0px;position:absolute;">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="walapaybusiness#gmail.com">
<input type="hidden" id="paypal_text" name="return" value="${request.serverUrl}/marketProducts/productBuySuccess?productId=1&flag=10"/>
<input type="hidden" name="cancel_return" value="${request.serverUrl}/dudewala/paymentSuccess" />
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Dude dollar">
<input type="hidden" name="amount" value="10">
<input class="paypalBtn" type="image" style="height:42px;width:100%; " src="http://www.paypal.com/en_GB/i/btn/x-click-but01.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
This is my form for paypal sandbox mode and this is my success url from paypal
${request.serverUrl}/marketProducts/productBuySuccess
Here is it possible to attach transaction id from paypal?
May be the expected URL will look like
${request.serverUrl}/marketProducts/productBuySuccess?transactionId=123456789000
So I can fetch the transaction id as params.transactionId
I am doing this in grails so It will be great if you can give my answer in grails
Thanks in advance :)
PayPal send you Transaction ID with the txn_id name. You can also use others, like payer_id, etc...

Paypal Integration Post processing information

I have created a simple button, on a click of it direct it to the paypal site for the payment.
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="abhish_1347270213_biz#gmail.com" />
<input type="Show" name="item_name" value="My painting" />
<input type="Show" name="amount" value="10.00" />
<input type="submit" value="Buy!" />
</form>
Now what I am trying to do is to redirect to my own page with the transaction successful notification.
I have read websites articles but nothing is providing me with the Solution. Need help regarding to this issue.
Use PayPal Instant Payment Notification (IPN), more information here: https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/article_pdn_intro-outside.
Here's a code sample:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="alanb#alanb.com">
<input type="hidden" name="undefined_quantity" value="1">
<input type="hidden" name="item_name" value="doodad from alanb.com">
<input type="hidden" name="item_number" value="dd01">
<input type="hidden" name="amount" value="4.99">
<input type="hidden" name="return" value="http://alanb.com/doodads/thanks.html">
<input type="hidden" name="cancel_return" value="http://alanb.com/doodads/canceled.html">
<input type="image" border="0" name="submit" src="http://images.paypal.com/images/x-click-but5.gif" alt="Effectuez vos paiements via PayPal : une solution rapide, gratuite et sécurisée">
</form>
The trick is done by the "return" input element ;).
Another thing that helped me a lot when setting up PayPal Integral Evolution on my website, was this PDF: https://cms.paypal.com/cms_content/FR/en_US/files/developer/IntegralEvolution.pdf. It documents all fields, possible values and how to use them.
Hope this helps,
Carl

Paypal integration problem

I am having problem in integrating paypal IPN.I am implementing this code but it is not returning me the values to IPN
My form that is made after executing the code is as follow
<form method="post" name="paypal_form" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cmd" value="_cart"/>
<input type="hidden" name="business" value="info#something.com"/>
<input type="hidden" name="return" value="http://abc.com/test.php?action=success"/>
<input type="hidden" name="cancel_return" value="http://abc.com/test.php?action=cancel"/>
<input type="hidden" name="notify_url" value="http://abc.com/test.php?action=ipn"/>
<input type="hidden" name="item_name_1" value="Adob photoshop"/>
<input type="hidden" name="item_number_1" value="10"/>
<input type="hidden" name="amount_1" value="15"/>
<input type="hidden" name="upload" value="1"/>
<input type="hidden" name="cn" value="1"/>
<input type="hidden" name="tx" value="TransactionID"/>
<input type="hidden" name="currency_code" value="USD"/>
<input type="hidden" name="no_shipping" value="1"/>
<center><br/><br/>If you are not automatically redirected to paypal within 5 seconds...<br/><br/>
<input type="submit" value="Click Here"></center>
</form>
The problem is that the code is working fine for the return and cancel part but when I use this code for IPN it does not give me any value.My code for the IPN is as under
if ($pay->validate_ipn()) {
//do the insertion I have tested this insertion it is working fine
}
Have a look at History > IPN History inside your PayPal account. This should show the status of the IPN messages that were sent to you. Click on the message ID if you wish to find out more detailed information.
If it's retrying, double-check your error logs and ensure it's returning a proper HTTP/1.1 200 OK response when accessed by the PayPal IPN service (notify.paypal.com).

Resources