本文整理汇总了PHP中PaymentModule::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP PaymentModule::__construct方法的具体用法?PHP PaymentModule::__construct怎么用?PHP PaymentModule::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PaymentModule
的用法示例。
在下文中一共展示了PaymentModule::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->name = 'paypal';
$this->tab = 'payments_gateways';
$this->version = '2.4';
$this->currencies = true;
$this->currencies_mode = 'radio';
parent::__construct();
$this->_errors = array();
$this->page = basename(__FILE__, '.php');
$this->displayName = $this->l('PayPal');
$this->description = $this->l('Accepts payments by credit cards (CB, Visa, MasterCard, Amex, Aurore, Cofinoga, 4 stars) with PayPal.');
$this->confirmUninstall = $this->l('Are you sure you want to delete your details?');
if (Configuration::get('PAYPAL_BUSINESS') == 'paypal@prestashop.com') {
$this->warning = $this->l('You are currently using the default PayPal e-mail address, please enter your own e-mail address.');
}
$this->_checkAndUpdateFromOldVersion();
if (file_exists(_PS_ROOT_DIR_ . '/modules/paypalapi/paypalapi.php') and $this->active) {
$this->warning = $this->l('All features of Paypal API module are be include in the new Paypal module. In order to don\'t have any conflict, please don\'t use and remove PayPalAPI module.');
}
global $cookie;
/*$context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
$content = @file_get_contents('https://www.prestashop.com/partner/preactivation/preactivation-warnings.php?version=1.0&partner=paypal&iso_country='.Tools::strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))).'&iso_lang='.Tools::strtolower(Language::getIsoById(intval($cookie->id_lang))).'&id_lang='.(int)$cookie->id_lang.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $context);
$content = explode('|', $content);
if ($content[0] == 'OK')
{
if (!empty($this->warning))
$this->warning .= ', ';
$this->warning .= $content[1];
}*/
}
示例2: __construct
public function __construct()
{
$this->name = 'authorizeaim';
$this->tab = 'payments_gateways';
$this->version = '1.4.3';
$this->author = 'PrestaShop';
$this->need_instance = 0;
parent::__construct();
$this->displayName = 'Authorize.net AIM (Advanced Integration Method)';
$this->description = $this->l('Receive payment with Authorize.net');
/* For 1.4.3 and less compatibility */
$updateConfig = array('PS_OS_CHEQUE' => 1, 'PS_OS_PAYMENT' => 2, 'PS_OS_PREPARATION' => 3, 'PS_OS_SHIPPING' => 4, 'PS_OS_DELIVERED' => 5, 'PS_OS_CANCELED' => 6, 'PS_OS_REFUND' => 7, 'PS_OS_ERROR' => 8, 'PS_OS_OUTOFSTOCK' => 9, 'PS_OS_BANKWIRE' => 10, 'PS_OS_PAYPAL' => 11, 'PS_OS_WS_PAYMENT' => 12);
foreach ($updateConfig as $u => $v) {
if (!Configuration::get($u) || (int) Configuration::get($u) < 1) {
if (defined('_' . $u . '_') && (int) constant('_' . $u . '_') > 0) {
Configuration::updateValue($u, constant('_' . $u . '_'));
} else {
Configuration::updateValue($u, $v);
}
}
}
/* Check if cURL is enabled */
if (!is_callable('curl_exec')) {
$this->warning = $this->l('cURL extension must be enabled on your server to use this module.');
}
/* Backward compatibility */
require _PS_MODULE_DIR_ . $this->name . '/backward_compatibility/backward.php';
}
示例3: __construct
public function __construct()
{
$this->name = 'cheque';
$this->tab = 'payments_gateways';
$this->version = '2.3';
$this->author = 'PrestaShop';
$this->currencies = true;
$this->currencies_mode = 'checkbox';
$config = Configuration::getMultiple(array('CHEQUE_NAME', 'CHEQUE_ADDRESS'));
if (isset($config['CHEQUE_NAME'])) {
$this->chequeName = $config['CHEQUE_NAME'];
}
if (isset($config['CHEQUE_ADDRESS'])) {
$this->address = $config['CHEQUE_ADDRESS'];
}
parent::__construct();
$this->displayName = $this->l('Check');
$this->description = $this->l('Module for accepting payments by check.');
$this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
if ($this->active && (!isset($this->chequeName) || !isset($this->address) || empty($this->chequeName) || empty($this->address))) {
$this->warning = $this->l('\'To the order of\' and address must be configured in order to use this module correctly.');
}
if ($this->active && !count(Currency::checkPaymentCurrencies($this->id))) {
$this->warning = $this->l('No currency set for this module');
}
$this->extra_mail_vars = array('{cheque_name}' => Configuration::get('CHEQUE_NAME'), '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'), '{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS')));
}
示例4: __construct
public function __construct()
{
$this->name = 'bankwire';
$this->tab = 'payments_gateways';
$this->version = '0.5';
$this->author = 'PrestaShop';
$this->currencies = true;
$this->currencies_mode = 'checkbox';
$config = Configuration::getMultiple(array('BANK_WIRE_DETAILS', 'BANK_WIRE_OWNER', 'BANK_WIRE_ADDRESS'));
if (isset($config['BANK_WIRE_OWNER'])) {
$this->owner = $config['BANK_WIRE_OWNER'];
}
if (isset($config['BANK_WIRE_DETAILS'])) {
$this->details = $config['BANK_WIRE_DETAILS'];
}
if (isset($config['BANK_WIRE_ADDRESS'])) {
$this->address = $config['BANK_WIRE_ADDRESS'];
}
parent::__construct();
$this->displayName = $this->l('Bank Wire');
$this->description = $this->l('Accept payments by bank wire.');
$this->confirmUninstall = $this->l('Are you sure you want to delete your details?');
if (!isset($this->owner) || !isset($this->details) || !isset($this->address)) {
$this->warning = $this->l('Account owner and details must be configured in order to use this module correctly.');
}
if (!count(Currency::checkPaymentCurrencies($this->id))) {
$this->warning = $this->l('No currency set for this module');
}
$this->extra_mail_vars = array('{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')));
}
示例5: __construct
public function __construct()
{
$this->name = 'gcheckout';
$this->tab = 'payments_gateways';
$this->version = '1.2';
$this->author = 'PrestaShop';
$this->currencies = true;
$this->currencies_mode = 'radio';
parent::__construct();
$this->displayName = $this->l('Google Checkout');
$this->description = $this->l('Google Checkout API implementation');
if (!sizeof(Currency::checkPaymentCurrencies($this->id))) {
$this->warning = $this->l('No currency set for this module');
}
/* For 1.4.3 and less compatibility */
$updateConfig = array('PS_OS_CHEQUE', 'PS_OS_PAYMENT', 'PS_OS_PREPARATION', 'PS_OS_SHIPPING', 'PS_OS_CANCELED', 'PS_OS_REFUND', 'PS_OS_ERROR', 'PS_OS_OUTOFSTOCK', 'PS_OS_BANKWIRE', 'PS_OS_PAYPAL', 'PS_OS_WS_PAYMENT');
if (!Configuration::get('PS_OS_PAYMENT')) {
foreach ($updateConfig as $u) {
if (!Configuration::get($u) && defined('_' . $u . '_')) {
Configuration::updateValue($u, constant('_' . $u . '_'));
}
}
}
/** Backward compatibility */
require _PS_MODULE_DIR_ . $this->name . '/backward_compatibility/backward.php';
}
示例6: __construct
public function __construct()
{
$this->name = 'cheque';
$this->tab = 'payments_gateways';
$this->version = '2.3';
$this->author = 'PrestaShop';
$this->controllers = array('payment', 'validation');
$this->currencies = true;
$this->currencies_mode = 'checkbox';
$config = Configuration::getMultiple(array('CHEQUE_NAME', 'CHEQUE_ADDRESS'));
if (isset($config['CHEQUE_NAME'])) {
$this->chequeName = $config['CHEQUE_NAME'];
}
if (isset($config['CHEQUE_ADDRESS'])) {
$this->address = $config['CHEQUE_ADDRESS'];
}
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Payments by check');
$this->description = $this->l('This module allows you to accept payments by check.');
$this->confirmUninstall = $this->l('Are you sure you want to delete these details?');
if (!isset($this->chequeName) || !isset($this->address) || empty($this->chequeName) || empty($this->address)) {
$this->warning = $this->l('The "Pay to the order of" and "Address" fields must be configured before using this module.');
}
if (!count(Currency::checkPaymentCurrencies($this->id))) {
$this->warning = $this->l('No currency has been set for this module.');
}
$this->extra_mail_vars = array('{cheque_name}' => Configuration::get('CHEQUE_NAME'), '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'), '{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS')));
}
示例7: __construct
public function __construct()
{
$this->name = 'twocheckoutpp';
$this->displayName = '2Checkout PayPal Direct';
$this->tab = 'payments_gateways';
$this->version = 0.1;
$config = Configuration::getMultiple(array('TWOCHECKOUTPP_SID', 'TWOCHECKOUTPP_SECRET', 'TWOCHECKOUTPP_CURRENCY', 'TWOCHECKOUTPP_CURRENCIES'));
if (isset($config['TWOCHECKOUTPP_SID'])) {
$this->SID = $config['TWOCHECKOUTPP_SID'];
}
if (isset($config['TWOCHECKOUTPP_SECRET'])) {
$this->SECRET = $config['TWOCHECKOUTPP_SECRET'];
}
if (isset($config['TWOCHECKOUTPP_CURRENCY'])) {
$this->CURRENCY = $config['TWOCHECKOUTPP_CURRENCY'];
}
if (isset($config['TWOCHECKOUTPP_CURRENCIES'])) {
$this->currencies = $config['TWOCHECKOUTPP_CURRENCIES'];
}
parent::__construct();
/* The parent construct is required for translations */
$this->page = basename(__FILE__, '.php');
$this->description = $this->l('Accept payments with 2Checkout');
if (!isset($this->SID) or !isset($this->currencies)) {
$this->warning = $this->l('your 2Checkout Seller ID must be configured in order to use this module correctly');
}
if (!Configuration::get('TWOCHECKOUTPP_CURRENCIES')) {
$currencies = Currency::getCurrencies();
$authorized_currencies = array();
foreach ($currencies as $currency) {
$authorized_currencies[] = $currency['id_currency'];
}
Configuration::updateValue('TWOCHECKOUTPP_CURRENCIES', implode(',', $authorized_currencies));
}
}
示例8: __construct
public function __construct()
{
$this->name = 'hipay';
$this->tab = 'payments_gateways';
$this->version = '1.5';
$this->module_key = 'e25bc8f4f9296ef084abf448bca4808a';
$this->currencies = true;
$this->currencies_mode = 'radio';
$this->author = 'PrestaShop';
parent::__construct();
$this->displayName = $this->l('Hipay');
$this->description = $this->l('Secure payement with Visa, Mastercard and European solutions.');
$request = '
SELECT iso_code
FROM ' . _DB_PREFIX_ . 'country as c
LEFT JOIN ' . _DB_PREFIX_ . 'zone as z
ON z.id_zone = c.id_zone
WHERE ';
$result = Db::getInstance()->ExecuteS($request . $this->getRequestZones());
foreach ($result as $num => $iso) {
$this->limited_countries[] = $iso['iso_code'];
}
if ($this->id) {
// Define extracted from mapi/mapi_defs.php
if (!defined('HIPAY_GATEWAY_URL')) {
define('HIPAY_GATEWAY_URL', 'https://' . ($this->env ? '' : 'test.') . 'payment.hipay.com/order/');
}
}
/** Backward compatibility */
require _PS_MODULE_DIR_ . 'hipay/backward_compatibility/backward.php';
}
示例9: __construct
public function __construct()
{
$this->helper = new InvipaypaygateHelper();
$this->controllers = array('payment', 'statuslistener', 'statuscheck', 'validation', 'error');
$this->name = 'invipaypaygate';
$this->tab = 'payments_gateways';
$this->version = '1.0.0';
$this->author = 'inviPay.com';
$this->need_instance = 0;
$this->is_eu_compatible = true;
$this->currencies = false;
$this->bootstrap = true;
$this->module_key = '3b5a58e798efb11fa97cee72b09051d2';
parent::__construct();
$this->displayName = 'inviPay.com';
//$this->l('module_display_name');
$this->description = 'Metoda płatności dzięki której sprzedajesz na fakturę z odroczonym terminem płatności, bez żadnego ryzyka.';
//$this->l('module_description');
$this->confirmUninstall = $this->l('uninstall_confirmation');
if (_PS_VERSION_ < '1.5') {
require _PS_MODULE_DIR_ . $this->name . '/backward_compatibility/backward.php';
}
if (!Configuration::get(InvipaypaygateHelper::ADMIN_CONFIGURATION_KEY)) {
$this->warning = $this->l('no_configuration_data');
}
$this->configureSmarty();
}
示例10: __construct
public function __construct()
{
// Basic Settings
$this->name = 'webpaykcc';
$this->tab = 'payments_gateways';
$this->version = '1.0.1';
$this->author = 'Camilo Castro <camilo@cervezapps.cl>';
$this->need_instance = 1;
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
// This is for the views
// This module does not use twitter bootstrap
// helpers. But someday in the future will.
// meanwhile is turned off.
// $this->bootstrap = true;
// $this->bootstrap = false;
// Call the Parent Constructor
parent::__construct();
// Now some messages
$this->displayName = $this->l('Webpay KCC Payment');
$this->description = $this->l('Payment Gateway using Chile Transbank Webpay KCC');
$this->confirmUninstall = $this->l('Payments with Webpay KCC will not be possible. Are you sure to uninstall?');
// Call internal setup methods
$this->setModuleSettings();
$this->checkModuleRequirements();
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->displayName = $this->l('Mollie Payment Module');
$this->description = $this->l('Mollie Payments');
$this->confirmUninstall = $this->l('Are you sure you want to uninstall the Mollie Payment Module?');
require_once dirname(__FILE__) . '/lib/src/Mollie/API/Autoloader.php';
try {
$this->api = new Mollie_API_Client();
$this->api->setApiKey($this->getConfigValue('MOLLIE_API_KEY'));
$this->api->addVersionString('Prestashop/' . (defined('_PS_VERSION_') ? _PS_VERSION_ : 'Unknown'));
$this->api->addVersionString('MolliePrestashop/' . (isset($this->version) ? $this->version : 'Unknown'));
} catch (Mollie_API_Exception_IncompatiblePlatform $e) {
Logger::addLog(__METHOD__ . ' - System incompatible: ' . $e->getMessage(), Mollie::CRASH);
} catch (Mollie_API_Exception $e) {
$this->warning = $this->l('Payment error:') . $e->getMessage();
Logger::addLog(__METHOD__ . ' said: ' . $this->warning, Mollie::CRASH);
}
$this->statuses = array(Mollie_API_Object_Payment::STATUS_PAID => $this->getConfigValue('MOLLIE_STATUS_PAID'), Mollie_API_Object_Payment::STATUS_CANCELLED => $this->getConfigValue('MOLLIE_STATUS_CANCELLED'), Mollie_API_Object_Payment::STATUS_EXPIRED => $this->getConfigValue('MOLLIE_STATUS_EXPIRED'), Mollie_API_Object_Payment::STATUS_REFUNDED => $this->getConfigValue('MOLLIE_STATUS_REFUNDED'), Mollie_API_Object_Payment::STATUS_OPEN => $this->getConfigValue('MOLLIE_STATUS_OPEN'));
// Load all translatable text here so we have a single translation point
$this->lang = array(Mollie_API_Object_Payment::STATUS_PAID => $this->l('paid'), Mollie_API_Object_Payment::STATUS_CANCELLED => $this->l('cancelled'), Mollie_API_Object_Payment::STATUS_EXPIRED => $this->l('expired'), Mollie_API_Object_Payment::STATUS_REFUNDED => $this->l('refunded'), Mollie_API_Object_Payment::STATUS_OPEN => $this->l('bankwire pending'), 'This payment method is not available.' => $this->l('This payment method is not available.'), 'Click here to continue' => $this->l('Click here to continue'), 'This payment method is only available for Euros.' => $this->l('This payment method is only available for Euros.'), 'There was an error while processing your request: ' => $this->l('There was an error while processing your request: '), 'The order with this id does not exist.' => $this->l('The order with this id does not exist.'), 'We have not received a definite payment status. You will be notified as soon as we receive a confirmation of the bank/merchant.' => $this->l('We have not received a definite payment status. You will be notified as soon as we receive a confirmation of the bank/merchant.'), 'You have cancelled your payment.' => $this->l('You have cancelled your payment.'), 'Unfortunately your payment was expired.' => $this->l('Unfortunately your payment was expired.'), 'Thank you. Your payment has been received.' => $this->l('Thank you. Your payment has been received.'), 'The transaction has an unexpected status.' => $this->l('The transaction has an unexpected status.'), 'You are not authorised to see this page.' => $this->l('You are not authorised to see this page.'), 'Continue shopping' => $this->l('Continue shopping'), 'Welcome back' => $this->l('Welcome back'), 'Select your bank:' => $this->l('Select your bank:'), 'OK' => $this->l('OK'), 'Return to the homepage' => $this->l('Return to the homepage'), 'Pay with %s' => $this->l('Pay with %s'), 'Refund this order' => $this->l('Refund this order'), 'Mollie refund' => $this->l('Mollie refund'), 'Refund order #%d through the Mollie API.' => $this->l('Refund order #%d through the Mollie API.'), 'iDEAL' => $this->l('iDEAL'), 'Creditcard' => $this->l('Creditcard'), 'Mister Cash' => $this->l('Mister Cash'), 'Bank transfer' => $this->l('Bank transfer'), 'PayPal' => $this->l('PayPal'), 'paysafecard' => $this->l('paysafecard'), 'MiniTix' => $this->l('MiniTix'), 'Micropayments' => $this->l('Micropayments'));
// If an update includes a new hook, it normally takes a manual reinstall for it to take effect
// This would cause all config values to reset and the Mollie table to be cleared.
// $this->reinstall() fixes the hook registration without those sad side effects.
$version = $this->getConfigValue('MOLLIE_VERSION');
if ($version === FALSE || version_compare($version, $this->version, '<')) {
$this->reinstall();
$this->updateConfigValue('MOLLIE_VERSION', $this->version);
}
}
示例12: __construct
/**
* @brief Constructor
*/
public function __construct()
{
$this->name = 'alliance3';
$this->tab = 'payments_gateways';
$this->version = '1.2.4';
$this->author = 'go4.fi';
$this->className = 'alliance3';
parent::__construct();
$this->displayName = $this->l('Alliance Processing');
$this->description = $this->l('Experienced leader in High Risk ecommerce merchants with both onshore and offshore solutions.');
$this->confirmUninstall = $this->l('Are you sure you want to delete your details?');
$this->ps_versions_compliancy = array('min' => '1.4', 'max' => '1.5.6.2');
if (!extension_loaded('soap')) {
$this->_warnings[] = $this->l('In order to use your module, please activate Soap (PHP extension)');
}
if (!extension_loaded('openssl')) {
$this->_warnings[] = $this->l('In order to use your module, please activate OpenSsl (PHP extension)');
}
if (!function_exists('curl_init')) {
$this->_warnings[] = $this->l('In order to use your module, please activate cURL (PHP extension)');
}
/* Backward compatibility */
require _PS_MODULE_DIR_ . 'alliance3/backward_compatibility/backward.php';
$this->context->smarty->assign('base_dir', __PS_BASE_URI__);
}
示例13: __construct
/**
* @brief Constructor
*/
public function __construct()
{
$this->name = 'merchantware';
$this->tab = 'payments_gateways';
$this->version = '1.2.4';
$this->author = 'PrestaShop';
$this->className = 'Merchantware';
parent::__construct();
$this->displayName = $this->l('Merchant Warehouse');
$this->description = $this->l('Eliminate expensive and unnecessary gateway fees by partnering with Merchant Warehouse for your payment processing needs!');
$this->confirmUninstall = $this->l('Are you sure you want to delete your details?');
$this->ps_versions_compliancy = array('min' => '1.4', 'max' => _PS_VERSION_);
if (!extension_loaded('soap')) {
$this->_warnings[] = $this->l('In order to use your module, please activate Soap (PHP extension)');
}
if (!extension_loaded('openssl')) {
$this->_warnings[] = $this->l('In order to use your module, please activate OpenSsl (PHP extension)');
}
if (!function_exists('curl_init')) {
$this->_warnings[] = $this->l('In order to use your module, please activate cURL (PHP extension)');
}
/* Backward compatibility */
require _PS_MODULE_DIR_ . 'merchantware/backward_compatibility/backward.php';
$this->context->smarty->assign('base_dir', __PS_BASE_URI__);
}
示例14: __construct
public function __construct()
{
$this->name = 'payubiz';
$this->tab = 'payments_gateways';
$this->version = '2.0';
$this->currencies = true;
$this->currencies_mode = 'radio';
parent::__construct();
$this->author = 'PayU India';
$this->page = basename(__FILE__, '.php');
$this->displayName = $this->l('PayUbiz');
$this->description = $this->l('Boost Your Sales With Market Leading Payment Gateway');
$this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
/* For 1.4.3 and less compatibility */
$updateConfig = array('PS_OS_CHEQUE' => 1, 'PS_OS_PAYMENT' => 2, 'PS_OS_PREPARATION' => 3, 'PS_OS_SHIPPING' => 4, 'PS_OS_DELIVERED' => 5, 'PS_OS_CANCELED' => 6, 'PS_OS_REFUND' => 7, 'PS_OS_ERROR' => 8, 'PS_OS_OUTOFSTOCK' => 9, 'PS_OS_BANKWIRE' => 10, 'PS_OS_PAYPAL' => 11, 'PS_OS_WS_PAYMENT' => 12);
foreach ($updateConfig as $u => $v) {
if (!Configuration::get($u) || (int) Configuration::get($u) < 1) {
if (defined('_' . $u . '_') && (int) constant('_' . $u . '_') > 0) {
Configuration::updateValue($u, constant('_' . $u . '_'));
} else {
Configuration::updateValue($u, $v);
}
}
}
}
示例15:
function __construct()
{
$this->name = 'cheque';
$this->tab = 'Payment';
$this->version = 2.2;
$this->currencies = true;
$this->currencies_mode = 'checkbox';
$config = Configuration::getMultiple(array('CHEQUE_NAME', 'CHEQUE_ADDRESS'));
if (isset($config['CHEQUE_NAME'])) {
$this->chequeName = $config['CHEQUE_NAME'];
}
if (isset($config['CHEQUE_ADDRESS'])) {
$this->address = $config['CHEQUE_ADDRESS'];
}
parent::__construct();
$this->displayName = $this->l('Cheque');
$this->description = $this->l('Module for accepting payments by cheque');
$this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
if (!isset($this->chequeName) or !isset($this->address)) {
$this->warning = $this->l('\'To the order of\' and address must be configured in order to use this module correctly');
}
if (!sizeof(Currency::checkPaymentCurrencies($this->id))) {
$this->warning = $this->l('No currency set for this module');
}
}