Jump to content

Search the Community

Showing results for tags 'unknown ssl'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I successfully implemented paypal ipn on my website, I tested it on the paypal sandbox and everything worked. Then I changed the url from https://www.sandbox..../cgi-bin/webscr to https://www.paypal.com/cgi-bin/webscr. This should be standard procedure and everything should work fine. Once again, when using the sandbox provided by paypal, there are no problems. Now a few of my customers tried to buy things and nobody got there items. In my database I log everything and I logged this error: http error=Unknown SSL protocol error in connection to www.paypal.com:443 I use paypal ipn for the payment, underneath will be the ipn.php (ipn call back script that paypal will post variables to when a payment has been done) //Original source: https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt //Modified sample code by Codex-m: http://www.php-developer.org //WORKING DEMO HERE: http://www.php-developer.org/paypal_ipn_demo/ //Use your Paypal Sandbox buyer account to test. $req = 'cmd=' . urlencode('_notify-validate'); foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } //NEW CODE: using Curl instead of fsockopen $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://www.paypal.com/cgi-bin/webscr'); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POSTFIELDS, $req); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1); //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.sandbox.paypal.com')); $res = curl_exec($ch); //assign posted variables to PHP variables $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $account=$_POST['custom']; $productname=$_POST['item_name']; $txn_type=$_POST['txn_type']; $trans_id=$_POST['transaction[0].id']; $trans_id_2=$_POST['transaction[0].id_for_sender']; //Check if any error occured if(curl_errno($ch)) { //HTTP ERROR occurred //Log error to database for troubleshooting $log='http error='.curl_error($ch); //Here the error message gets build db_write($log); //Here it gets written to the database } else { //NO HTTP ERROR OCCURRED, CLEAN //CHECK IF VERIFIED if (strcmp ($res, "VERIFIED") == 0) { I hope somebody knows what the problem is. Additional information about my webserver: ###### ApacheFriends XAMPP version 1.7.1 ###### + Apache 2.2.11 + MySQL 5.1.33 (Community Server) + PHP 5.2.9 + PEAR (Support for PHP 4 has been discontinued) + XAMPP Control Version 2.5 from www.nat32.com + XAMPP CLI Bundle 1.3 from Carsten Wiedmann + XAMPP Security 1.0 + SQLite 2.8.15 + OpenSSL 0.9.8i + phpMyAdmin 3.1.3.1 + ADOdb 5.06a + Mercury Mail Transport System v4.62 + FileZilla FTP Server 0.9.31 + Webalizer 2.01-10 + Zend Optimizer 3.3.0 + eAccelerator 0.9.5.3 for PHP 5.2.9 (but not activated in the php.ini)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.