php - PayPal IPN Listener -- Sending Response w/ CURL -
i'm trying setup paypal ipn listener curl. i'm receiving post data paypal fine, i'm stuck when sending response back.
this test i'm trying send paypal, looking expected "verified" or "invalid" response.
$string = 'cmd=_notify-validate&test_ipn=1&payment_type=instant&payment_date=13%3a49%3a46+dec+01%2c+2010+pst&payment_status=completed&address_status=confirmed&payer_status=verified&first_name=john&last_name=smith&payer_email=buyer%40paypalsandbox.com&payer_id=testbuyerid01&address_name=john+smith&address_country=united+states&address_country_code=us&address_zip=95131&address_state=ca&address_city=san+jose&address_street=123%2c+any+street&business=seller%40paypalsandbox.com&receiver_email=seller%40paypalsandbox.com&receiver_id=testsellerid1&residence_country=us&item_name=something&item_number=ak-1234&quantity=1&shipping=3.04&tax=2.02&mc_currency=usd&mc_fee=0.44&mc_gross=12.34&mc_gross_1=9.34&txn_type=web_accept&txn_id=461212149¬ify_version=2.1&custom=xyz123&charset=windows-1252&verify_sign=ahaxyf3zadtb0y4mvemg3l5zjpqnaelzcxu6rvpq5jsgr30fgg6oehkn'; $endpoint = 'https://www.sandbox.paypal.com/'; $ch = curl_init(); curl_setopt($ch, curlopt_url, $endpoint); curl_setopt($ch, curlopt_header, true); curl_setopt($ch, curlopt_ssl_verifyhost, false); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $string); curl_setopt($ch, curlopt_followlocation, false); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_timeout, 30); $result = curl_exec($ch); curl_close($ch); echo $result;
i'm using sandbox ipn testing simulator send ipn signals listener. i'm sending responses https://www.sandbox.paypal.com/.
i response paypal no matter data send it:
http/1.1 301 moved permanently date: wed, 01 dec 2010 23:34:30 gmt server: apache set-cookie: c9mwduvptt9gimypc3jwol1vslo=%7cpwtfdnvwz1wvsa34w2f4fnut4lxzcfsynqbmxeb4n-dlvewn-dbmdx86ymrj6lgqydfdgw%7cgedqsysrrwp1dzzkq9pff2j5zblu0nortds4-uxc_ygn8btbwsbf1d6vq-77_078yszerg%7c; domain=.paypal.com; path=/ set-cookie: -1ilhdyicors4hs4xtur41s8ip0=ch14qdwdhwms_kbbh2se-6ag-wkvoqqypwtsichmel1gu49_4mcpll14axd3kvyvqsmhfipzkd-ekiwm; expires=tue, 26-nov-2030 23:34:31 gmt; domain=.paypal.com; path=/ set-cookie: cookie_check=yes; expires=sat, 28-nov-2020 23:34:31 gmt; domain=.paypal.com; path=/ set-cookie: apache=10.191.196.11.135781291246470532; path=/; expires=tue, 18-oct-04 17:06:14 gmt location: https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_home&country_lang.x=true cneonction: close transfer-encoding: chunked content-type: text/plain; charset=iso-8859-1
it makes me think i'm plain posting wrong url, that's url i'm supposed use.
sandbox url paypal is:
https://www.sandbox.paypal.com/cgi-bin/webscr
Comments
Post a Comment