本文整理汇总了PHP中mslib_fe::loadPaymentMethod方法的典型用法代码示例。如果您正苦于以下问题:PHP mslib_fe::loadPaymentMethod方法的具体用法?PHP mslib_fe::loadPaymentMethod怎么用?PHP mslib_fe::loadPaymentMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mslib_fe
的用法示例。
在下文中一共展示了mslib_fe::loadPaymentMethod方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convertCartToOrder
//.........这里部分代码省略.........
$insertArray['delivery_mobile'] = $address['delivery_mobile'];
$insertArray['delivery_fax'] = '';
$insertArray['delivery_vat_id'] = '';
$insertArray['delivery_birthday'] = strtotime($address['delivery_birthday']);
}
$insertArray['bill'] = 1;
$insertArray['crdate'] = time();
$insertArray['shipping_method'] = $address['shipping_method'];
$insertArray['shipping_method_label'] = $address['shipping_method_label'];
$insertArray['payment_method'] = $address['payment_method'];
$insertArray['payment_method_label'] = $address['payment_method_label'];
$insertArray['shipping_method_costs'] = $address['shipping_method_costs'];
$insertArray['payment_method_costs'] = $address['payment_method_costs'];
$insertArray['hash'] = md5(uniqid('', true));
$insertArray['store_currency'] = $this->ms['MODULES']['CURRENCY_ARRAY']['cu_iso_3'];
if (isset($this->ms['MODULES']['CUSTOMER_CURRENCY_ARRAY']['cu_iso_3']) && !empty($this->ms['MODULES']['CUSTOMER_CURRENCY_ARRAY']['cu_iso_3'])) {
$insertArray['customer_currency'] = $this->ms['MODULES']['CUSTOMER_CURRENCY_ARRAY']['cu_iso_3'];
} else {
$insertArray['customer_currency'] = $this->ms['MODULES']['CURRENCY_ARRAY']['cu_iso_3'];
}
if (isset($this->cookie['currency_rate']) && !empty($this->cookie['currency_rate'])) {
$insertArray['currency_rate'] = $this->cookie['currency_rate'];
} else {
$insertArray['currency_rate'] = 1;
}
$insertArray['language_id'] = $this->sys_language_uid;
// get default orders status
$status = mslib_fe::getDefaultOrdersStatus($this->sys_language_uid);
$default_order_status_id = 0;
if (is_array($status) && isset($status['id']) && $status['id'] > 0) {
$default_order_status_id = $status['id'];
}
// set the order status based on payment method settings
$payment_method = mslib_fe::loadPaymentMethod($address['payment_method']);
$payment_method_vars = unserialize($payment_method['vars']);
$payment_method_vars['default_order_status'] = (int) $payment_method_vars['default_order_status'];
if (isset($payment_method_vars['default_order_status']) && is_numeric($payment_method_vars['default_order_status']) && $payment_method_vars['default_order_status'] > 0) {
$default_order_status_id = $payment_method_vars['default_order_status'];
}
if ($default_order_status_id > 0) {
$insertArray['status'] = $default_order_status_id;
} else {
$insertArray['status'] = '';
}
if (isset($this->cookie['HTTP_REFERER']) && !empty($this->cookie['HTTP_REFERER'])) {
$insertArray['http_referer'] = $this->cookie['HTTP_REFERER'];
} else {
$insertArray['http_referer'] = '';
}
$insertArray['ip_address'] = $this->server['REMOTE_ADDR'];
$insertArray['user_agent'] = $this->server['HTTP_USER_AGENT'];
if (isset($address['expected_delivery_date'])) {
$insertArray['expected_delivery_date'] = $address['expected_delivery_date'];
}
$user = mslib_fe::getUser($customer_id);
$insertArray['payment_condition'] = '';
if (is_numeric($user['tx_multishop_payment_condition']) && $user['tx_multishop_payment_condition'] > 0) {
$insertArray['payment_condition'] = $user['tx_multishop_payment_condition'];
}
//$insertArray['orders_tax_data'] = serialize($orders_tax);
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_multishop_pi1.php']['insertOrderPreProc'])) {
// hook
$params = array('ms' => $this->ms, 'address' => &$address, 'insertArray' => &$insertArray);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_multishop_pi1.php']['insertOrderPreProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
示例2: array
$array2[] = $this->ms['MODULES']['STORE_NAME'];
$array1[] = '###TOTAL_AMOUNT###';
$array2[] = mslib_fe::amount2Cents($tmpArray['total_amount']);
$array1[] = '###ORDER_NUMBER###';
$array2[] = $tmpArray['orders_id'];
$array1[] = '###ORDER_LINK###';
$array2[] = '';
$array1[] = '###CUSTOMER_ID###';
$array2[] = $tmpArray['customer_id'];
$link = $this->FULL_HTTP_URL . mslib_fe::typolink($tmpArray['page_uid'], 'tx_multishop_pi1[page_section]=payment_reminder_checkout&tx_multishop_pi1[hash]=' . $hashcode);
$array1[] = '###PAYMENT_PAGE_LINK###';
$array2[] = $link;
// psp email template
$psp_mail_template = array();
if ($tmpArray['payment_method']) {
$psp_data = mslib_fe::loadPaymentMethod($tmpArray['payment_method']);
$psp_vars = unserialize($psp_data['vars']);
if (isset($psp_vars['order_payment_reminder'])) {
$psp_mail_template['order_payment_reminder'] = '';
if ($psp_vars['order_payment_reminder'] > 0) {
$psp_mail_template['order_payment_reminder'] = mslib_fe::getCMSType($psp_vars['order_payment_reminder']);
}
}
}
if (isset($psp_mail_template['order_payment_reminder'])) {
$page = array();
if (!empty($psp_mail_template['order_payment_reminder'])) {
$page = mslib_fe::getCMScontent($psp_mail_template['order_payment_reminder'], $GLOBALS['TSFE']->sys_language_uid);
}
} else {
$cms_type = 'payment_reminder_email_templates_' . $tmpArray['payment_method'];
示例3: updateOrderStatusToPaid
public function updateOrderStatusToPaid($orders_id, $timestamp = '')
{
if (!is_numeric($orders_id)) {
return false;
}
$order = mslib_fe::getOrder($orders_id);
if (!$order['paid']) {
//hook to let other plugins further manipulate the replacers
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['updateOrderStatusToPaidPreProc'])) {
$params = array('order' => &$order);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['updateOrderStatusToPaidPreProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
$updateArray = array('paid' => 1);
$updateArray['orders_last_modified'] = time();
if (!$timestamp) {
$timestamp = time();
}
// set the order status based on payment method settings
$payment_method = mslib_fe::loadPaymentMethod($order['payment_method']);
$payment_method_vars = unserialize($payment_method['vars']);
$payment_method_vars['success_status'] = (int) $payment_method_vars['success_status'];
if ($payment_method['provider'] == 'generic' && isset($payment_method_vars['success_status']) && is_numeric($payment_method_vars['success_status']) && $payment_method_vars['success_status'] > 0) {
$updateArray['status'] = $payment_method_vars['success_status'];
}
$updateArray['orders_paid_timestamp'] = $timestamp;
$query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_orders', 'orders_id=' . $orders_id, $updateArray);
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
if ($this->ms['MODULES']['ADMIN_INVOICE_MODULE'] && $this->ms['MODULES']['GENERATE_INVOICE_ID_AFTER_ORDER_SET_TO_PAID']) {
// create invoice
$invoice = mslib_fe::getOrderInvoice($orders_id);
$updateArray = array('paid' => 1);
$query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_invoices', 'hash=\'' . $invoice['hash'] . '\'', $updateArray);
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
}
$continue = 1;
foreach ($order['products'] as $product) {
$module_settings = mslib_fe::loadInherentCustomSettingsByProduct($product['products_id']);
if ($module_settings['ORDERS_PAID_CUSTOM_SCRIPT']) {
if (!strstr($module_settings['ORDERS_PAID_CUSTOM_SCRIPT'], "..")) {
if (strstr($module_settings['ORDERS_PAID_CUSTOM_SCRIPT'], "/")) {
$continue = 0;
require PATH_site . $module_settings['ORDERS_PAID_CUSTOM_SCRIPT'] . '.php';
}
}
}
}
if ($this->ms['MODULES']['ORDERS_PAID_CUSTOM_SCRIPT'] and $continue) {
if (!strstr($module_settings['ORDERS_PAID_CUSTOM_SCRIPT'], "..")) {
if (strstr($module_settings['ORDERS_PAID_CUSTOM_SCRIPT'], "/")) {
require PATH_site . $module_settings['ORDERS_PAID_CUSTOM_SCRIPT'] . '.php';
}
}
}
$mailOrder = 1;
//hook to let other plugins further manipulate the replacers
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['updateOrderStatusToPaidPostProc'])) {
$params = array('order' => &$order, 'mailOrder' => &$mailOrder);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['updateOrderStatusToPaidPostProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
if ($mailOrder) {
$tmp = mslib_fe::mailOrder($order['orders_id'], 1, '', 'email_order_paid_letter');
}
return true;
} else {
return false;
}
}
示例4: mailOrder
function mailOrder($orders_id, $copy_to_merchant = 1, $custom_email_address = '', $mail_template = '')
{
$order = mslib_fe::getOrder($orders_id);
if ($order['orders_id']) {
$order['mail_template'] = $mail_template;
if (isset($order['language_id'])) {
// Switch to language that is stored in the order
mslib_befe::setSystemLanguage($order['language_id']);
}
if (!$custom_email_address) {
$custom_email_address = $order['billing_email'];
}
$billing_address = '';
$delivery_address = '';
$full_customer_name = $order['billing_first_name'];
if ($order['billing_middle_name']) {
$full_customer_name .= ' ' . $order['billing_middle_name'];
}
if ($order['billing_last_name']) {
$full_customer_name .= ' ' . $order['billing_last_name'];
}
$delivery_full_customer_name = $order['delivery_first_name'];
if ($order['delivery_middle_name']) {
$delivery_full_customer_name .= ' ' . $order['delivery_middle_name'];
}
if ($order['delivery_last_name']) {
$delivery_full_customer_name .= ' ' . $order['delivery_last_name'];
}
$full_customer_name = preg_replace('/\\s+/', ' ', $full_customer_name);
$delivery_full_customer_name = preg_replace('/\\s+/', ' ', $delivery_full_customer_name);
if (!$order['delivery_address'] or !$order['delivery_city']) {
$order['delivery_company'] = $order['billing_company'];
$order['delivery_street_name'] = $order['billing_street_name'];
$order['delivery_building'] = $order['billing_building'];
$order['delivery_address'] = $order['billing_address'];
$order['delivery_address_number'] = $order['billing_address_number'];
$order['delivery_address_ext'] = $order['billing_address_ext'];
$order['delivery_zip'] = $order['billing_zip'];
$order['delivery_city'] = $order['billing_city'];
$order['delivery_telephone'] = $order['billing_telephone'];
$order['delivery_mobile'] = $order['billing_mobile'];
}
if ($order['delivery_company']) {
$delivery_address = $order['delivery_company'] . "<br />";
}
if ($delivery_full_customer_name) {
$delivery_address .= $delivery_full_customer_name . "<br />";
}
if ($order['delivery_building']) {
$delivery_address .= $order['delivery_building'] . "<br />";
}
if ($order['delivery_address']) {
$delivery_address .= $order['delivery_address'] . "<br />";
}
if ($order['delivery_zip'] and $order['delivery_city']) {
$delivery_address .= $order['delivery_zip'] . " " . $order['delivery_city'];
}
if ($order['delivery_country'] && mslib_befe::strtolower($order['delivery_country']) != mslib_befe::strtolower($this->tta_shop_info['country'])) {
// ONLY PRINT COUNTRY IF THE COUNTRY OF THE CUSTOMER IS DIFFERENT THAN FROM THE SHOP
$delivery_address .= '<br />' . mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $order['delivery_country']);
}
// if ($order['delivery_telephone']) $delivery_address.=ucfirst($this->pi_getLL('telephone')).': '.$order['delivery_telephone']."<br />";
// if ($order['delivery_mobile']) $delivery_address.=ucfirst($this->pi_getLL('mobile')).': '.$order['delivery_mobile']."<br />";
if ($order['billing_company']) {
$billing_address = $order['billing_company'] . "<br />";
}
if ($full_customer_name) {
$billing_address .= $full_customer_name . "<br />";
}
if ($order['billing_building']) {
$billing_address .= $order['billing_building'] . "<br />";
}
if ($order['billing_address']) {
$billing_address .= $order['billing_address'] . "<br />";
}
if ($order['billing_zip'] and $order['billing_city']) {
$billing_address .= $order['billing_zip'] . " " . $order['billing_city'];
}
if ($order['billing_country'] && mslib_befe::strtolower($order['billing_country']) != mslib_befe::strtolower($this->tta_shop_info['country'])) {
// ONLY PRINT COUNTRY IF THE COUNTRY OF THE CUSTOMER IS DIFFERENT THAN FROM THE SHOP
$billing_address .= '<br />' . mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $order['billing_country']);
}
$loadFromPids = array();
if ($this->conf['masterShop']) {
$loadFromPids[] = $order['page_uid'];
$loadFromPids[] = $this->shop_pid;
if ($this->showCatalogFromPage and $this->showCatalogFromPage != $this->shop_pid) {
$loadFromPids[] = $this->showCatalogFromPage;
}
}
// psp email template
$psp_mail_template = array();
if ($order['payment_method']) {
$psp_data = mslib_fe::loadPaymentMethod($order['payment_method']);
$psp_vars = unserialize($psp_data['vars']);
if (isset($psp_vars['order_confirmation'])) {
$psp_mail_template['order_confirmation'] = '';
if ($psp_vars['order_confirmation'] > 0) {
$psp_mail_template['order_confirmation'] = mslib_fe::getCMSType($psp_vars['order_confirmation']);
}
//.........这里部分代码省略.........
示例5: array
$array1[] = '###PROPOSAL_NUMBER###';
$array2[] = $order['orders_id'];
$array1[] = '###ORDER_NUMBER###';
$array2[] = $order['orders_id'];
$array1[] = '###ORDER_LINK###';
$array2[] = '';
$array1[] = '###CUSTOMER_ID###';
$array2[] = $order['customer_id'];
$array1[] = '###CUSTOMER_COMMENTS###';
$array2[] = $order['customer_comments'];
// for on the site eof
$page = array();
// psp email template
$psp_mail_template = array();
if ($order['payment_method']) {
$psp_data = mslib_fe::loadPaymentMethod($order['payment_method']);
$psp_vars = unserialize($psp_data['vars']);
if (isset($psp_vars['order_thank_you_page'])) {
$psp_mail_template['order_thank_you_page'] = '';
if ($psp_vars['order_thank_you_page'] > 0) {
$psp_mail_template['order_thank_you_page'] = mslib_fe::getCMSType($psp_vars['order_thank_you_page']);
}
}
}
// first try to load the custom thank you page based on the payment method
if (isset($psp_mail_template['order_thank_you_page'])) {
$page = array();
if (!empty($psp_mail_template['order_thank_you_page'])) {
$page = mslib_fe::getCMScontent($psp_mail_template['order_thank_you_page'], $GLOBALS['TSFE']->sys_language_uid);
}
} else {
示例6: elseif
} elseif ($field == 'products_image_200' . $s) {
$tmpcontent .= $this->FULL_HTTP_URL . mslib_befe::getImagePath($row['products_image' . $y], 'products', '200');
} elseif ($field == 'products_image_normal' . $s) {
$tmpcontent .= $this->FULL_HTTP_URL . mslib_befe::getImagePath($row['products_image' . $y], 'products', 'normal');
} elseif ($field == 'products_image_original' . $s) {
$tmpcontent .= $this->FULL_HTTP_URL . mslib_befe::getImagePath($row['products_image' . $y], 'products', 'original');
}
}
}
} else {
if (strpos($field, 'product_payment_methods_') !== false) {
if ($row['products_id']) {
$method_mappings = mslib_befe::getMethodsByProduct($row['products_id']);
}
$payment_code = str_replace('product_payment_methods_', '', $field);
$payment_method = mslib_fe::loadPaymentMethod($payment_code);
if (is_array($method_mappings['payment']) && in_array($payment_method['id'], $method_mappings['payment'])) {
if (!$method_mappings['payment']['method_data'][$payment_method['id']]['negate']) {
$tmpcontent .= 1;
} else {
if ($method_mappings['payment']['method_data'][$payment_method['id']]['negate'] > 0) {
$tmpcontent .= 0;
} else {
$tmpcontent .= '';
}
}
}
} else {
if (strpos($field, 'product_shipping_methods_') !== false) {
if ($row['products_id']) {
$method_mappings = mslib_befe::getMethodsByProduct($row['products_id']);