PayPal IPN Return 'Note to Seller' Field - paypal

When paying in PayPal, there is an option to click the 'Add' button and add a 'Note to Seller'. I have tried various variables in the IPN response but I can't find that value anywhere. I have seen that you can post the value in the 'cn' variable but can't get it back.

The field you should be looking for is memo: https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/

Related

Paypal Buy Now IPN returning empty item_number in POST vars

The problem in short - Paypal is returning the POST var item_number but it is blank.
Details:
Customer hits Buy Now and is taken over to Paypal where the transaction is completed and then they are sent back to my site.
I use a notification url/page to update the database, but it relies on an item_number to trigger the proper code.
I know there was recently a change to item_number1 or item_number_1 that I've seen referenced in some other questions but I'm printing all POST vars to a temporary file (via php in the notification url) and all I see is item_number and it is blank.
Any advice would be greatly appreciated as I'm no Paypal expert and I've been banging my head against the wall trying to figure out why it's not sending me back a value. Some code snippets and useful stuff below...(note i've modified some of the values for security, but nothing else)
My "Buy Now" Link = https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MYBUTTONID&lc=US&page_style=primary&item_number=PayPerCard&invoice=00000000&custom=userName
Loop for printing POST vars
foreach ($_POST as $key => $value) {
$data.= $key.'='.$value.'\n';}
$data is just printed into a temp file every time a transaction is completed
$data =
transaction_subject=
payment_date=17:25:25 Oct 16, 2017 PDT
txn_type=web_accept
last_name=McDougal
receipt_id=0000-0000-0000-0000
residence_country=US
item_name=Buy & Send
payment_gross=1.50
mc_currency=USD
business=sales#mydomain.com
payment_type=instant
protection_eligibility=Ineligible
verify_sign=BIGLONGSTRING
payer_status=unverified
payer_email=customer#gmail.com
txn_id=BIGLONGSTRING
quantity=1
receiver_email=sales#mydomain.com
first_name=Sticky
invoice=00000000
payer_id=0000000000000
receiver_id=0000000000000
item_number=
payment_status=Completed
payment_fee=0.37
mc_fee=0.37
mc_gross=1.50
custom=userName
charset=windows-1252
notify_version=3.8
ipn_track_id=0000000000000
So of course after spending hours hunting and debugging and finally posting to stackoverflow, I figured out the problem ten minutes later and it was a super easy fix. Posting here on the off chance someone else can benefit.
SOLUTION : Not sure when it happened, but Paypal uses a field labeled as "Item ID" when you create a hosted button. This is the item_number and it must be set here, not in the Buy Now link as I previously had it.
image of PayPal fields
Setting that field to my desired item_number did the trick.

Passing php variables with Paypal buttons

I have a problem passing a variable to the Paypal button so that the IPN sent by Paypal can send the data in the variable back to me.
However, when I tested the button, I get the error 'Data does not match input character set or default encoding. For more information, please contact the merchant.'
Can anyone help?
This might be related to the encoding that you have set in your PayPal account for IPN and other things . You can try to change the encoding as "UTF-8" from your PayPal account . Visit the below url to change the encoding settings in your PayPal account .
https://www.sandbox.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-language-encoding
Once you visit the above url , click on the link which says "MOre Options "

Multiple option of payment on paypal

I did a button of 3 options for payment (Buy Now) on PayPal, and when I pasted the code on my website.
Everything looks ok until you click on Buy now, It's transfer to error code on PayPal.
This is the link for the website: http://compx.co.il/?page_id=43
The error code that I get is:
1.Can not process your request at this time. Return to CompX IT Services and try another option.
2. PayPal can not process this transaction because of a problem on the site of the seller. Contact the seller directly to resolve this issue.
Any suggestion?
Regards,
Dvir
It's probably a character set issue. The default character set doesn't recognize them so you can fix this problem by changing the text of your option values or by changing the "charset" you're posting to PayPal.
You can follow these steps to modify the character set within your PayPal account:
- Log into your PayPal account at https://www.paypal.com
- Click the Profile link
- Click the 'Language Encoding' link under the Selling Preferences column
- Click the gray 'More Options' button
- Choose the same encoding you are using for your data off your site
- Select 'Yes' for 'Do you want to use the same encoding for data sent from PayPal to you (e.g., IPN, downloadable logs, emails)?'
- Click 'Save'
You can also define the charset value in the button code to match the charact values you have set in your options.

Returning from PayPal to the page that called it

I am hoping someone can help me with the following. I have a Buy Now button on a child dialog. Buy Now button displays PayPal page correctly. Now I am trying to do I cannot find info on it. I would like PayPal to return to the child dialog with a variable that will indicate success (payment made) or failure (payment cancelled by buyer). Is this possible?
The flow works like this:
Member logs in to my site
Member makes purchase via paypal
Member is added to a raffle prize.
The child window (dialog) remains open as PayPal is opened in another page. Regardless of whether the payment is successful or cancelled/ failed I would like to return to the child window with a value indicating the result of the payment. If the result is a success then some code is performed. If not then nothing is done and the child window remains open.
Bruno
You need to add a return url input <INPUT TYPE="hidden" NAME="return" value="URLspecificToThisTransaction">, look here https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_formbasics under Setting The Return URL on Individual Transaction heading
You also need Instant Payment Notification – notify_url
Instant Payment Notification comprises three parts:
Someone pays you.
PayPal POSTs FORM variables to a URL you specify that runs a program to process the variables.
You validate the notification.
look here https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/ipnguide.pdf

Paypal custom field not propergating

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.