Paypal

'.$this->l('Opening your PayPal account').'

'.$this->l('By opening your PayPal account by clicking on the following image you are helping us significantly to improve the PrestaShop software:').'

PrestaShop & PayPal

'.$this->l('This module allows you to accept payments by PayPal.').'

'.$this->l('If the client chooses this payment mode, your PayPal account will be automatically credited.').'
'.$this->l('You need to configure your PayPal account first before using this module.').'
 
'; // process if (isset($_POST['submitPaypalSettings']) OR isset($_POST['submitPaypalAPI'])) { $errors = $this->_checkValues(); if (!sizeof($errors)) { $this->_updateValues(); $html .= '
'.$this->l('Settings updated').'
'; } else $html .= $this->_displayErrors($errors); } // form $html .= $this->_displayFormSettings(); return $html; } private function _checkValues() { $errors = array(); if (isset($_POST['submitPaypalSettings'])) { if (!isset($_POST['sandbox'])) $_POST['sandbox'] = 1; if (!isset($_POST['expressCheckout'])) $_POST['expressCheckout'] = 0; if (!$this->_expressCheckout AND intval($_POST['expressCheckout'])) if (!$this->registerHook('shoppingCartExtra')) { $errors[] = $this->l('Cannot register module to validCart hook, ExpressCheckout not enabled'); $_POST['expressCheckout'] = 0; } if ($this->_expressCheckout AND !intval($_POST['expressCheckout'])) if (!$this->unregisterHook(Hook::get('shoppingCartExtra'))) { $errors[] = $this->l('Cannot unregister module to validCart hook, ExpressCheckout not disabled'); $_POST['expressCheckout'] = 1; } } elseif (isset($_POST['submitPaypalAPI'])) { if (!isset($_POST['apiUser']) OR !$_POST['apiUser']) $errors[] = $this->l('You need to configure your PayPal API username'); if (!isset($_POST['apiPassword']) OR !$_POST['apiPassword']) $errors[] = $this->l('You need to configure your PayPal API password'); if (!isset($_POST['apiSignature']) OR !$_POST['apiSignature']) $errors[] = $this->l('You need to configure your PayPal API signature'); } return $errors; } private function _updateValues() { if (isset($_POST['submitPaypalSettings'])) { Configuration::updateValue('PAYPAL_HEADER', strval($_POST['header'])); Configuration::updateValue('PAYPAL_SANDBOX', intval($_POST['sandbox'])); Configuration::updateValue('PAYPAL_EXPRESS_CHECKOUT', intval($_POST['expressCheckout'])); Configuration::updateValue('PAYPAL_INTEGRAL', intval($_POST['pp_integral'])); } elseif (isset($_POST['submitPaypalAPI'])) { Configuration::updateValue('PAYPAL_API_USER', strval($_POST['apiUser'])); Configuration::updateValue('PAYPAL_API_PASSWORD', strval($_POST['apiPassword'])); Configuration::updateValue('PAYPAL_API_SIGNATURE', strval($_POST['apiSignature'])); } } private function _displayErrors($errors) { $nbErrors = sizeof($errors); $html = '

'.($nbErrors > 1 ? $this->l('There are') : $this->l('There is')).' '.$nbErrors.' '.($nbErrors > 1 ? $this->l('errors') : $this->l('error')).'

    '; foreach ($errors AS $error) $html .= '
  1. '.$error.'
  2. '; $html .= '
'; return $html; } private function _displayFormSettings() { $header = isset($_POST['header']) ? strval($_POST['header']) : $this->_header; $sandbox = isset($_POST['sandbox']) ? intval($_POST['sandbox']) : $this->_sandbox; $apiUser = isset($_POST['apiUser']) ? strval($_POST['apiUser']) : $this->_apiUser; $apiPassword = isset($_POST['apiPassword']) ? strval($_POST['apiPassword']) : $this->_apiPassword; $apiSignature = isset($_POST['apiSignature']) ? strval($_POST['apiSignature']) : $this->_apiSignature; $expressCheckout = isset($_POST['expressCheckout']) ? intval($_POST['expressCheckout']) : $this->_expressCheckout; $pp_integral = isset($_POST['pp_integral']) ? intval($_POST['pp_integral']) : $this->_pp_integral; $html= '
'.$this->l('Server Information').' '.$this->l('Prior to the use of the PayPal module, please check if Curl or openSSL are activated on your server').'.

'.$this->l('Without SSL, PayPalAPI module will not be able to contact PayPal').'.
'.$this->l('General settings').'
'.$this->l('Yes').' '.$this->l('No').'

'.$this->l('When you active this option, PayPal run on mode test.').'

'.$this->l('Activate payments credit cards (CB, Visa, Mastercard) and private cards (Amex, Aurore, Cofinoga, 4 stars), and with PayPal account').'
'.$this->l('Activate payments with PayPal account').'
'.$this->l('Yes').' '.$this->l('No').'

'.$this->l('Payment with PayPal account in just two clicks (button from the PayPal shopping cart)').'

'.$this->l('The image should be host on a secure (https) server. Max: 750x90px.').'

'.$this->l('API settings:').'


'.$this->l('API settings').' '.$this->l('Follow these steps in order to obtain your API authentication information by using an API signature as the authentication mechanism. If you are testing with a virtual account, repeat these steps both on the virtual account and on the real account at the same time. We recommend that you open a separate Web browser session when carrying out this procedure.').'

'.$this->l('1. Log in to your PayPal Premier or Business account.').'

'.$this->l('2. Click the Profile subtab located under the My Account heading.').'

'.$this->l('3. Click the API Access link under the Account Information header.').'

'.$this->l('4. Click the View API Certificate link in the right column.').'

'.$this->l('5. Click the Request API signature radio button on the Request API Credentials page.').'

'.$this->l('6. Complete the Request API Credential Request form by clicking the agreement checkbox and clicking Submit.').'

'.$this->l('7. Save the values for API Username, Password and Signature (make sure this long character signature is copied).').'

'.$this->l('8. Click the Done button after copying your API Username, Password, and Signature.').'

'.$this->l('9. This will take you back to the API Access screen where you are finished.').'

'; return $html; } }