Paypal not calling IPN script at all on my web server - paypal-ipn

I'm trying to use Paypal IPN on a website.
The payment works and is marked as "completed".
The return url works.
An email is sent notifying the payment is done
But it seems paypal doesn't talk to the IPN script. When checking with Wireshark, there is no communication with my website when the payment is sent.
Could it be because this communication is embedded inside an SSL communication and not in non-secure HTTP?
Could my server refuse to process the IPN request from Paypal?
I thought it would work out of the box, but no. It seems it doesn't reach my server, and Paypal doesn't return something like "your server refused to receive IPN infos". So Paypal is just not calling IPN script.
I'm 99% sure my request in correct, but here's the button I made:
<form action="<%=paypalurl%>" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<%=appsettings.paypalemail%>">
<input type="hidden" name="item_name" value="<%=appsettings.paypalitem%>">
<input type="hidden" name="item_number" value="<%=appsettings.paypalid%>">
<input type="hidden" name="amount" value="<%=appsettings.paypalamount%>">
<input type="hidden" name="currency_code" value="<%=appsettings.paypalcurrency%>">
<input type="hidden" name="custom" value="<%=userid%>">
<input type="hidden" name="notify_url" value="http://www.mysite.com/ipnscript.aspx">
<input type="hidden" name="return" value="http://www.mysite.com/ppreturnurl.aspx">
<input type="hidden" name="cancel_return" value="http://www.mysite.com/ppcancelurl.aspx">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<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>

Did you make sure that IPN is enabled?
Account -> My Profile -> Instant Payment Notification Preferences
Secondly I would check the IPN History
Account -> History -> IPN History
This will allow you to see the status and re-send it if need be.
I am assuming you are using the sandbox to test this out first.

As of 2013-06-20, if you have a Business account, to enable IPN messages:
(Log into PayPal) > Profile > My Selling Tools > Getting paid and managing my risk / Instant payment notifications / Update > Choose IPN Settings > (o) Receive IPN messages (Enabled) > Save
*Note: you can leave "Notification URL" blank if you provide a "notify_url" field in your payment form / button code.

Related

Why would paypal notification URL different

Okay, so we have a member site using Joomla, and a component that allows users to perform certain tasks (creating teams). They are allowed to login, and create a team, but they can't add members to this team until they pay a $25.00 fee.
This happens through Paypal IPN. There is essentially this form below... (some personal data removed).
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="<?php echo $item_name;?>">
<input type="hidden" name="business" value="blah#blah.com">
<input type="hidden" name="amount" value="25">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="no_note" value="1">
<!--<input name="userId" value="<?php //echo $user->id;?>" type="hidden">-->
<!--<input name="task" value="paypal_register" type="hidden">-->
<input type="hidden" name="currency_code" value="USD">
<!-- Enable override of buyers's address stored with PayPal . -->
<!-- Set variables that override the address stored with PayPal. -->
<input type="hidden" name="return" value="<?php echo JURI::ROOT().'index.php?option=com_fastball&view=payment&task=paypal_register';?>">
<input type="hidden" name="notify_url" value="<?php echo JURI::ROOT().'index.php?option=com_fastball&view=payment&task=paypal_register&userId='.$user->id.'&ipn=1';?>">
<!--<input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">-->
</form>
Now sometimes the IPN redirects and works just fine. But other times it cuts the url short from "index.php?option=com_fastball&view=payment&task=paypal_register&userId=" to "index.php?option=com_fastball", therefore not activating the view in Joomla that contains the code to update the database on notification.
It seems fairly random. There are several scenarios, 1 - New User Creating New Team. 2 - Old User Creating New Team. 3- Old User Renewing Old Team.
But regardless of that, they ALL hit this payment form button with THESE notify URL as hidden input.
So I'm not sure where paypal is either A.) Getting the shortened URL, or B.) They are cutting it short for some reason. It returns to the shortened URL with all of the Paypal Post info showing in the URL Parameters (&st=Completed&amt=25.00 etc from paypals servers)
This has been extremely frustrating and I may not have explained it well so if you have any questions or thoughts, just let me know. Thanks!
For URL paths you should use JURI::base() not JURI::ROOT. You can check the documentation here https://docs.joomla.org/Constants.
This appears to be a recent PayPal problem. All the urls (return, cancel_return, and notify_url) PayPal is stripping the url of all content after the first '&'.
Note also that the issue appears to be intermittent; it may be dependent on the PayPal server you connect to (QueryString values removed from the IPN endpoint by PayPal).
I have made some modifications to my own PayPal form replacing just the '&' with '&' (the encoded version) and that seems to work.

Paypal not accepting payments on mobile device with credit card

When I use Paypal for checkout on my website, Paypal is showing checkout without Paypal account on Desktop but not on a mobile device.
Do you know could be the reason for this?
This is the form I use to redirect a user to the Paypal checkout page:
<form action="https://www.paypal.com/cgi-bin/webscr" name="paypalForm" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="#######gmail.com">
<input type="hidden" name="item_name_1" value="Product X">
<input type="hidden" name="amount_1" value="<?php echo $price; ?>">
<input type="hidden" name="custom" value="<?php echo $orderKey; ?>">
<input type="hidden" name="SolutionType" value="sole">
</form>
The form is being submitted by JS.
Thanks in advance!
using PayPal standard buttons, or ExpressCheckout, in some instances buyers will be able to pay with a debit/credit card and in some others they will only be able to open an account.
This can depend on many factors such as cookies, mobile/web, time of the day, and many other internal security variables which makes it impossible to predict. You could try to use the variable: solution_type = SOLE, it will give more chances to show the pay with card option but is not guaranteed.
If you wish to process card payments and you have a UK, USA or Canadian account you can think at PayPal Pro:
- for US / Canada, PayPal Payments Pro (https://www.paypal.com/webapps/mpp/paypal-payments-pro)
- for UK, PayPal Website Payments Pro (https://www.paypal.com/uk/webapps/mpp/pro)

Integrating PayPal Sandbox to Your Web Application

I have a web application and I want to integrate the PayPal Sandox to it.
What are the steps to do so?
Since PayPal's integration guides can be unclear for beginners and other online tutorials can be too long for a simple checkout implementation, this Q&A aims to integrate the PayPal Sandbox to your web application quickly and easily. No external libraries or other downloads required.
STEP 1: Create a PayPal Sandbox Account. Follow this guide for test account creation.
STEP 2: Copy below sample HTML code for a basic Buy Now button (Single-Item Payment only):
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="payments#yourbusiness.com">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="Your Product">
<input type="hidden" name="amount" value="25.00">
<input type="hidden" name="currency_code" value="USD">
<!-- Specify checkout options. -->
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://www.yoursite.com/paymentsuccessful.hmtl">
<input type="hidden" name="cancel_return" value="http://www.yoursite.com/paymentcancelled.hmtl">
<!-- Display the payment button. -->
<input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif">
</form>
form action - value is https://www.sandbox.paypal.com/cgi-bin/webscr, removing "sandbox"
means you are using the live PayPal website
business - does not have to be a real email, text displayed at the upper-left portion of the PayPal checkout page
cmd - _xclick means the button clicked was a Buy Now button
item_name - name of your product
amount - price of your product
currency_code - read here for supported values
no_note - do not prompt buyers to include a note with their payments (0 - false, 1 - true)
no_shipping - do not prompt buyers for a shipping address (0 - prompt but not required, 1 - do not prompt, 2 - prompt and require)
return - URL to which PayPal redirects the buyer's browser after they complete their payment
cancel_return - URL to which PayPal redirects the buyer's browser if they cancel checkout before completing their payment
Output:
References:
Testing Classic API Calls (recommended reading)
Single-Item Payments – Buy Now Buttons (more options available)
HTML Variables for Displaying PayPal Checkout Pages (more options available)

Paypal - Dynamic Buy button to charge our clients customer

I need to implement a method where we can allow a clients customer to make a payment to the client via our website - all of which will be setup via our custom CMS.
Our initial plan was to use the following form script to generate a transaction and ask the client to add a return address to our website.
<form name="_xclick" action="https://www.paypal.com/uk/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="someone#someon.com">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="item_name" value="2 x sessions">
<input type="hidden" name="amount" value="50">
<input type="image" class="btn btn-default nom paypalBtn" src="" border="0" name="submit" alt="£50">
</form>
This would potentially work fine - as we could dynamically add the value, business email and item name. Though we are worried that any web savvy person could simply inspect the form in a browser and change the payment value to a more pleasing figure! So we feel we need a better solution.
Does anyone have any suggestions for a cleaner solution?
Log into your PayPal account, click on Merchant Services at the top of the page and then click one Create Payment Buttons for your website. When you create buttons on PayPal they are hosted and secure.

PayPal buynow button setting issue

I am trying to test my PayPal "buy now" button. It goes to sandbox page successfully and I do payment from my developer account. Problem is that my that payment do not go to my developer business account after paying with my developer personal account.
Here is my code:
<form name="_xclick" action="https://www.sandbox.paypal.com/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="my-developer-business-id#gmail.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="test product">
<input type="hidden" name="return" value="some return url">
<input type="hidden" name="amount" value="1">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
Please also tell me how can I make shipping option off... I don't need any shipping option here.
You can try creating button from sandbox account's website.
Steps to create PayPal button:
Login to your seller's test account in sandbox.
Click on 'Merchant Services' tab.
There you will find Create PayPal payment button
Fill out the form as per your requirement.
This will generate a HTML script.
Create a HTML file and copy paste this HTML script. Open the HTML file, You will get a Paypal Button.
Click it and accept transaction by buyers PayPal account.