In rare cases I'm getting IPN notifications with the parameters renamed. For example, rather receiving a message containing the expected parameter:
option_name1=<my value here>
instead I receive a message with:
option_name1_1=<my value here>
And quite obviously my code does not look for a parameter with the extra _1 on the end.
Why does this happen and can I get PayPal to retry the IPN notification with the correct parameter name?
Thanks!
Thanks to #EJP - looks like PayPal is mistakenly treating the transaction like it is a shopping cart with multiple items.
I've added checks in my IPN handler code to deal with the extra fields with the _1 appended to them (even though I'd never expect them to be there).
Related
PayPal is ignoring the response to my instant update callback.
I'm on sandbox
I'm getting the callback
I'm returning the exact example result in the documentation
...and PayPal continues to show my default shipping fee
Here's what I return from the callback (the example response at the end of this page):
METHOD=CallbackResponse&OFFERINSURANCEOPTION=true&L_SHIPPINGOPTIONNAME0=UPS Next Day Air&L_SHIPPINGOPTIONAMOUNT0=20.00&L_TAXAMT0=2.20&L_INSURANCEAMOUNT0=1.51&L_SHIPPINGOPTIONISDEFAULT0=false&L_SHIPPINGOPTIONNAME1=UPS Express 2 Days&L_SHIPPINGOPTIONAMOUNT1=10.00&L_TAXAMT1=2.00&L_INSURANCEAMOUNT1=1.35&L_SHIPPINGOPTIONISDEFAULT1=true&L_SHIPPINGOPTIONNAME2=UPS Ground2 to 7 Days&L_SHIPPINGOPTIONAMOUNT2=9.99&L_TAXAMT2=1.99&L_INSURANCEAMOUNT2=1.28&L_SHIPPINGOPTIONISDEFAULT2=false
I've also tried a much simpler response with no change in effect:
L_SHIPPINGOPTIONAMOUNT0=20.00&OFFERINSURANCEOPTION=false&L_SHIPPINGOPTIONISDEFAULT0=true&L_SHIPPINGOPTIONNAME0=Standard+Domestic&METHOD=CallbackResponse
What could I possibly be doing wrong? I see the callback in my server log. This is baffling.
It seems like in the response from the above url one parameter is missing which is "L_SHIPPINGOPTIONLABEL0=somenamehere" .
Try updating your callback script to send the above variable also in the response to the PayPal and see if that works for you .
For everyone interested, here is the documentation of the "Callback Response Message". I was also searching for the documentation because of a missing parameter.
https://developer.paypal.com/docs/classic/api/merchant/Callback_API_Operation_NVP/
When I click the cancel link in PayPal and am redirected to my cancel_url, it is passed the following parameters (some values removed).
cmd=_flow&
myAllTextSubmitID=&
miniPager=&
currentSession=&
pageState=login&
currentDispatch=&
email_recovery=false&
password_recovery=false&
login_email=&
login_password=&
private_device_checkbox_flag=on&
SESSION=&
CONTEXT=&
cmd=_flow&
id=&
close_external_flow=false&
external_close_account_payment_flow=payment_flow&
cancel_return=&
auth=&
form_charset=UTF-8&
external_remember_me_read_cookie_ids=&
flow_name=xpt%2FCheckout%2Fwps%2FLogin&
fso=
Is there any way to verify that this is a legitimate cancelation similar to how IPN verify works?
None of this looks like PayPal data. It looks like you're passing that stuff to yourself in the cancel URL, or via your original form. In which case you can pass yourself a ticket that only you can generate and verify. There's no need from Paypal's point of view to provide a verification, as no transaction has occurred.
I program with PHP and I'm familiar with getting data from PayPal's IPN. I need to send custom data to ebay and get it back when payment is made. For example, if sold 1 Widget on ebay and that widget has a stock number of 12345A, I receive data back from PayPal. I get things like customer's name, address, item name, etc. But, unless I include that stock number in my title, I don't see any way to get that data back from PayPal. I don't want to use ebay's limited title space for including my stock numbers. I realize I could do it if I had another database to store ebay's item numbers and cross reference them with my stock numbers, but I don't want to do that.
I have noticed that when data comes back from PayPal after an ebay sale, it includes the custom variable and that variable has a large number in assigned to it. I have no idea what that is. I've also tried using ebay's custom label feature that's found in Turbo Lister and Selling Manager Pro. I was hoping that would be sent back in PayPal's custom variable, but no luck. Any ideas?
As you've discovered, it looks like it's some internal id number uniquely identifying each eBay order. You can probably forget about specifying a value for this field as it isn't documented anywhere.
The best solution to your problem is to use the eBay API. GetSingleItem will return information about an item given the item id.
The ItemSpecifics list will contain any item specific data that the seller has entered about the product. In my case, I added a custom field called SKU to the eBay item. Just add itemspecifics to your include selector. The call can be executed with a GET request:
http://open.api.ebay.com/shopping?callname=GetSingleItem&IncludeSelector=ItemSpecifics&appid=YOURAPPID=515&ItemID=ITEMIDOFINTEREST
What you get back will contain those custom fields you added to your item:
..
<ItemSpecifics>
<NameValueList>
<Name>MPN</Name>
<Value>MyPartModelA</Value>
</NameValueList>
<NameValueList>
<Name>SKU</Name>
<Value>123-456</Value>
</NameValueList>
</ItemSpecifics>
..
We use a BuyNow button standard with HTML variables (RM=2).
Sometimes, instead of receiving back the two variables, we get a 0 (zero) value. The customer pays, the payment is accepted, the customer and the merchant receive confirmation mails, but the system returns a zero value and the database can not be updated.
We discovered that this happens when the customer uses old browsers. For example Firefox 16.0.2 is one of the browsers that return a zero value.
Any idea to solve the problem?
There was an issue recently with Firefox, that when setting the rm=2 the data was getting returned as a GET instead of POST. This may be what you are seeing, I believe there was a discussion on this on “Mozilla Support Forum”. Firefox automatically submits the data as “GET” method instead of “POST” method. This may be because of FF security properties.
I have set up a sandbox for paypal with a buyer and a seller. I have created a button for a subscription and pasted the code into my website along with the custom hidden field with the value ofv 121. In the Optional Fields I added "custom=0" as just adding "custom" alone would not save.
I processed the payment and checked the returned post for the custom variable in the $_REQUEST() string and it was not their, how do I get at it. What I got was bellow:
http://www.socialise4fun.co.uk/success.php?auth=Cjr-longstring-OSBx...&form_charset=UTF-8
What do I do with it to get my data back.
I'm trying to pass through the user_id in the custom field that paypal says in many places you can.
You have to use IPN to receive this data. This data is not supposed to be available in the GET of the return URL.
Have a look at https://www.paypal.com/ipn/
In short: include <input type="hidden" name="notify_url" value="http://link-to-your-IPN-script"> in your PayPal button, and you'll receive a POST with this data once the transaction has gone through.