本文整理汇总了PHP中shopFunctions::getCurrencyByID方法的典型用法代码示例。如果您正苦于以下问题:PHP shopFunctions::getCurrencyByID方法的具体用法?PHP shopFunctions::getCurrencyByID怎么用?PHP shopFunctions::getCurrencyByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shopFunctions
的用法示例。
在下文中一共展示了shopFunctions::getCurrencyByID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: plgVmConfirmedOrder
/**
*
* тут выводится форма для перехода на сайт оплаты
* @author Alexius
*/
function plgVmConfirmedOrder($cart, $order)
{
//echo'<pre>salt = ';print_r($this);echo'</pre>';
if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
return NULL;
// Another method was selected, do nothing
}
if (!$this->selectedThisElement($method->payment_element)) {
return FALSE;
}
VmConfig::loadJLang('com_virtuemart', true);
if (!class_exists('VirtueMartModelOrders')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
}
$this->getPaymentCurrency($method);
$currency_code_3 = shopFunctions::getCurrencyByID($method->payment_currency, 'currency_code_3');
$email_currency = $this->getEmailCurrency($method);
$new_status = $method->status_pending;
$totalInPaymentCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $method->payment_currency);
$dbValues['payment_name'] = $this->renderPluginName($method) . '<br />' . $method->payment_info;
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['virtuemart_paymentmethod_id'] = $order['details']['BT']->virtuemart_paymentmethod_id;
$dbValues['cost_per_transaction'] = $method->cost_per_transaction;
$dbValues['cost_percent_total'] = $method->cost_percent_total;
$dbValues['payment_currency'] = $currency_code_3;
$dbValues['email_currency'] = $email_currency;
$dbValues['payment_order_total'] = $totalInPaymentCurrency['value'];
$dbValues['tax_id'] = $method->tax_id;
$this->storePSPluginInternalData($dbValues);
/*
$order1 = $this->getDataByOrderNumber('1419045');
$orderModel = VmModel::getModel('orders');
$order = $orderModel->getOrder($order1->virtuemart_order_id);
echo'<pre>';var_dump($order1);echo'</pre>';//die;
//echo'<pre>';var_dump($order);echo'</pre>';
die;
*/
//echo'<pre>';print_r($order['items']);echo'</pre>';
//die;
$session = JFactory::getSession();
$session->set('virtuemart_order_number', $order['details']['BT']->order_number);
//Формирование POST заголовка для отправки на Ipay
$post_variables = array('srv_no' => $method->srv_no, 'pers_acc' => $order['details']['BT']->order_number, 'amount' => (int) $order['details']['BT']->order_total, 'amount_editable' => 'N', 'provider_url' => $method->provider_url);
$url = $method->server;
//$url = 'https://stand.besmart.by:4443/pls/ipay/!iSOU.Login';
$html = '';
$html = '<div class="erip-ipay-frm">';
$html .= '<p>Номер вашего заказа: ' . $order['details']['BT']->order_number . '.</p>';
$html .= '<p>Для оплаты через систему ЕРИП запишите данный номер заказа.</p><br><br>';
$html .= '<p>Для оплаты через систему iPay - нажмите на кнопку ниже.</p>';
$html .= '<form action="' . $url . '" method="post" name="ipay-frm">';
foreach ($post_variables as $name => $value) {
$html .= '<input type="hidden" name="' . $name . '" value="' . htmlspecialchars($value) . '" />';
}
$html .= '<button type="submit" class="button">Оплатить через iPay</button>';
$html .= '</form>';
$html .= '</div>';
//return $html;
return $this->processConfirmedOrderPaymentResponse(2, $cart, $order, $html, $method->payment_name, $new_status);
}
示例2: plgVmConfirmedOrder
/**
*
*
* @author Valérie Isaksen
*/
function plgVmConfirmedOrder($cart, $order)
{
if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
return NULL;
// Another method was selected, do nothing
}
if (!$this->selectedThisElement($method->payment_element)) {
return FALSE;
}
VmConfig::loadJLang('com_virtuemart', true);
if (!class_exists('VirtueMartModelOrders')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
}
$this->getPaymentCurrency($method);
$currency_code_3 = shopFunctions::getCurrencyByID($method->payment_currency, 'currency_code_3');
$email_currency = $this->getEmailCurrency($method);
$totalInPaymentCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $method->payment_currency);
$dbValues['payment_name'] = $this->renderPluginName($method) . '<br />' . $method->payment_info;
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['virtuemart_paymentmethod_id'] = $order['details']['BT']->virtuemart_paymentmethod_id;
$dbValues['cost_per_transaction'] = $method->cost_per_transaction;
$dbValues['cost_percent_total'] = $method->cost_percent_total;
$dbValues['payment_currency'] = $currency_code_3;
$dbValues['email_currency'] = $email_currency;
$dbValues['payment_order_total'] = $totalInPaymentCurrency['value'];
$dbValues['tax_id'] = $method->tax_id;
$this->storePSPluginInternalData($dbValues);
$html = '<table class="vmorder-done">' . "\n";
$html .= $this->getHtmlRow('STANDARD_PAYMENT_INFO', $dbValues['payment_name'], 'class="vmorder-done-payinfo"');
if (!empty($payment_info)) {
$lang = JFactory::getLanguage();
if ($lang->hasKey($method->payment_info)) {
$payment_info = vmText::_($method->payment_info);
} else {
$payment_info = $method->payment_info;
}
$html .= $this->getHtmlRow('STANDARD_PAYMENTINFO', $payment_info, 'class="vmorder-done-payinfo"');
}
if (!class_exists('VirtueMartModelCurrency')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php';
}
$currency = CurrencyDisplay::getInstance('', $order['details']['BT']->virtuemart_vendor_id);
$html .= $this->getHtmlRow('STANDARD_ORDER_NUMBER', $order['details']['BT']->order_number, 'class="vmorder-done-nr"');
$html .= $this->getHtmlRow('STANDARD_AMOUNT', $currency->priceDisplay($order['details']['BT']->order_total), 'class="vmorder-done-amount"');
if ($method->payment_currency != $order['details']['BT']->order_currency) {
$html .= $this->getHtmlRow('COM_VIRTUEMART_CART_TOTAL_PAYMENT', $totalInPaymentCurrency['display'], 'class="vmorder-done-amount"');
}
//$html .= $this->getHtmlRow('STANDARD_INFO', $method->payment_info);
//$html .= $this->getHtmlRow('STANDARD_AMOUNT', $totalInPaymentCurrency.' '.$currency_code_3);
$html .= '</table>' . "\n";
$modelOrder = VmModel::getModel('orders');
$order['order_status'] = $this->getNewStatus($method);
$order['customer_notified'] = 1;
$order['comments'] = '';
$modelOrder->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order, TRUE);
//We delete the old stuff
$cart->emptyCart();
vRequest::setVar('html', $html);
return TRUE;
}
示例3: plgVmConfirmedOrder
/**
*
*
* @author Valérie Isaksen
*/
function plgVmConfirmedOrder($cart, $order)
{
if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
return NULL;
// Another method was selected, do nothing
}
if (!$this->selectedThisElement($method->payment_element)) {
return FALSE;
}
VmConfig::loadJLang('com_virtuemart', true);
VmConfig::loadJLang('com_virtuemart_orders', TRUE);
if (!class_exists('VirtueMartModelOrders')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'orders.php';
}
$this->getPaymentCurrency($method);
$currency_code_3 = shopFunctions::getCurrencyByID($method->payment_currency, 'currency_code_3');
$email_currency = $this->getEmailCurrency($method);
$totalInPaymentCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $method->payment_currency);
$dbValues['payment_name'] = $this->renderPluginName($method) . '<br />' . $method->payment_info;
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['virtuemart_paymentmethod_id'] = $order['details']['BT']->virtuemart_paymentmethod_id;
$dbValues['cost_per_transaction'] = $method->cost_per_transaction;
$dbValues['cost_min_transaction'] = $method->cost_min_transaction;
$dbValues['cost_percent_total'] = $method->cost_percent_total;
$dbValues['payment_currency'] = $currency_code_3;
$dbValues['email_currency'] = $email_currency;
$dbValues['payment_order_total'] = $totalInPaymentCurrency['value'];
$dbValues['tax_id'] = $method->tax_id;
$this->storePSPluginInternalData($dbValues);
$payment_info = '';
if (!empty($method->payment_info)) {
$lang = JFactory::getLanguage();
if ($lang->hasKey($method->payment_info)) {
$payment_info = vmText::_($method->payment_info);
} else {
$payment_info = $method->payment_info;
}
}
if (!class_exists('VirtueMartModelCurrency')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'currency.php';
}
$currency = CurrencyDisplay::getInstance('', $order['details']['BT']->virtuemart_vendor_id);
$html = $this->renderByLayout('post_payment', array('order_number' => $order['details']['BT']->order_number, 'order_pass' => $order['details']['BT']->order_pass, 'payment_name' => $dbValues['payment_name'], 'displayTotalInPaymentCurrency' => $totalInPaymentCurrency['display']));
$modelOrder = VmModel::getModel('orders');
$order['order_status'] = $this->getNewStatus($method);
$order['customer_notified'] = 1;
$order['comments'] = '';
$modelOrder->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order, TRUE);
//We delete the old stuff
$cart->emptyCart();
vRequest::setVar('html', $html);
return TRUE;
}
示例4: plgVmOnShowOrderBEPayment
/**
* Display stored payment data for an order
* @param int $virtuemart_order_id
* @param int $payment_method_id
* @see components/com_virtuemart/helpers/vmPSPlugin::plgVmOnShowOrderBEPayment()
*/
function plgVmOnShowOrderBEPayment($virtuemart_order_id, $payment_method_id)
{
if (!$this->selectedThisByMethodId($payment_method_id)) {
return NULL;
// Another method was selected, do nothing
}
if (!($payments = $this->getDatasByOrderId($virtuemart_order_id))) {
// JError::raiseWarning(500, $db->getErrorMsg());
return '';
}
$html = '<table class="adminlist table">' . "\n";
$html .= $this->getHtmlHeaderBE();
$code = "sofort_response_";
$first = TRUE;
foreach ($payments as $payment) {
$html .= '<tr class="row1"><th>' . vmText::_('COM_VIRTUEMART_DATE') . '</th><th align="left">' . $payment->created_on . '</th></tr>';
// Now only the first entry has this data when creating the order
if ($first) {
$html .= $this->getHtmlRowBE('SOFORT_PAYMENT_NAME', $payment->payment_name);
// keep that test to have it backwards compatible. Old version was deleting that column when receiving an IPN notification
if ($payment->payment_order_total and $payment->payment_order_total != 0.0) {
$html .= $this->getHtmlRowBE('SOFORT_PAYMENT_ORDER_TOTAL', $payment->payment_order_total . " " . shopFunctions::getCurrencyByID($payment->payment_currency, 'currency_code_3'));
}
if ($payment->email_currency and $payment->email_currency != 0) {
$html .= $this->getHtmlRowBE('SOFORT_PAYMENT_EMAIL_CURRENCY', shopFunctions::getCurrencyByID($payment->email_currency, 'currency_code_3'));
}
if ($payment->email_currency and $payment->email_currency != 0) {
$html .= $this->getHtmlRowBE('SOFORT_RESPONSE_TRANSACTION', $payment->sofort_response_transaction);
}
$first = FALSE;
} else {
foreach ($payment as $key => $value) {
// only displays if there is a value or the value is different from 0.00 and the value
if ($value) {
if (substr($key, 0, strlen($code)) == $code) {
$html .= $this->getHtmlRowBE($key, $value);
}
}
}
}
}
$html .= '</table>' . "\n";
return $html;
}
示例5: showOrderBEPayment
/**
* @param $virtuemart_order_id
* @return string
*/
function showOrderBEPayment($virtuemart_order_id)
{
$db = JFactory::getDBO();
$q = 'SELECT * FROM `' . $this->plugin->getTablename() . '` WHERE ';
$q .= ' `virtuemart_order_id` = ' . $virtuemart_order_id;
$db->setQuery($q);
$payments = $db->loadObjectList();
$html = '<table class="adminlist table">' . "\n";
$html .= $this->plugin->getHtmlHeaderBE();
$first = TRUE;
$lang = JFactory::getLanguage();
foreach ($payments as $payment) {
$html .= '<tr class="row1"><td>' . tsmText::_('VMPAYMENT_' . $this->plugin_name . '_DATE') . '</td><td align="left">' . $payment->created_on . '</td></tr>';
// Now only the first entry has this data when creating the order
if ($first) {
$html .= $this->plugin->getHtmlRowBE($this->plugin_name . '_PAYMENT_NAME', $payment->payment_name);
// keep that test to have it backwards compatible. Old version was deleting that column when receiving an IPN notification
if ($payment->payment_order_total and $payment->payment_order_total != 0.0) {
$html .= $this->plugin->getHtmlRowBE($this->plugin_name . '_PAYMENT_ORDER_TOTAL', $payment->payment_order_total * 0.01 . " " . shopFunctions::getCurrencyByID($payment->payment_currency, 'currency_code_3'));
}
if ($payment->email_currency and $payment->email_currency != 0) {
//$html .= $this->getHtmlRowBE($this->_name.'_PAYMENT_EMAIL_CURRENCY', shopFunctions::getCurrencyByID($payment->email_currency, 'currency_code_3'));
}
if ($payment->recurring) {
$recurring_html = '<table class="adminlist table">' . "\n";
$recurring = json_decode($payment->recurring);
$recurring_html .= $this->plugin->getHtmlRowBE($this->plugin_name . '_CONF_RECURRING_PERIODICTY', $payment->recurring_periodicity);
$recurring_html .= $this->plugin->getHtmlRowBE($this->plugin_name . '_CONF_RECURRING_NUMBER', $payment->recurring_number);
//$recurring_html .= $this->getHtmlRowBE(VmText::_('VMPAYMENT_'.$this->_name.'_CONF_RECURRING_PERIODICTY').' '. $payment->recurring_periodicity, VmText::_('VMPAYMENT_'.$this->_name.'_CONF_RECURRING_NUMBER').' '. $payment->recurring_number);
for ($i = 1; $i < $payment->recurring_number; $i++) {
$index_mont = "PBX_2MONT" . $i;
$index_date = "PBX_DATE" . $i;
$text_mont = tsmText::_('VMPAYMENT_' . $this->plugin_name . '_PAYMENT_RECURRING_2MONT') . " " . $i;
$text_date = tsmText::_('VMPAYMENT_' . $this->plugin_name . '_PAYMENT_RECURRING_DATE') . " " . $i;
//$recurring_html .= $this->getHtmlRowBE($text_date, $recurring->$index_date);
//$recurring_html .= $this->getHtmlRowBE($text_mont, ($recurring->$index_mont * 0.01) . " " . shopFunctions::getCurrencyByID($payment->payment_currency, 'currency_code_3'));
$recurring_html .= $this->plugin->getHtmlRowBE($recurring->{$index_date}, $recurring->{$index_mont} * 0.01 . " " . shopFunctions::getCurrencyByID($payment->payment_currency, 'currency_code_3'));
}
$recurring_html .= '</table>' . "\n";
$html .= $this->plugin->getHtmlRowBE($this->plugin_name . '_RECURRING', $recurring_html);
}
$first = FALSE;
} else {
if (!empty($payment->paybox_fullresponse)) {
$paybox_data = json_decode($payment->paybox_fullresponse);
$showOrderBEFields = $this->getOrderBEFields();
$prefix = $this->plugin_name . '_RESPONSE_';
foreach ($showOrderBEFields as $showOrderBEField) {
if (isset($paybox_data->{$showOrderBEField}) and !empty($paybox_data->{$showOrderBEField})) {
$key = $prefix . $showOrderBEField;
if (method_exists($this, 'getValueBE_' . $showOrderBEField)) {
$function = 'getValueBE_' . $showOrderBEField;
$paybox_data->{$showOrderBEField} = $this->{$function}($paybox_data->{$showOrderBEField});
}
$html .= $this->plugin->getHtmlRowBE($key, $paybox_data->{$showOrderBEField});
}
}
$html .= '<tr><td></td><td>
<a href="#" class="PayboxLogOpener" rel="' . $payment->id . '" >
<div style="background-color: white; z-index: 100; right:0; display: none; border:solid 2px; padding:10px;" class="vm-absolute" id="PayboxLog_' . $payment->id . '">';
foreach ($paybox_data as $key => $value) {
$langKey = 'VMPAYMENT_' . $prefix . $key;
if ($lang->hasKey($langKey)) {
$label = tsmText::_($langKey);
} else {
$label = $key;
}
$html .= ' <b>' . $label . '</b>: ' . wordwrap($value, 50, "\n", true) . '<br />';
}
$html .= ' </div>
<span class="icon-nofloat vmicon vmicon-16-xml"></span> ';
$html .= tsmText::_('VMPAYMENT_' . $this->plugin_name . '_VIEW_TRANSACTION_LOG');
$html .= ' </a>';
$html .= ' </td></tr>';
}
}
}
$html .= '</table>' . "\n";
$doc = JFactory::getDocument();
$js = "\njQuery().ready(function(\$) {\n\t\$('.PayboxLogOpener').click(function() {\n\t\tvar logId = \$(this).attr('rel');\n\t\t\$('#PayboxLog_'+logId).toggle();\n\t\treturn false;\n\t});\n});";
$doc->addScriptDeclaration($js);
return $html;
}
示例6: _check_email_amount_currency
protected function _check_email_amount_currency($payments, $paypal_data)
{
/*
* TODO Not checking yet because config do not have primary email address
* Primary email address of the payment recipient (that is, the merchant).
* If the payment is sent to a non-primary email address on your PayPal account,
* the receiver_email is still your primary email.
*/
if ($this->_method->paypalproduct == "std") {
if (strcasecmp($paypal_data['business'], $this->merchant_email) != 0) {
$errorInfo = array("paypal_data" => $paypal_data, 'merchant_email' => $this->merchant_email);
$this->debugLog($errorInfo, 'IPN notification: wrong merchant_email', 'error', false);
return false;
}
}
$result = false;
$payment_currency_code_3 = shopFunctions::getCurrencyByID($payments[0]->payment_currency, 'currency_code_3');
if ($this->_method->paypalproduct == "std" and $paypal_data['txn_type'] == 'cart') {
if (abs($payments[0]->payment_order_total - $paypal_data['mc_gross'] < abs($paypal_data['mc_gross'] * 0.001)) and $payment_currency_code_3 == $paypal_data['mc_currency']) {
$result = TRUE;
}
} else {
if ($payments[0]->payment_order_total == $paypal_data['mc_gross'] and $this->currency_code_3 == $paypal_data['mc_currency']) {
$result = TRUE;
}
}
if (!$result) {
$errorInfo = array("paypal_data" => $paypal_data, 'payment_order_total' => $payments[0]->payment_order_total, 'currency_code_3' => $payment_currency_code_3, 'testing Total-mc-gross' => $payments[0]->payment_order_total - $paypal_data['mc_gross'], 'testing Compare' => $paypal_data['mc_gross'] * 0.001, 'testing Result' => (int) abs($payments[0]->payment_order_total - $paypal_data['mc_gross'] < abs($paypal_data['mc_gross'] * 0.001)));
$this->debugLog($errorInfo, 'IPN notification with invalid amount or currency or email', 'error', false);
}
return $result;
}
示例7: plgVmOnShowOrderBEPayment
/**
* Display stored payment data for an order
*
* @see components/com_virtuemart/helpers/vmPSPlugin::plgVmOnShowOrderBEPayment()
*/
function plgVmOnShowOrderBEPayment($virtuemart_order_id, $payment_method_id)
{
if (!$this->selectedThisByMethodId($payment_method_id)) {
return NULL;
// Another method was selected, do nothing
}
$db = JFactory::getDBO();
$q = 'SELECT * FROM `' . $this->_tablename . '` WHERE ';
$q .= ' `virtuemart_order_id` = ' . $virtuemart_order_id;
$db->setQuery($q);
$payments = $db->loadObjectList();
$html = '<table class="adminlist" >' . "\n";
$html .= $this->getHtmlHeaderBE();
$first = TRUE;
$lang = JFactory::getLanguage();
foreach ($payments as $payment) {
$html .= '<tr class="row1"><td>' . vmText::_('VMPAYMENT_KLIKANDPAY_DATE') . '</td><td align="left">' . $payment->created_on . '</td></tr>';
// Now only the first entry has this data when creating the order
if ($first) {
$html .= $this->getHtmlRowBE('KLIKANDPAY_PAYMENT_NAME', $payment->payment_name);
// keep that test to have it backwards compatible. Old version was deleting that column when receiving an IPN notification
if ($payment->payment_order_total and $payment->payment_order_total != 0.0) {
$html .= $this->getHtmlRowBE('KLIKANDPAY_PAYMENT_ORDER_TOTAL', $payment->payment_order_total . " " . shopFunctions::getCurrencyByID($payment->payment_currency, 'currency_code_3'));
}
if ($payment->email_currency and $payment->email_currency != 0) {
//$html .= $this->getHtmlRowBE('KLIKANDPAY_PAYMENT_EMAIL_CURRENCY', shopFunctions::getCurrencyByID($payment->email_currency, 'currency_code_3'));
}
if ($payment->recurring) {
$recurring_html = '<table class="adminlist table">' . "\n";
$recurring = json_decode($payment->recurring);
$recurring_html .= $this->getHtmlRowBE('VMPAYMENT_KLIKANDPAY_RECURRING_MONTANT', $recurring->MONTANT);
if (isset($recurring->MONTANT2)) {
$recurring_html .= $this->getHtmlRowBE('VMPAYMENT_KLIKANDPAY_RECURRING_MONTANT2', $recurring->MONTANT2);
}
if (isset($recurring->EXTRA)) {
$recurring_html .= $this->getHtmlRowBE('VMPAYMENT_KLIKANDPAY_RECURRING_EXTRA', $recurring->EXTRA);
}
if (isset($recurring->DATE2)) {
$recurring_html .= $this->getHtmlRowBE('VMPAYMENT_KLIKANDPAY_RECURRING_DATE2', $recurring->DATE2);
}
$recurring_html .= '</table>' . "\n";
$html .= $this->getHtmlRowBE('KLIKANDPAY_RECURRING', $recurring_html);
}
$first = FALSE;
} else {
$showOrderBEFields = $this->getOrderBEFields();
$keyPrefix = 'KLIKANDPAY_RESPONSE_';
$dbPrefix = 'klikandpay_response_';
foreach ($showOrderBEFields as $showOrderBEField) {
$orderField = $dbPrefix . $showOrderBEField;
if (isset($payment->{$orderField}) and !empty($payment->{$orderField})) {
$key = $keyPrefix . $showOrderBEField;
if (method_exists($this, 'getValueBE_' . $orderField)) {
$function = 'getValueBE_' . $orderField;
$payment->{$orderField} = $this->{$function}($payment->{$orderField});
}
$html .= $this->getHtmlRowBE($key, $payment->{$orderField});
}
}
$html .= '<tr><td></td><td>
<a href="#" class="KlikandpayLogOpener" rel="' . $payment->id . '" >
<div style="background-color: white; z-index: 100; right:0; display: none; border:solid 2px; padding:10px;" class="vm-absolute" id="KlikandpayLog_' . $payment->id . '">';
$klikandpay_data = json_decode($payment->klikandpay_fullresponse);
foreach ($klikandpay_data as $key => $value) {
$langKey = 'VMPAYMENT_' . $keyPrefix . $key;
if ($lang->hasKey($langKey)) {
$label = vmText::_($langKey);
} else {
$label = $key;
}
$html .= ' <b>' . $label . '</b>: ' . wordwrap($value, 50, "\n", true) . '<br />';
}
$html .= ' </div>
<span class="icon-nofloat vmicon vmicon-16-xml"></span> ';
$html .= vmText::_('VMPAYMENT_KLIKANDPAY_VIEW_TRANSACTION_LOG');
$html .= ' </a>';
$html .= ' </td></tr>';
}
}
$html .= '</table>' . "\n";
$doc = JFactory::getDocument();
$js = "\n\tjQuery().ready(function(\$) {\n\t\t\$('.KlikandpayLogOpener').click(function() {\n\t\t\tvar logId = \$(this).attr('rel');\n\t\t\t\$('#KlikandpayLog_'+logId).toggle();\n\t\t\treturn false;\n\t\t});\n\t});";
$doc->addScriptDeclaration($js);
return $html;
}
示例8: setPaymentCurrency
public function setPaymentCurrency()
{
vmPSPlugin::getPaymentCurrency($this->_method);
$this->currency_code_3 = shopFunctions::getCurrencyByID($this->_method->payment_currency, 'currency_code_3');
}
示例9: getPaypalPaymentCurrency
function getPaypalPaymentCurrency ($getCurrency = FALSE) {
vmPSPlugin::getPaymentCurrency($this->_method);
$this->currency_code_3 = shopFunctions::getCurrencyByID($this->_method->payment_currency, 'currency_code_3');
}
示例10: plgVmOnShowOrderBEPayment
/**
* @param $virtuemart_order_id
* @param $payment_method_id
* @return null|string
*/
function plgVmOnShowOrderBEPayment($virtuemart_order_id, $payment_method_id)
{
if (!$this->selectedThisByMethodId($payment_method_id)) {
return NULL;
// Another method was selected, do nothing
}
if (!($this->_currentMethod = $this->getVmPluginMethod($payment_method_id))) {
return NULL;
// Another method was selected, do nothing
}
if (!($payments = $this->getDatasByOrderId($virtuemart_order_id))) {
// JError::raiseWarning(500, $db->getErrorMsg());
return '';
}
$this->initKlarnaParams();
$html = '<table class="adminlist table" >' . "\n";
$html .= $this->getHtmlHeaderBE();
$first = TRUE;
$code = "klarna";
$prefix = "KLARNACHECKOUT_";
foreach ($payments as $key => $payment) {
$html .= '<tr class="row1"><td><strong>' . JText::_('VMPAYMENT_KLARNACHECKOUT_DATE') . '</strong></td><td align="left"><strong>' . $payment->created_on . '</strong></td></tr>';
// Now only the first entry has this data when creating the order
if ($first) {
$html .= $this->getHtmlRowBE('KLARNACHECKOUT_PAYMENT_NAME', $payment->payment_name);
// keep that test to have it backwards compatible. Old version was deleting that column when receiving an IPN notification
if ($payment->payment_order_total and $payment->payment_order_total != 0.0) {
$html .= $this->getHtmlRowBE('KLARNACHECKOUT_PAYMENT_ORDER_TOTAL', $payment->payment_order_total . " " . shopFunctions::getCurrencyByID($payment->payment_currency, 'currency_code_3'));
}
if (!empty($payment->email_currency) and $payment->email_currency != 0) {
$html .= $this->getHtmlRowBE('KLARNACHECKOUT_PAYMENT_EMAIL_CURRENCY', shopFunctions::getCurrencyByID($payment->email_currency, 'currency_code_3'));
}
$first = FALSE;
}
// TODO go though the SQL table to have the fields in the correct order
foreach ($payment as $key => $value) {
// only displays if there is a value or the value is different from 0.00 and the value
if ($value) {
if (substr($key, 0, strlen($code)) == $code) {
$html .= $this->getHtmlRowBE($prefix . $key, $value);
}
}
}
if ($payment->action == 'activate') {
$vm_invoice_name = '';
$data = json_decode($payment->data);
$invoice_number = $data[1];
$klarnaCheckoutInterface = $this->_loadKlarnaCheckoutInterface();
$invoiceURL = $klarnaCheckoutInterface->getInvoice($invoice_number, $vm_invoice_name);
$html .= $this->getHtmlRowBE(vmText::_('VMPAYMENT_KLARNACHECKOUT_INVOICE_NUMBER'), $invoice_number);
//$invoicePdfLink = $klarnaCheckoutInterface->getInvoicePdfLink($payment->virtuemart_order_id);
$value = '<a target="_blank" href="' . $invoiceURL . '">' . vmText::_('VMPAYMENT_KLARNACHECKOUT_VIEW_INVOICE') . '</a>';
$html .= $this->getHtmlRowBE("", $value);
}
if ($this->_currentMethod->debug) {
$html .= $this->getTransactionLogContent($payment);
}
}
$html .= '</table>' . "\n";
if ($this->_currentMethod->debug) {
$doc = JFactory::getDocument();
$js = "\njQuery().ready(function(\$) {\n\t\$('.kcoLogOpener').click(function() {\n\t\tvar logId = \$(this).attr('rel');\n\t\t\$('#kcoLog_'+logId).toggle();\n\t\treturn false;\n\t});\n\t\$('.kcoDetailsOpener').click(function() {\n\t\tvar detailsId = \$(this).attr('rel');\n\t\t\$('#kcoDetails_'+detailsId).toggle();\n\t\treturn false;\n\t});\n});";
$doc->addScriptDeclaration($js);
}
return $html;
}
示例11: plgVmConfirmedOrder
/**
*
*
* @author Valérie Isaksen
*/
function plgVmConfirmedOrder($cart, $order)
{
$paymentId = $order['details']['BT']->virtuemart_paymentmethod_id;
if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
return NULL;
// Another method was selected, do nothing
}
if (!$this->selectedThisElement($method->payment_element)) {
return FALSE;
}
$lang = JFactory::getLanguage();
$filename = 'com_virtuemart';
$lang->load($filename, JPATH_ADMINISTRATOR);
if (!class_exists('VirtueMartModelOrders')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
}
$this->getPaymentCurrency($method);
$currency_code_3 = shopFunctions::getCurrencyByID($method->payment_currency, 'currency_code_3');
$email_currency = $this->getEmailCurrency($method);
$totalInPaymentCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $method->payment_currency);
$dbValues['payment_name'] = $this->renderPluginName($method) . '<br />' . $method->payment_info;
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['virtuemart_paymentmethod_id'] = $order['details']['BT']->virtuemart_paymentmethod_id;
$dbValues['cost_per_transaction'] = $method->cost_per_transaction;
$dbValues['cost_percent_total'] = $method->cost_percent_total;
$dbValues['payment_currency'] = $currency_code_3;
$dbValues['email_currency'] = $email_currency;
$dbValues['payment_order_total'] = $totalInPaymentCurrency['value'];
$dbValues['tax_id'] = $method->tax_id;
$this->storePSPluginInternalData($dbValues);
$currency = CurrencyDisplay::getInstance('', $order['details']['BT']->virtuemart_vendor_id);
$param = array("login_id" => $method->api_login_id, "password" => $method->api_password, "prod_id" => $method->api_product_id, "ttype" => "NBFundTransfer", "ordernum" => $dbValues['order_number'], "amount" => $order['details']['BT']->order_total, "curr" => "INR", "txnamt" => "0", "client_code" => "007", "customer_acc_no" => "1234567890", "paynetz_url" => $method->api_merchant_url);
//$this->updateRecords( $dbValues['order_number'], $order['details']['BT']->order_total, $d );
$this->requestMerchant($param, $paymentId);
/*
$app = JFactory::getApplication();
$app->redirect($url);
*/
$html = '<table class="vmorder-done">' . "\n";
$html .= $this->getHtmlRow('paynetz_PAYMENT_INFO', $dbValues['payment_name'], 'class="vmorder-done-payinfo"');
if (!empty($payment_info)) {
$lang = JFactory::getLanguage();
if ($lang->hasKey($method->payment_info)) {
$payment_info = JText::_($method->payment_info);
} else {
$payment_info = $method->payment_info;
}
$html .= $this->getHtmlRow('paynetz_PAYMENTINFO', $payment_info, 'class="vmorder-done-payinfo"');
}
if (!class_exists('VirtueMartModelCurrency')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php';
}
$html .= $this->getHtmlRow('paynetz_ORDER_NUMBER', $order['details']['BT']->order_number, 'class="vmorder-done-nr"');
$html .= $this->getHtmlRow('paynetz_AMOUNT', $currency->priceDisplay($order['details']['BT']->order_total), 'class="vmorder-done-amount"');
if ($method->payment_currency != $order['details']['BT']->order_currency) {
$html .= $this->getHtmlRow('COM_VIRTUEMART_CART_TOTAL_PAYMENT', $totalInPaymentCurrency['display'], 'class="vmorder-done-amount"');
}
//$html .= $this->getHtmlRow('paynetz_INFO', $method->payment_info);
//$html .= $this->getHtmlRow('paynetz_AMOUNT', $totalInPaymentCurrency.' '.$currency_code_3);
$html .= '</table>' . "\n";
$modelOrder = VmModel::getModel('orders');
$order['order_status'] = $this->getNewStatus($method);
$order['customer_notified'] = 1;
$order['comments'] = '';
$modelOrder->updateStatusForOneOrder($order['details']['BT']->virtuemart_order_id, $order, TRUE);
//We delete the old stuff
$cart->emptyCart();
JRequest::setVar('html', $html);
return TRUE;
}
示例12: showOrderBEPayment
private function showOrderBEPayment($virtuemart_order_id, $payments)
{
$db = JFactory::getDBO();
$query = 'SHOW COLUMNS FROM `' . $this->_tablename . '` ';
$db->setQuery($query);
$columns = $db->loadColumn(0);
$html = '';
$first = TRUE;
$lang = JFactory::getLanguage();
foreach ($payments as $payment) {
if ($payment->amazon_class_request_type) {
$this->loadAmazonClass($payment->amazon_class_request_type);
}
if ($payment->amazon_class_response_type) {
$this->loadAmazonClass($payment->amazon_class_response_type);
}
if ($payment->amazon_class_notification_type) {
$this->loadAmazonClass($payment->amazon_class_notification_type);
}
$html .= '<tr class="row1"><td><strong>' . vmText::_('VMPAYMENT_AMAZON_DATE') . '</strong></td><td align="left"><strong>' . $payment->created_on . '</strong></td></tr>';
// Now only the first entry has this data when creating the order
if ($first) {
$html .= $this->getHtmlRowBE('AMAZON_PAYMENT_NAME', $payment->payment_name);
// keep that test to have it backwards compatible. Old version was deleting that column when receiving an IPN notification
if ($payment->payment_order_total and $payment->payment_order_total != 0.0) {
$html .= $this->getHtmlRowBE('COM_VIRTUEMART_TOTAL', $payment->payment_order_total * 0.01 . " " . shopFunctions::getCurrencyByID($payment->payment_currency, 'currency_code_3'));
}
if ($payment->email_currency and $payment->email_currency != 0) {
//$html .= $this->getHtmlRowBE($this->_name.'_PAYMENT_EMAIL_CURRENCY', shopFunctions::getCurrencyByID($payment->email_currency, 'currency_code_3'));
}
$first = FALSE;
} else {
$amazon_classes = array();
/*
if (!empty($payment->amazon_request)) {
$amazon_data = unserialize($payment->amazon_request);
$amazon_classes[get_class($amazon_data)] = $payment->amazon_request;
}
*/
$this->loadAmazonServicesClasses();
$this->loadAmazonNotificationClasses();
if (!empty($payment->amazon_request)) {
$amazon_classes[$payment->amazon_class_request_type] = $payment->amazon_request;
$vmClass = $this->getVmClass($payment->amazon_class_request_type);
$html .= $this->getHtmlRowBE(vmText::_('VMPAYMENT_AMAZON_REQUEST_TYPE'), vmText::_('VMPAYMENT_AMAZON_REQUEST_TYPE_' . $vmClass));
$transactionLogContent = $this->getTransactionLogContent($payment->amazon_class_request_type, $payment->amazon_request, $payment);
if (empty($transactionLogContent)) {
vmError("getTransactionLogContent" . $payment->amazon_class_request_type . ' ');
vmError("getTransactionLogContent" . $payment->amazon_request . ' ');
}
$html .= $transactionLogContent;
}
if (!empty($payment->amazon_response)) {
$vmClass = $this->getVmClass($payment->amazon_class_response_type);
$amazon_classes[$payment->amazon_class_response_type] = $payment->amazon_response;
$html .= $this->getHtmlRowBE(vmText::_('VMPAYMENT_AMAZON_RESPONSE_TYPE'), vmText::_('VMPAYMENT_AMAZON_RESPONSE_TYPE_' . $vmClass));
$html .= $this->getResponseData($payment);
$html .= $this->getTransactionLogContent($payment->amazon_class_response_type, $payment->amazon_response, $payment);
} elseif (!empty($payment->amazon_notification)) {
$amazon_classes[$payment->amazon_class_notification_type] = $payment->amazon_notification;
$vmClass = $this->getVmClass($payment->amazon_class_notification_type);
$html .= $this->getHtmlRowBE(vmText::_('VMPAYMENT_AMAZON_NOTIFICATION_TYPE'), vmText::_('VMPAYMENT_AMAZON_NOTIFICATION_TYPE_' . $vmClass));
$html .= $this->getResponseData($payment);
$html .= $this->getTransactionLogContent($payment->amazon_class_notification_type, $payment->amazon_notification, $payment);
}
}
}
$doc = JFactory::getDocument();
$js = "\njQuery().ready(function(\$) {\n\t\$('.amazonLogOpener').click(function() {\n\t\tvar logId = \$(this).attr('rel');\n\t\t\$('#amazonLog_'+logId).toggle();\n\t\treturn false;\n\t});\n\t\$('.amazonDetailsOpener').click(function() {\n\t\tvar detailsId = \$(this).attr('rel');\n\t\t\$('#amazonDetails_'+detailsId).toggle();\n\t\treturn false;\n\t});\n});";
$doc->addScriptDeclaration($js);
return $html;
}
示例13: plgVmDisplayListFEPayment
/**
* plgVmDisplayListFEPayment
* This event is fired to display the pluginmethods in the cart (edit shipment/payment) for example
*
* @param object $cart Cart object
* @param integer $selected ID of the method selected
* @return boolean True on succes, false on failures, null when this plugin was not selected.
* On errors, JError::raiseWarning (or JError::raiseError) must be used to set a message.
*
* @author Valerie Isaksen
* @author Max Milbers
*/
public function plgVmDisplayListFEPayment(VirtueMartCart $cart, $selected = 0, &$htmlIn)
{
if (PagSeguroCurrencies::checkCurrencyAvailabilityByIsoCode(shopFunctions::getCurrencyByID($cart->pricesCurrency, 'currency_code_3'))) {
return $this->displayListFE($cart, $selected, $htmlIn);
}
return false;
}
示例14: plgVmConfirmedOrder
function plgVmConfirmedOrder($cart, $order)
{
if (!($method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
return NULL;
// Another method was selected, do nothing
}
if (!$this->selectedThisElement($method->payment_element)) {
return FALSE;
}
$session = JFactory::getSession();
$return_context = $session->getId();
$this->_debug = $method->HEIDELPAY_DEBUG;
if (!class_exists('VirtueMartModelOrders')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'orders.php';
}
if (!class_exists('VirtueMartModelCurrency')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'currency.php';
}
$address = isset($order['details']['BT']) ? $order['details']['BT'] : $order['details']['ST'];
if (!class_exists('TableVendors')) {
require VMPATH_ADMIN . DS . 'table' . DS . 'vendors.php';
}
$vendorModel = VmModel::getModel('Vendor');
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
$vendorModel->addImages($vendor, 1);
$this->getPaymentCurrency($method);
$currency_code_3 = shopFunctions::getCurrencyByID($method->payment_currency, 'currency_code_3');
$paymentCurrency = CurrencyDisplay::getInstance($method->payment_currency);
$totalInPaymentCurrency = round($paymentCurrency->convertCurrencyTo($method->payment_currency, $order['details']['BT']->order_total, FALSE), 2);
$cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
// prepare the post var values:
$languageTag = $this->getLang();
$params = array();
/*
* Default configuration for hco
*/
$params['FRONTEND.MODE'] = "DEFAULT";
$params['FRONTEND.ENABLED'] = "true";
$params['FRONTEND.POPUP'] = "false";
$params['FRONTEND.REDIRECT_TIME'] = "0";
$params['REQUEST.VERSION'] = "1.0";
$params['FRONTEND.NEXTTARGET'] = "top.location.href";
$params['PRESENTATION.AMOUNT'] = $totalInPaymentCurrency;
$params['PRESENTATION.CURRENCY'] = $currency_code_3;
$params['FRONTEND.LANGUAGE'] = $languageTag;
$params['CRITERION.LANG'] = $params['FRONTEND.LANGUAGE'];
$params['IDENTIFICATION.TRANSACTIONID'] = $order['details']['BT']->order_number;
/*
* Set payment methode to PA for online transfer, invoice and prepayment
*/
$PaymentTypePA = array('OT', 'PP', 'IV');
if (in_array(substr($method->HEIDELPAY_PAYMENT_TYPE, 0, 2), $PaymentTypePA)) {
$method->HEIDELPAY_PAYMENT_METHOD = "PA";
} else {
$method->HEIDELPAY_PAYMENT_METHOD = $method->HEIDELPAY_PAYMENT_METHOD;
}
$params['PAYMENT.CODE'] = substr($method->HEIDELPAY_PAYMENT_TYPE, 0, 2) . "." . $method->HEIDELPAY_PAYMENT_METHOD;
$params['TRANSACTION.CHANNEL'] = $method->HEIDELPAY_CHANNEL_ID;
/*
* Special case for paypal without hco iframe
*/
if ($method->HEIDELPAY_PAYMENT_TYPE == "VAPAYPAL") {
$params['PAYMENT.CODE'] = "VA.DB";
$params['ACCOUNT.BRAND'] = "PAYPAL";
$params['FRONTEND.PM.DEFAULT_DISABLE_ALL'] = "true";
$params['FRONTEND.PM.0.ENABLED'] = "true";
$params['FRONTEND.PM.0.METHOD'] = "VA";
$params['FRONTEND.PM.0.SUBTYPES'] = "PAYPAL";
}
/*
* Special case for MangirKart without hco iframe
*/
if ($method->HEIDELPAY_PAYMENT_TYPE == "PCMANGIR") {
$params['PAYMENT.CODE'] = "PC.PA";
$params['ACCOUNT.BRAND'] = "MANGIRKART";
}
/*
* case for GiroPay
*/
if ($method->HEIDELPAY_PAYMENT_TYPE == "OTGIR") {
$params['FRONTEND.SEPA'] = 'YES';
$params['FRONTEND.SEPASWITCH'] = 'NO';
}
/*
* Special case for BarPay without hco iframe
*/
if ($method->HEIDELPAY_PAYMENT_TYPE == "PPBARPAY") {
$params['PAYMENT.CODE'] = "PP.PA";
$params['ACCOUNT.BRAND'] = "BARPAY";
}
/*
* Special case for BillSAFE
*/
if ($method->HEIDELPAY_PAYMENT_TYPE == "IVBILLSAFE") {
$toCheck = array('last_name', 'first_name', 'middle_name', 'phone_1', 'phone_2', 'fax', 'address_1', 'address_2', 'city', 'virtuemart_state_id', 'virtuemart_country_id', 'zip');
$bsError = false;
foreach ($toCheck as $val) {
if (isset($order['details']['ST']->{$val})) {
if ($order['details']['ST']->{$val} != $order['details']['BT']->{$val}) {
//.........这里部分代码省略.........
示例15: plgVmOnShowOrderBEPayment
/**
* Display stored payment data for an order
* @param int $virtuemart_order_id
* @param int $payment_method_id
* @see components/com_virtuemart/helpers/vmPSPlugin::plgVmOnShowOrderBEPayment()
*/
function plgVmOnShowOrderBEPayment($virtuemart_order_id, $payment_method_id)
{
if (!$this->selectedThisByMethodId($payment_method_id)) {
return NULL;
// Another method was selected, do nothing
}
if (!($payments = $this->getDatasByOrderId($virtuemart_order_id))) {
// JError::raiseWarning(500, $db->getErrorMsg());
return '';
}
$html = '<table class="adminlist" width="50%">' . "\n";
$html .= $this->getHtmlHeaderBE();
$code = "sofort_ideal_response_";
$first = TRUE;
foreach ($payments as $payment) {
$html .= '<tr class="row1"><td>' . JText::_('COM_VIRTUEMART_DATE') . '</td><td align="left">' . $payment->created_on . '</td></tr>';
// Now only the first entry has this data when creating the order
if ($first) {
$html .= $this->getHtmlRowBE('COM_VIRTUEMART_PAYMENT_NAME', $payment->payment_name);
if ($payment->payment_order_total and $payment->payment_order_total != 0.0) {
$html .= $this->getHtmlRowBE('SOFORT_PAYMENT_ORDER_TOTAL', $payment->payment_order_total . " " . shopFunctions::getCurrencyByID($payment->payment_currency, 'currency_code_3'));
}
$html .= $this->getHtmlRowBE('SOFORT_PAYMENT_EMAIL_CURRENCY', shopFunctions::getCurrencyByID($payment->payment_currency, 'currency_code_3'));
$first = FALSE;
} else {
foreach ($payment as $key => $value) {
// only displays if there is a value or the value is different from 0.00 and the value
if ($value) {
if (substr($key, 0, strlen($code)) == $code) {
$html .= $this->getHtmlRowBE($key, $value);
}
}
}
}
}
$html .= '</table>' . "\n";
return $html;
}