if ($key != 'extra') { $req .= "&{$key}={$value}"; } } // Post back to PayPal to validate if (!$sandbox) { $curl = curl_init('https://www.paypal.com/cgi-bin/webscr'); } else { $curl = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr'); } curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $req); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_TIMEOUT, 30); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $res = curl_exec($curl); if (strcmp($res, 'VERIFIED') == 0) { Paypal::processStandardPayment(); if ($email_admin) { $emailtext = ''; foreach ($_REQUEST as $key => $value) { $emailtext .= $key . ' = ' . $value . '\\n\\n'; } mail(osc_contact_email(), 'OSCLASS PAYPAL DEBUG', $emailtext . '\\n\\n ---------------- \\n\\n' . $req); } } else { if (strcmp($res, 'INVALID') == 0) { // INVALID: Do nothing } }
public static function processPayment() { return Paypal::processStandardPayment(); }