/** * Initialize the PayPal/PayflowPro object for communication to the processing gateways */ function paypal_init() { if (!defined('MODULE_PAYMENT_PAYPALWPP_STATUS') || !defined('MODULE_PAYMENT_PAYPALWPP_SERVER')) { $doPayPal = new paypal_curl(array('mode' => 'NOTCONFIGURED')); return $doPayPal; } $ec_uses_gateway = defined('MODULE_PAYMENT_PAYPALWPP_PRO20_EC_METHOD') && MODULE_PAYMENT_PAYPALWPP_PRO20_EC_METHOD == 'Payflow' ? true : false; if (substr(MODULE_PAYMENT_PAYPALWPP_MODULE_MODE, 0, 7) == 'Payflow') { $doPayPal = new paypal_curl(array('mode' => 'payflow', 'user' => trim(MODULE_PAYMENT_PAYPALWPP_PFUSER), 'vendor' => trim(MODULE_PAYMENT_PAYPALWPP_PFVENDOR), 'partner' => trim(MODULE_PAYMENT_PAYPALWPP_PFPARTNER), 'pwd' => trim(MODULE_PAYMENT_PAYPALWPP_PFPASSWORD), 'server' => MODULE_PAYMENT_PAYPALWPP_SERVER)); $doPayPal->_endpoints = array('live' => 'https://payflowpro.paypal.com/transaction', 'sandbox' => 'https://pilot-payflowpro.paypal.com/transaction'); } else { $doPayPal = new paypal_curl(array('mode' => 'nvp', 'user' => trim(MODULE_PAYMENT_PAYPALWPP_APIUSERNAME), 'pwd' => trim(MODULE_PAYMENT_PAYPALWPP_APIPASSWORD), 'signature' => trim(MODULE_PAYMENT_PAYPALWPP_APISIGNATURE), 'version' => '60.0', 'server' => MODULE_PAYMENT_PAYPALWPP_SERVER)); $doPayPal->_endpoints = array('live' => 'https://api-3t.paypal.com/nvp', 'sandbox' => 'https://api.sandbox.paypal.com/nvp'); } // set logging options $doPayPal->_logDir = $this->_logDir; // $doPayPal->_logLevel = $this->_logLevel; // set proxy options if configured if (CURL_PROXY_REQUIRED == 'True' && CURL_PROXY_SERVER_DETAILS != '') { $proxy_tunnel_flag = defined('CURL_PROXY_TUNNEL_FLAG') && strtoupper(CURL_PROXY_TUNNEL_FLAG) == 'FALSE' ? false : true; $doPayPal->setCurlOption(CURLOPT_HTTPPROXYTUNNEL, $proxy_tunnel_flag); $doPayPal->setCurlOption(CURLOPT_PROXYTYPE, CURLPROXY_HTTP); $doPayPal->setCurlOption(CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS); } // transaction processing mode $doPayPal->_trxtype = in_array(MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE, array('Auth Only', 'Order')) ? 'A' : 'S'; return $doPayPal; }
/** * Initialize the PayPal/PayflowPro object for communication to the processing gateways */ function paypal_init() { $ec_uses_gateway = defined('MODULE_PAYMENT_PAYPALWPP_PRO20_EC_METHOD') && MODULE_PAYMENT_PAYPALWPP_PRO20_EC_METHOD == 'Payflow' ? true : false; $nvp = !$ec_uses_gateway && MODULE_PAYMENT_PAYPALWPP_APIPASSWORD != '' && MODULE_PAYMENT_PAYPALWPP_APISIGNATURE != '' ? true : false; $ec = $nvp && ($this->in_special_checkout() || $_GET['type'] == 'ec') ? true : false; if (substr(MODULE_PAYMENT_PAYPALWPP_MODULE_MODE, 0, 7) == 'Payflow') { $doPayPal = new paypal_curl(array('mode' => 'payflow', 'user' => trim(MODULE_PAYMENT_PAYPALWPP_PFUSER), 'vendor' => trim(MODULE_PAYMENT_PAYPALWPP_PFVENDOR), 'partner' => trim(MODULE_PAYMENT_PAYPALWPP_PFPARTNER), 'pwd' => trim(MODULE_PAYMENT_PAYPALWPP_PFPASSWORD), 'server' => MODULE_PAYMENT_PAYPALWPP_SERVER)); $doPayPal->_endpoints = array('live' => 'https://payflowpro.verisign.com/transaction', 'sandbox' => 'https://pilot-payflowpro.verisign.com/transaction'); } else { $doPayPal = new paypal_curl(array('mode' => 'nvp', 'user' => trim(MODULE_PAYMENT_PAYPALWPP_APIUSERNAME), 'pwd' => trim(MODULE_PAYMENT_PAYPALWPP_APIPASSWORD), 'signature' => trim(MODULE_PAYMENT_PAYPALWPP_APISIGNATURE), 'version' => '3.2', 'server' => MODULE_PAYMENT_PAYPALWPP_SERVER)); $doPayPal->_endpoints = array('live' => 'https://api-3t.paypal.com/nvp', 'sandbox' => 'https://api.sandbox.paypal.com/nvp'); } // set logging options $doPayPal->_logDir = $this->_logDir; // $doPayPal->_logLevel = $this->_logLevel; // set proxy options if configured if (CURL_PROXY_REQUIRED == 'True' && CURL_PROXY_SERVER_DETAILS != '') { $proxy_tunnel_flag = defined('CURL_PROXY_TUNNEL_FLAG') && strtoupper(CURL_PROXY_TUNNEL_FLAG) == 'FALSE' ? false : true; $doPayPal->setCurlOption(CURLOPT_HTTPPROXYTUNNEL, $proxy_tunnel_flag); $doPayPal->setCurlOption(CURLOPT_PROXYTYPE, CURLPROXY_HTTP); $doPayPal->setCurlOption(CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS); } // transaction processing mode $doPayPal->_trxtype = in_array(MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE, array('Auth Only', 'Order')) ? 'A' : 'S'; // $this->zcLog('comm details', 'Comm Details: ' . "\n" . print_r($doPayPal, true) . "\n\n" . 'MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE = ' . MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE . "\ndoPayPal->_trxtype = " . $doPayPal->_trxtype . "\n"); return $doPayPal; }
/** * Initialize the PayPal/PayflowPro object for communication to the processing gateways */ function paypal_init() { $nvp = MODULE_PAYMENT_PAYPALWPP_APIPASSWORD != '' && MODULE_PAYMENT_PAYPALWPP_APISIGNATURE != '' ? true : false; $ec = $nvp && $_GET['type'] == 'ec' ? true : false; if (MODULE_PAYMENT_PAYPALDP_MERCHANT_COUNTRY == 'UK' && !$ec) { $doPayPal = new paypal_curl(array('mode' => 'payflow', 'user' => trim(MODULE_PAYMENT_PAYPALWPP_PFUSER), 'vendor' => trim(MODULE_PAYMENT_PAYPALWPP_PFVENDOR), 'partner' => trim(MODULE_PAYMENT_PAYPALWPP_PFPARTNER), 'pwd' => trim(MODULE_PAYMENT_PAYPALWPP_PFPASSWORD), 'server' => MODULE_PAYMENT_PAYPALDP_SERVER)); $doPayPal->_endpoints = array('live' => 'https://payflowpro.paypal.com/transaction', 'sandbox' => 'https://pilot-payflowpro.paypal.com/transaction'); } else { $doPayPal = new paypal_curl(array('mode' => 'nvp', 'user' => trim(MODULE_PAYMENT_PAYPALWPP_APIUSERNAME), 'pwd' => trim(MODULE_PAYMENT_PAYPALWPP_APIPASSWORD), 'signature' => trim(MODULE_PAYMENT_PAYPALWPP_APISIGNATURE), 'version' => '61.0', 'server' => MODULE_PAYMENT_PAYPALDP_SERVER)); $doPayPal->_endpoints = array('live' => 'https://api-3t.paypal.com/nvp', 'sandbox' => 'https://api.sandbox.paypal.com/nvp'); } // set logging options $doPayPal->_logDir = $this->_logDir; $doPayPal->_logLevel = $this->_logLevel; // set proxy options if configured if (CURL_PROXY_REQUIRED == 'True' && CURL_PROXY_SERVER_DETAILS != '') { $proxy_tunnel_flag = defined('CURL_PROXY_TUNNEL_FLAG') && strtoupper(CURL_PROXY_TUNNEL_FLAG) == 'FALSE' ? false : true; $doPayPal->setCurlOption(CURLOPT_HTTPPROXYTUNNEL, $proxy_tunnel_flag); $doPayPal->setCurlOption(CURLOPT_PROXYTYPE, CURLPROXY_HTTP); $doPayPal->setCurlOption(CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS); } // transaction processing mode $doPayPal->_trxtype = MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only' ? 'A' : 'S'; return $doPayPal; }