text/x-generic paypal_curl.php
PHP script text
Code:
<?php
/**
* paypal_curl.php communications class for PayPal Express Checkout / Website Payments Pro / Payflow Pro payment methods
*
* @package paymentMethod
* @copyright Copyright 2003-2014 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: DrByte Sat Nov 2 12:51:04 2013 -0400 Modified in v1.5.3 $
*/
/**
* PayPal NVP (v61) and Payflow Pro (v4 HTTP API) implementation via cURL.
*/
class paypal_curl extends base {
/**
* What level should we log at? Valid levels are:
* 1 - Log only severe errors.
* 2 - Date/time of operation, operation name, elapsed time, success or failure indication.
* 3 - Full text of requests and responses and other debugging messages.
*
* @access protected
*
* @var integer $_logLevel
*/
var $_logLevel = 3;
/**
* If we're logging, what directory should we create log files in?
* Note that a log name coincides with a symlink, logging will
* *not* be done to avoid security problems. File names are
* <DateStamp>.PayflowPro.log.
*
* @access protected
*
* @var string $_logFile
*/
var $_logDir = DIR_FS_LOGS;
/**
* Debug or production?
*/
var $_server = 'sandbox';
/**
* URL endpoints -- defaults here are for three-token NVP implementation
*/
var $_endpoints = array('live' => 'https://api-3t.paypal.com/nvp',
'sandbox' => 'https://api-3t.sandbox.paypal.com/nvp');
/**
* Options for cURL. Defaults to preferred (constant) options.
*/
var $_curlOptions = array(CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_TIMEOUT => 45,
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_FOLLOWLOCATION => FALSE,
//CURLOPT_SSL_VERIFYPEER => FALSE, // Leave this line commented out! This should never be set to FALSE on a live site!
//CURLOPT_CAINFO => '/local/path/to/cacert.pem', // for offline testing, this file can be obtained from http://curl.haxx.se/docs/caextract.html ... should never be used in production!
CURLOPT_SSLVERSION => 3,
CURLOPT_FORBID_REUSE => TRUE,
CURLOPT_FRESH_CONNECT => TRUE,
CURLOPT_POST => TRUE,
);
...
Bookmarks