3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class PaypalExpress extends PaypalAPI { protected $_logs = array(); public function home($params) { global $smarty; return $this->display(__FILE__, 'shopping_cart.tpl'); } public function getAuthorisation() { global $cookie; // Getting cart informations $cart = new Cart(intval($cookie->id_cart)); if (!Validate::isLoadedObject($cart)) $this->_logs[] = $this->l('Not a valid cart'); $currency = new Currency(intval($cart->id_currency)); //оригинал // $currency = new Currency(2); if (!Validate::isLoadedObject($currency)) $this->_logs[] = $this->l('Not a valid currency'); if (sizeof($this->_logs)) return false; // Making request $returnURL = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/paypalapi/express/submit.php'; $cancelURL = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'order.php'; $paymentAmount = number_format(floatval($cart->getOrderTotal()), 2, '.', ''); //оригинал // $paymentAmount = number_format(floatval(Tools::convertPrice($cart->getOrderTotal(),$currency)), 2, '.', ''); $currencyCodeType = strval($currency->iso_code); $paymentType = 'Sale'; $request = '&Amt='.urlencode($paymentAmount).'&PAYMENTACTION='.urlencode($paymentType).'&ReturnUrl='.urlencode($returnURL).'&CANCELURL='.urlencode($cancelURL).'&CURRENCYCODE='.urlencode($currencyCodeType); if ($this->_header) $request .= '&HDRIMG='.urlencode($this->_header); //print_r($request);exit; // Calling PayPal API include(_PS_MODULE_DIR_.'paypalapi/api/PaypalLib.php'); $ppAPI = new PaypalLib(); $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'SetExpressCheckout', $request); $this->_logs = array_merge($this->_logs, $ppAPI->getLogs()); return $result; } public function getCustomerInfos() { global $cookie; // Making request $request = '&TOKEN='.urlencode(strval($cookie->paypal_token)); // Calling PayPal API include(_PS_MODULE_DIR_.'paypalapi/api/PaypalLib.php'); $ppAPI = new PaypalLib(); $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'GetExpressCheckoutDetails', $request); $this->_logs = array_merge($this->_logs, $ppAPI->getLogs()); return $result; } public function getLogs() { return $this->_logs; } }
based on cYnWU
Output for 7.0.0 - 7.2.0
Fatal error: Class 'PaypalAPI' not found in /in/cDG1P on line 3
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Class 'PaypalAPI' not found in /in/cDG1P on line 4
Process exited with code 255.