✏️ 正在编辑: AxeptaCustomerRecurringPaymentCard.php
路径:
/home/bpioifn/www/pigmentse/modules/axepta/classes/AxeptaCustomerRecurringPaymentCard.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * 1997-2020 Quadra Informatique * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) that is available * through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 * If you are unable to obtain it through the world-wide-web, please send an email * to modules@quadra-informatique.fr so we can send you a copy immediately. * * @author Quadra Informatique <modules@quadra-informatique.fr> * @copyright 1997-2020 Quadra Informatique * @license http://www.opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ class AxeptaCustomerRecurringPaymentCard extends ObjectModel { /** * ID * @var integer */ public $id; /** * ID * @var integer */ public $id_customer; /** * ID * @var integer */ public $id_axepta_customer_payment_recurring; /** * * @var integer */ public $pcnr; /** * * @var string */ public $ccexpiry; /** * Object * @var string */ public $ccbrand; /** * Object * @var string */ public $bid; /** * Object * @var string */ public $holder_name; /** * @see ObjectModel::$definition */ public static $definition = array( 'table' => 'axepta_customer_recurring_payment_card', 'primary' => 'id', 'fields' => array( 'id_customer' => array( 'type' => self::TYPE_INT, 'validate' => 'isInt', 'required' => true ), 'id_axepta_customer_payment_recurring' => array( 'type' => self::TYPE_INT, 'validate' => 'isInt', 'required' => false ), 'pcnr' => array( 'type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => false ), 'ccexpiry' => array( 'type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => false ), 'ccbrand' => array( 'type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => false ), 'bid' => array( 'type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => false ), 'holder_name' => array( 'type' => self::TYPE_STRING, 'validate' => 'isString', 'required' => true ), ) ); public static function getRegistersCard($id_customer) { if ((int) $id_customer) { return Db::getInstance()->executeS('SELECT * FROM ' . _DB_PREFIX_ . 'axepta_customer_recurring_payment_card' . ' WHERE id_customer = ' . (int) $id_customer); } return false; // INSERT INTO `ps_axepta_customer_oneclick_payment_card` (`id`, `id_customer`, `pcnr`, `ccexpiry`, `ccbrand`) VALUES('1', '1', '20', '20', '20'); } public static function getTrigramByCcbrand($ccbrand) { $trigram = false; $methods = [ 'VISA' => 'VIM', 'VISA Electron' => 'VIM', 'MasterCard' => 'VIM', 'Maestro' => 'VIM', 'Cartes Bancaires' => 'CVM' ]; foreach ($methods as $key => $value) { if ($key == $ccbrand) { $trigram = $value; } } if ($trigram) { return $trigram; } if ($ccbrand) { return Db::getInstance()->getValue('SELECT trigram FROM `' . _DB_PREFIX_ . 'axepta_xml_method`' . ' WHERE code LIKE "%' . pSQL($ccbrand) . '%"'); } } public static function getIdByIdCustomerAndIdAxeptaCustomerPaymentRecurring($id_customer, $id_axepta_customer_payment_recurring) { if ((int) $id_customer && $id_axepta_customer_payment_recurring) { return Db::getInstance()->getValue('SELECT id FROM ' . _DB_PREFIX_ . 'axepta_customer_recurring_payment_card WHERE id_customer = ' . (int) $id_customer . ' AND id_axepta_customer_payment_recurring = ' . (int) $id_axepta_customer_payment_recurring); } return false; } public static function verifyIfCardExist($id_customer, $pcnr) { if ((int) $id_customer && $pcnr) { return Db::getInstance()->getRow('SELECT * FROM ' . _DB_PREFIX_ . 'axepta_customer_recurring_payment_card WHERE id_customer = ' . (int) $id_customer . ' AND pcnr = "' . pSQL($pcnr) . '" '); } return false; // INSERT INTO `ps_axepta_customer_oneclick_payment_card` (`id`, `id_customer`, `pcnr`, `ccexpiry`, `ccbrand`) VALUES('1', '1', '20', '20', '20'); } public static function getLastCardRegistered($id_customer, $pcnr) { if ((int) $id_customer && $pcnr) { return Db::getInstance()->getValue('SELECT id FROM ' . _DB_PREFIX_ . 'axepta_customer_recurring_payment_card WHERE id_customer = ' . (int) $id_customer . ' AND pcnr = "' . pSQL($pcnr) . '" ' . 'ORDER BY id desc'); } return false; // INSERT INTO `ps_axepta_customer_oneclick_payment_card` (`id`, `id_customer`, `pcnr`, `ccexpiry`, `ccbrand`) VALUES('1', '1', '20', '20', '20'); } public static function getLastCardRegisteredPaypal($id_customer, $bid) { if ((int) $id_customer && $bid) { return Db::getInstance()->getValue('SELECT id FROM ' . _DB_PREFIX_ . 'axepta_customer_recurring_payment_card WHERE id_customer = ' . (int) $id_customer . ' AND bid = "' . pSQL($bid) . '" ' . 'ORDER BY id desc'); } return false; } }
💾 保存文件
← 返回文件管理器