PHP PayPal IPN returns to INVALID, but payment_status=completed, this is why?

Source: Internet
Author: User
Tags vars
This is the log of the record:
[08/22/2012 9:53 PM]-FAIL:IPN Validation Failed.
IPN POST Vars from Paypal:

mc_gross=1.00, Protection_eligibility=eligible, address_status=confirmed, Payer_id=n9mj3e2f72rsa, tax=0.00, address _street=1 Main St, payment_date=21:53:35, PDT, **payment_status=completed**, charset=windows-1252, Address_ zip=95131, First_name=buyer, mc_fee=0.33, Address_country_code=us, Address_name=buyer buyer, notify_version=3.6, Custom=3ba049446d1a922fccf9233c32794f16, Payer_status=verified, business=775357_1345694569_biz@qq.com, Address_ country=united states, Address_city=san Jose, Quantity=1, verify_sign= aljkapms7h6rb6yov.fdcxcgta-tanen6te6sheqgyiyawzvu3tiry0a, payer_email=775357_1345694424_per@qq.com, txn_id= 60y885950a771745y, Payment_type=instant, Last_name=buyer, Address_state=ca, receiver_email=775357_1345694569_ Biz@qq.com, payment_fee=0.33, Receiver_id=bpfvtfg92jfy4, Txn_type=web_accept, Item_name=xxx, MC_CURRENCY=USD, item_ Number=, Residence_country=us, Test_ipn=1, handling_amount=0.00, transaction_subject= 3BA049446D1A922FCCF9233C32794F16, payment_gross=1.00, SHipping=0.00, ipn_track_id=f9305268979, **IPN Response from Paypal server:** http/1.1, Okdate:thu, 2012 04:53:40 Gmtserver:apachex-frame-options:sameoriginset-cookie:c9mwduvptt9gimypc3jwol1vslo=h9kumtssquu_ Tjf3dam9rchmds6guqfoum5-kc3ttphu199ytckvmnrqgslfy9uiofulbrxej6jtuilodz4imr-ruvjgsdh7rweuazpivo40f7nn8jxn1xvy2n-ak8kflmkue m%7csrcbifq6eg7qvukiu5gxgruznxvrhivr3asqzo7z4at6yvgs588djotxrox8tl_hj4qi30% 7cptkiybjfizge516dkd0-8zfnmtwvxf8viz_qkemzpizpz5iu9ocdyiqye8g861be04ket0%7c1345697620; domain=.paypal.com; path=/; Secure; Httponlyset-cookie:cookie_check=yes; Expires=sun, 21-aug-2022 04:53:40 GMT; domain=.paypal.com; path=/; Secure; Httponlyset-cookie:navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; httponlyset-cookie:navlns=0.0; expires=wed, 18-aug-2032 04:53:40 GMT; domain=.paypal.com; path=/; Secure; httponlyset-cookie:apache=10.72.109.11.1345697620182214; path=/; Expires=sat, 16-aug-42 04:53:40 Gmtconnection:closetransfer-encoding:chunkedcontent-type:text/html; Charset=utf-87**invalid**0

Reply content:

This is the log of the record:
[08/22/2012 9:53 PM]-FAIL:IPN Validation Failed.
IPN POST Vars from Paypal:

mc_gross=1.00, Protection_eligibility=eligible, address_status=confirmed, Payer_id=n9mj3e2f72rsa, tax=0.00, address _street=1 Main St, payment_date=21:53:35, PDT, **payment_status=completed**, charset=windows-1252, Address_ zip=95131, First_name=buyer, mc_fee=0.33, Address_country_code=us, Address_name=buyer buyer, notify_version=3.6, Custom=3ba049446d1a922fccf9233c32794f16, Payer_status=verified, business=775357_1345694569_biz@qq.com, Address_ country=united states, Address_city=san Jose, Quantity=1, verify_sign= aljkapms7h6rb6yov.fdcxcgta-tanen6te6sheqgyiyawzvu3tiry0a, payer_email=775357_1345694424_per@qq.com, txn_id= 60y885950a771745y, Payment_type=instant, Last_name=buyer, Address_state=ca, receiver_email=775357_1345694569_ Biz@qq.com, payment_fee=0.33, Receiver_id=bpfvtfg92jfy4, Txn_type=web_accept, Item_name=xxx, MC_CURRENCY=USD, item_ Number=, Residence_country=us, Test_ipn=1, handling_amount=0.00, transaction_subject= 3BA049446D1A922FCCF9233C32794F16, payment_gross=1.00, SHipping=0.00, ipn_track_id=f9305268979, **IPN Response from Paypal server:** http/1.1, Okdate:thu, 2012 04:53:40 Gmtserver:apachex-frame-options:sameoriginset-cookie:c9mwduvptt9gimypc3jwol1vslo=h9kumtssquu_ Tjf3dam9rchmds6guqfoum5-kc3ttphu199ytckvmnrqgslfy9uiofulbrxej6jtuilodz4imr-ruvjgsdh7rweuazpivo40f7nn8jxn1xvy2n-ak8kflmkue m%7csrcbifq6eg7qvukiu5gxgruznxvrhivr3asqzo7z4at6yvgs588djotxrox8tl_hj4qi30% 7cptkiybjfizge516dkd0-8zfnmtwvxf8viz_qkemzpizpz5iu9ocdyiqye8g861be04ket0%7c1345697620; domain=.paypal.com; path=/; Secure; Httponlyset-cookie:cookie_check=yes; Expires=sun, 21-aug-2022 04:53:40 GMT; domain=.paypal.com; path=/; Secure; Httponlyset-cookie:navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; httponlyset-cookie:navlns=0.0; expires=wed, 18-aug-2032 04:53:40 GMT; domain=.paypal.com; path=/; Secure; httponlyset-cookie:apache=10.72.109.11.1345697620182214; path=/; Expires=sat, 16-aug-42 04:53:40 Gmtconnection:closetransfer-encoding:chunkedcontent-type:text/html; Charset=utf-87**invalid**0

In fact, IPN is the recommended use, because it is asynchronous processing, you can avoid the network problems caused by the transaction status update failure and other conditions.

You receive invalid's response, the official inspection method is as follows:

    1. Check that your was posting your response to the correct URL, which is https://www.sandbox.paypal.com/cgi-bi ... or https:/ /WWW.PAYPAL.COM/CGI-BIN/WEBSCR depending on whether you is testing in the Sandbox or is live, respectively.
    2. Verify that your response contains exactly the same IPN variables and values in the same order, preceded with cmd=_notify- Validate.
    3. Ensure that is encoding your response string and is using the same character encoding as the original message.

Suddenly see your response inside, test_ipn=1, meaning you are used to test PayPal, but your response is actually received from PayPal.com, of course invalid. Change your receiving address to sandbox.paypal.com and try again.

IPN is not safe, it is recommended to use pdt~

Hello, how did you get this IPN? I've never been able to get it. Could you tell me, please? Very urgent, thank you!!

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.