本文整理汇总了PHP中vmPSPlugin::getAmountInCurrency方法的典型用法代码示例。如果您正苦于以下问题:PHP vmPSPlugin::getAmountInCurrency方法的具体用法?PHP vmPSPlugin::getAmountInCurrency怎么用?PHP vmPSPlugin::getAmountInCurrency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmPSPlugin
的用法示例。
在下文中一共展示了vmPSPlugin::getAmountInCurrency方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getExtraPluginNameInfo
function getExtraPluginNameInfo()
{
if (!class_exists('VirtueMartCart')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'cart.php';
}
$cart = VirtueMartCart::getCart();
//if (!isset($cart->cartPrices)) {
$cart->getCartPrices();
//}
$pbxTotalVendorCurrency = $this->getPbxAmount($cart->cartPrices['salesPrice']);
$subscribe = $this->getSubscribeProducts($cart, $pbxTotalVendorCurrency);
$extraInfo = false;
if (!empty($subscribe)) {
$extraInfo['subscribe'] = true;
$amount2montInCurrency = vmPSPlugin::getAmountInCurrency($subscribe['PBX_2MONT'] * 0.01, $this->_method->payment_currency);
$amount1montInCurrency = vmPSPlugin::getAmountInCurrency($subscribe['PBX_TOTAL'] * 0.01, $this->_method->payment_currency);
$extraInfo['subscribe_2mont'] = $amount2montInCurrency['display'];
$extraInfo['subscribe_1mont'] = $amount1montInCurrency['display'];
$extraInfo['subscribe_nbpaie'] = $subscribe['PBX_NBPAIE'];
$extraInfo['subscribe_freq'] = $subscribe['PBX_FREQ'];
$extraInfo['subscribe_quand'] = $this->_method->subscribe_quand;
$extraInfo['subscribe_delais'] = $this->_method->subscribe_delais;
}
return $extraInfo;
}
示例2: 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);
}
示例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);
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;
}
示例4: 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;
}
示例5: getCartItems
function getCartItems($cart, &$klarnaOrderData)
{
//vmdebug('getProductItems', $cart->pricesUnformatted);
//self::includeKlarnaFiles();
$i = 0;
if (!class_exists('CurrencyDisplay')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php';
}
foreach ($cart->products as $pkey => $product) {
// Possible values: physical (default) , discount, shipping_fee
$items[$i]['type'] = 'physical';
$items[$i]['reference'] = !empty($product->sku) ? $product->sku : $product->virtuemart_product_id;
//Article number, SKU or similar.
$items[$i]['name'] = substr(strip_tags($product->product_name), 0, 127);
$items[$i]['quantity'] = (int) $product->quantity;
if (!empty($product->product_unit)) {
// quantity_unit: Max 10 characters. Unit used to describe the quantity, e.g. kg, pcs.
$items[$i]['quantity_unit'] = $product->product_unit;
}
$price = !empty($product->prices['basePriceWithTax']) ? $product->prices['basePriceWithTax'] : $product->prices['basePriceVariant'];
$itemInPaymentCurrency = vmPSPlugin::getAmountInCurrency($price, $this->_currentMethod->payment_currency);
$items[$i]['unit_price'] = round($itemInPaymentCurrency['value'] * 100, 0);
// Minor units. Includes tax, excludes discount.
$tax_rate = round($this->getVatTaxProduct($cart->cartPrices[$pkey]['VatTax']));
$items[$i]['tax_rate'] = $tax_rate * 100;
// Non-negative. In percent, two implicit decimals. I.e 2500 = 25%.
// ADD A DISCOUNT AS A NEGATIVE VALUE FOR THAT PRODUCT
if ($cart->cartPrices[$pkey]['discountAmount'] != 0.0) {
$discount_tax_percent = 0.0;
$discountInPaymentCurrency = vmPSPlugin::getAmountInCurrency(abs($cart->cartPrices[$pkey]['discountAmount']), $this->_currentMethod->payment_currency);
$discountAmount = -abs(round($discountInPaymentCurrency['value'] * 100, 0));
$items[$i]['discount_rate'] = round($discountAmount * (1 + $tax_rate * 0.01), 0);
}
// total_discount_amount integer O Non-negative minor units. Includes tax.
$items[$i]['total_discount_amount'] = 0;
//total_tax_amount Must be within ±1 of total_amount - total_amount * 10000 / (10000 + tax_rate). Negative when type is discount.
$totalTaxInPaymentCurrency = vmPSPlugin::getAmountInCurrency($product->prices['taxAmount'] * $product->quantity, $this->_currentMethod->payment_currency);
$items[$i]['total_tax_amount'] = round($totalTaxInPaymentCurrency['value'] * 100, 0);
// total_amount: Includes tax and discount. Must match (quantity * unit_price) - total_discount_amount within ±quantity.
$totalAmountInPaymentCurrency = vmPSPlugin::getAmountInCurrency($product->prices['salesPrice'] * $product->quantity, $this->_currentMethod->payment_currency);
$items[$i]['total_amount'] = round($totalAmountInPaymentCurrency['value'] * 100, 0);
$i++;
}
$i--;
if ($cart->cartPrices['salesPriceCoupon']) {
$i++;
$items[$i]['type'] = 'physical';
$items[$i]['reference'] = 'COUPON';
$items[$i]['name'] = 'Coupon discount';
// TODO GET coupon NAME
$items[$i]['quantity'] = 1;
$couponInPaymentCurrency = vmPSPlugin::getAmountInCurrency($cart->cartPrices['salesPriceCoupon'], $this->_currentMethod->payment_currency);
$items[$i]['unit_price'] = round($couponInPaymentCurrency['value'] * 100, 0);
$items[$i]['tax_rate'] = 0;
//$this->debugLog($cart->cartPrices['salesPriceCoupon'], 'getCartItems Coupon', 'debug');
//$this->debugLog($items[$i], 'getCartItems', 'debug');
$i++;
}
if ($cart->cartPrices['salesPriceShipment']) {
$i++;
$items[$i]['type'] = 'shipping_fee';
$items[$i]['reference'] = 'SHIPPING';
$items[$i]['name'] = substr(strip_tags($cart->cartData['shipmentName']), 0, 127);
$items[$i]['quantity'] = 1;
$shipmentInPaymentCurrency = vmPSPlugin::getAmountInCurrency($cart->cartPrices['salesPriceShipment'], $this->_currentMethod->payment_currency);
$items[$i]['unit_price'] = round($shipmentInPaymentCurrency['value'] * 100, 0);
$items[$i]['tax_rate'] = $this->getTaxShipment($cart);
$shipmentTaxInPaymentCurrency = vmPSPlugin::getAmountInCurrency($cart->cartPrices['shipmentTax'], $this->_currentMethod->payment_currency);
$items[$i]['total_tax_amount'] = round($shipmentTaxInPaymentCurrency['value'] * 100, 0);
$items[$i]['total_amount'] = $items[$i]['unit_price'];
//$this->debugLog($cart->cartPrices['salesPriceShipment'], 'getCartItems Shipment', 'debug');
//$this->debugLog($items[$i], 'getCartItems', 'debug');
}
$klarnaOrderData['order_lines'] = $items;
$orderAmountInPaymentCurrency = vmPSPlugin::getAmountInCurrency($cart->cartPrices['billTotal'], $this->_currentMethod->payment_currency);
$klarnaOrderData['order_amount'] = round($orderAmountInPaymentCurrency['value'] * 100, 0);
$orderTaxAmountInPaymentCurrency = vmPSPlugin::getAmountInCurrency($cart->cartPrices['billTaxAmount'], $this->_currentMethod->payment_currency);
$klarnaOrderData['order_tax_amount'] = round($orderTaxAmountInPaymentCurrency['value'] * 100, 0);
$currency = CurrencyDisplay::getInstance($cart->paymentCurrency);
return;
}
示例6: 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 JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php';
}
if (!class_exists('VirtueMartModelCurrency')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'currency.php';
}
$address = isset($order['details']['ST']) ? $order['details']['ST'] : $order['details']['BT'];
if (!class_exists('TableVendors')) {
require JPATH_VM_ADMINISTRATOR . DS . 'tables' . 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');
$totalInPaymentCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $method->payment_currency);
$cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
// prepare the post var values:
$languageTag = $this->getLang();
$params = array();
$params['PRESENTATION.AMOUNT'] = $totalInPaymentCurrency['value'];
$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";
}
/*
* Special case for BarPay without hco iframe
*/
if ($method->HEIDELPAY_PAYMENT_TYPE == "PPBARPAY") {
$params['PAYMENT.CODE'] = "PP.PA";
$params['ACCOUNT.BRAND'] = "BARPAY";
}
/*
* User account information
*/
$params['ACCOUNT.HOLDER'] = $address->first_name . " " . $address->last_name;
$params['NAME.GIVEN'] = $address->first_name;
$params['NAME.FAMILY'] = $address->last_name;
$params['ADDRESS.STREET'] = $address->address_1;
isset($address->address_2) ? $params['ADDRESS.STREET'] .= " " . $address->address_2 : '';
$params['ADDRESS.ZIP'] = $address->zip;
$params['ADDRESS.CITY'] = $address->city;
$params['ADDRESS.COUNTRY'] = ShopFunctions::getCountryByID($address->virtuemart_country_id, 'country_2_code');
$params['CONTACT.EMAIL'] = $order['details']['BT']->email;
$params['CONTACT.IP'] = $_SERVER['REMOTE_ADDR'];
/*
* Add debug informations for merchiant support
*/
$params['SHOP.TYPE'] = 'VirtueMart2.0.24b';
$params['SHOPMODUL.VERSION'] = $this->version;
$params['CRITERION.PAYMENT_NAME'] = JText::_('VMPAYMENT_HEIDELPAY_' . $method->HEIDELPAY_PAYMENT_TYPE);
$params['CRITERION.PAYMENT_NAME'] = strip_tags($params['CRITERION.PAYMENT_NAME']);
/*
* Create hash to secure the response
*/
$params['CRITERION.SECRET'] = $this->createSecretHash($order['details']['BT']->order_number, $method->HEIDELPAY_SECRET);
/*
* Set transaction mode
//.........这里部分代码省略.........
示例7: plgVmConfirmedOrder
/**
* Reimplementation of vmPaymentPlugin::plgVmOnConfirmedOrder()
*
* @link http://www.authorize.net/support/AIM_guide.pdf
* Credit Cards Test Numbers
* Visa Test Account 4007000000027
* Amex Test Account 370000000000002
* Master Card Test Account 6011000000000012
* Discover Test Account 5424000000000015
* @author Valerie Isaksen
*/
function plgVmConfirmedOrder(VirtueMartCart $cart, $order)
{
if (!($this->_currentMethod = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
return NULL;
// Another method was selected, do nothing
}
if (!$this->selectedThisElement($this->_currentMethod->payment_element)) {
return FALSE;
}
$this->setInConfirmOrder($cart);
$usrBT = $order['details']['BT'];
$usrST = isset($order['details']['ST']) ? $order['details']['ST'] : '';
$session = JFactory::getSession();
$return_context = $session->getId();
$payment_currency_id = shopFunctions::getCurrencyIDByName(self::AUTHORIZE_DEFAULT_PAYMENT_CURRENCY);
$totalInPaymentCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $payment_currency_id);
$cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
// Set up data
$formdata = array();
$formdata = array_merge($this->_setHeader(), $formdata);
$formdata = array_merge($this->_setResponseConfiguration(), $formdata);
$formdata = array_merge($this->_setBillingInformation($usrBT), $formdata);
if (!empty($usrST)) {
$formdata = array_merge($this->_setShippingInformation($usrST), $formdata);
}
$formdata = array_merge($this->_setTransactionData($order['details']['BT'], $totalInPaymentCurrency['value']), $formdata);
$formdata = array_merge($this->_setMerchantData(), $formdata);
// prepare the array to post
$poststring = '';
foreach ($formdata as $key => $val) {
$poststring .= urlencode($key) . "=" . urlencode($val) . "&";
}
$poststring = rtrim($poststring, "& ");
// Prepare data that should be stored in the database
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['virtuemart_order_id'] = $order['details']['BT']->virtuemart_order_id;
$dbValues['payment_method_id'] = $order['details']['BT']->virtuemart_paymentmethod_id;
$dbValues['return_context'] = $return_context;
$dbValues['payment_name'] = parent::renderPluginName($this->_currentMethod);
$dbValues['cost_per_transaction'] = $this->_currentMethod->cost_per_transaction;
$dbValues['cost_percent_total'] = $this->_currentMethod->cost_percent_total;
$dbValues['payment_order_total'] = $totalInPaymentCurrency['value'];
$dbValues['payment_currency'] = $payment_currency_id;
$this->debugLog("before store", "plgVmConfirmedOrder", 'debug');
$this->storePSPluginInternalData($dbValues);
// send a request
$response = $this->_sendRequest($poststring);
$this->debugLog($response, "plgVmConfirmedOrder", 'debug');
$authnet_values = array();
// to check the values???
// evaluate the response
$html = $this->_handleResponse($response, $authnet_values, $order, $dbValues['payment_name']);
if ($this->error) {
$new_status = $this->_currentMethod->payment_declined_status;
$this->_handlePaymentCancel($order['details']['BT']->virtuemart_order_id, $html);
return;
// will not process the order
} else {
if ($this->approved) {
$this->_clearAuthorizeNetSession();
$new_status = $this->_currentMethod->payment_approved_status;
} else {
if ($this->declined) {
vRequest::setVar('html', $html);
$new_status = $this->_currentMethod->payment_declined_status;
$this->_handlePaymentCancel($order['details']['BT']->virtuemart_order_id, $html);
return;
} else {
if ($this->held) {
$this->_clearAuthorizeNetSession();
$new_status = $this->_currentMethod->payment_held_status;
}
}
}
}
$modelOrder = VmModel::getModel('orders');
$order['order_status'] = $new_status;
$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);
}
示例8: _getPaymentResponseHtml
/**
* @param $method
* @param $order
* @return string
*/
function _getPaymentResponseHtml($method, $order, $payments)
{
VmConfig::loadJLang('com_virtuemart_orders', TRUE);
if (!class_exists('CurrencyDisplay')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php';
}
if (!class_exists('VirtueMartCart')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'cart.php';
}
VmConfig::loadJLang('com_virtuemart_orders', TRUE);
$totalInPaymentCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $order['details']['BT']->order_currency);
$cart = VirtueMartCart::getCart();
$currencyDisplay = CurrencyDisplay::getInstance($cart->pricesCurrency);
$payment = end($payments);
$pluginName = $this->renderPluginName($method, $where = 'post_payment');
$html = $this->renderByLayout('post_payment', array('order' => $order, 'paymentInfos' => $payment, 'pluginName' => $pluginName, 'displayTotalInPaymentCurrency' => $totalInPaymentCurrency['display']));
//vmdebug('_getPaymentResponseHtml', $html,$pluginName,$paypalTable );
return $html;
}
示例9: setComment1
function setComment1()
{
$amountValue = vmPSPlugin::getAmountInCurrency($this->order['details']['BT']->order_total, $this->order['details']['BT']->order_currency);
$currencyDisplay = CurrencyDisplay::getInstance($this->cart->pricesCurrency);
$shop_name = $this->getVendorInfo('vendor_store_name');
return vmText::sprintf('VMPAYMENT_REALEX_HPP_API_COMMENT1', $amountValue['display'], $this->order['details']['BT']->order_number, $shop_name);
}
示例10: getAmountValueInCurrency
/**
* @param $amount
* @param $currencyId
* @return array
*/
static function getAmountValueInCurrency($amount, $currencyId)
{
$return = vmPSPlugin::getAmountInCurrency($amount, $currencyId);
return $return['value'];
}
示例11: setOrderReferenceDetails
/**
* If we are going back to the cart because of InvalidPaymentMethod, then the order reference is not anylonger in a draft state
* @return bool
*/
private function setOrderReferenceDetails($client, $cart, $order = NULL)
{
$this->loadAmazonClass('OffAmazonPaymentsService_Model_OrderReferenceAttributes');
$this->loadAmazonClass('OffAmazonPaymentsService_Model_OrderTotal');
$this->loadAmazonClass('OffAmazonPaymentsService_Model_SellerOrderAttributes');
if ($order) {
$amountInCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $order['details']['BT']->user_currency_id);
$amount = $amountInCurrency['value'];
} else {
$amount = $this->getTotalInPaymentCurrency($client, $cart->pricesUnformatted['billTotal'], $cart->pricesCurrency);
}
//$_amazonOrderReferenceId = $this->getAmazonOrderReferenceIdFromSession();
if (empty($this->_amazonOrderReferenceId)) {
$this->amazonError(__FUNCTION__ . ' setOrderReferenceDetails, No $_amazonOrderReferenceId');
return FALSE;
}
try {
$setOrderReferenceDetailsRequest = new OffAmazonPaymentsService_Model_SetOrderReferenceDetailsRequest();
$setOrderReferenceDetailsRequest->setSellerId($this->_currentMethod->sellerId);
$setOrderReferenceDetailsRequest->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
$setOrderReferenceDetailsRequest->setOrderReferenceAttributes(new OffAmazonPaymentsService_Model_OrderReferenceAttributes());
$setOrderReferenceDetailsRequest->getOrderReferenceAttributes()->setOrderTotal(new OffAmazonPaymentsService_Model_OrderTotal());
$setOrderReferenceDetailsRequest->getOrderReferenceAttributes()->getOrderTotal()->setCurrencyCode($this->getCurrencyCode3($client));
$setOrderReferenceDetailsRequest->getOrderReferenceAttributes()->getOrderTotal()->setAmount($amount);
$setOrderReferenceDetailsRequest->getOrderReferenceAttributes()->setSellerNote($this->getSellerNote());
$setOrderReferenceDetailsRequest->getOrderReferenceAttributes()->setSellerOrderAttributes(new OffAmazonPaymentsService_Model_SellerOrderAttributes());
if ($order) {
$setOrderReferenceDetailsRequest->getOrderReferenceAttributes()->getSellerOrderAttributes()->setSellerOrderId($order['details']['BT']->order_number);
}
$setOrderReferenceDetailsRequest->getOrderReferenceAttributes()->getSellerOrderAttributes()->setStoreName($this->getStoreName());
//$setOrderReferenceDetailsRequest->getOrderReferenceAttributes()->getSellerOrderAttributes()->setCustomInformation($order['details']['BT']->customer_note);
$setOrderReferenceDetailsRequest->getOrderReferenceAttributes()->setPlatformId($this->getPlatformId());
$setOrderReferenceDetailsResponse = $client->setOrderReferenceDetails($setOrderReferenceDetailsRequest);
} catch (Exception $e) {
$this->amazonError(__FUNCTION__ . ' ' . $e->getMessage(), $e->getCode());
$this->clearAmazonSession();
return FALSE;
}
$this->debugLog("<pre>" . var_export($setOrderReferenceDetailsRequest, true) . "</pre>", __FUNCTION__, 'debug');
$this->debugLog("<pre>" . var_export($setOrderReferenceDetailsResponse, true) . "</pre>", __FUNCTION__, 'debug');
return $setOrderReferenceDetailsResponse;
}
示例12: plgVmConfirmedOrder
/**
* Reimplementation of vmPaymentPlugin::plgVmOnConfirmedOrder()
*
* @link http://nabvelocity.com/
* Credit Cards Test Numbers
* Visa Test Account 4007000000027
* Amex Test Account 370000000000002
* Master Card Test Account 6011000000000012
* Discover Test Account 5424000000000015
* @author Velocity Team
*/
function plgVmConfirmedOrder(VirtueMartCart $cart, $order)
{
if (!($this->_currentMethod = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id))) {
return NULL;
// Another method was selected, do nothing
}
if (!$this->selectedThisElement($this->_currentMethod->payment_element)) {
return FALSE;
}
$this->setInConfirmOrder($cart);
$usrBT = $order['details']['BT'];
$usrST = isset($order['details']['ST']) ? $order['details']['ST'] : '';
$session = JFactory::getSession();
$return_context = $session->getId();
$payment_currency_id = shopFunctions::getCurrencyIDByName(self::VELOCITY_DEFAULT_PAYMENT_CURRENCY);
$totalInPaymentCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $payment_currency_id);
$cd = CurrencyDisplay::getInstance($cart->pricesCurrency);
if (!class_exists('ShopFunctions')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'shopfunctions.php';
}
$statecode = self::get2cStateByID($usrBT->virtuemart_state_id);
$countrycode = self::get3cCountryByID($usrBT->virtuemart_country_id) == 'USA' ? self::get3cCountryByID($usrBT->virtuemart_country_id) : 'USA';
$avsData = array('Street' => $usrBT->address_1 . ' ' . $usrBT->address_2, 'City' => $usrBT->city, 'StateProvince' => $statecode, 'PostalCode' => $usrBT->zip, 'Country' => $countrycode);
$cardData = array('cardtype' => str_replace(' ', '', $this->_cc_type), 'pan' => $this->_cc_number, 'expire' => sprintf("%02d", $this->_cc_expire_month) . substr($this->_cc_expire_year, -2), 'cvv' => $this->_cc_cvv, 'track1data' => '', 'track2data' => '');
$identitytoken = $this->_vmpCtable->identitytoken;
$workflowid = $this->_vmpCtable->workflowid;
$applicationprofileid = $this->_vmpCtable->applicationprofileid;
$merchantprofileid = $this->_vmpCtable->merchantprofileid;
if ($this->_vmpCtable->payment_mode) {
$isTestAccount = TRUE;
} else {
$isTestAccount = FALSE;
}
include_once 'sdk' . DS . 'configuration.php';
include_once 'sdk' . DS . 'Velocity.php';
// Prepare data that should be stored in the database
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['virtuemart_order_id'] = $order['details']['BT']->virtuemart_order_id;
$dbValues['payment_method_id'] = $order['details']['BT']->virtuemart_paymentmethod_id;
$dbValues['return_context'] = $return_context;
$dbValues['payment_name'] = parent::renderPluginName($this->_currentMethod);
$dbValues['cost_per_transaction'] = $this->_currentMethod->cost_per_transaction;
$dbValues['cost_percent_total'] = $this->_currentMethod->cost_percent_total;
$dbValues['payment_order_total'] = $totalInPaymentCurrency['value'];
$dbValues['payment_currency'] = $payment_currency_id;
$this->debugLog("before store", "plgVmConfirmedOrder", 'debug');
$this->storePSPluginInternalData($dbValues);
$errMsg = '';
try {
$velocityProcessor = new VelocityProcessor($applicationprofileid, $merchantprofileid, $workflowid, $isTestAccount, $identitytoken);
} catch (Exception $e) {
$this->error = TRUE;
$errMsg .= '<br>' . vmText::_($e->getMessage());
}
/* Request for the verify avsdata and card data*/
try {
$response = $velocityProcessor->verify(array('amount' => $totalInPaymentCurrency['value'], 'avsdata' => $avsData, 'carddata' => $cardData, 'entry_mode' => 'Keyed', 'IndustryType' => 'Ecommerce', 'Reference' => 'xyz', 'EmployeeId' => '11'));
} catch (Exception $e) {
$this->error = TRUE;
$errMsg .= '<br>' . vmText::_($e->getMessage());
}
if (is_array($response) && isset($response['Status']) && $response['Status'] == 'Successful') {
/* Request for the authrizeandcapture transaction */
try {
$xml = VelocityXmlCreator::authorizeandcaptureXML(array('amount' => $totalInPaymentCurrency['value'], 'avsdata' => $avsData, 'token' => $response['PaymentAccountDataToken'], 'order_id' => $order['details']['BT']->order_number, 'entry_mode' => 'Keyed', 'IndustryType' => 'Ecommerce', 'Reference' => 'xyz', 'EmployeeId' => '11'));
// got authorizeandcapture xml object.
$req = $xml->saveXML();
$obj_req = serialize($req);
$cap_response = $velocityProcessor->authorizeAndCapture(array('amount' => $totalInPaymentCurrency['value'], 'avsdata' => $avsData, 'token' => $response['PaymentAccountDataToken'], 'order_id' => $order['details']['BT']->order_number, 'entry_mode' => 'Keyed', 'IndustryType' => 'Ecommerce', 'Reference' => 'xyz', 'EmployeeId' => '11'));
if (is_array($cap_response) && !empty($cap_response) && isset($cap_response['Status']) && $cap_response['Status'] == 'Successful') {
/* save the authandcap response into 'virtuemart_payment_plg_velocity' custom table.*/
$response_fields['transaction_id'] = $cap_response['TransactionId'];
$response_fields['transaction_status'] = $cap_response['TransactionState'];
$response_fields['virtuemart_order_id'] = $order['details']['BT']->virtuemart_order_id;
$response_fields['request_obj'] = $obj_req;
$response_fields['response_obj'] = serialize($cap_response);
$this->storePSPluginInternalData($response_fields, 'virtuemart_order_id', TRUE);
$html = '<table class="adminlist table">' . "\n";
$html .= $this->getHtmlRow('VELOCITY_PAYMENT_NAME', $this->_vmpCtable->payment_name);
$html .= $this->getHtmlRow('VELOCITY_ORDER_NUMBER', $order['details']['BT']->order_number);
$html .= $this->getHtmlRow('VELOCITY_AMOUNT', $cap_response['Amount']);
$html .= $this->getHtmlRow('VMPAYMENT_VELOCITY_APPROVAL_CODE', $cap_response['ApprovalCode']);
if ($cap_response['TransactionId']) {
$html .= $this->getHtmlRow('VELOCITY_RESPONSE_TRANSACTION_ID', $cap_response['TransactionId']);
}
$html .= '</table>' . "\n";
$this->debugLog(vmText::_('VMPAYMENT_VELOCITY_ORDER_NUMBER') . " " . $order['details']['BT']->order_number . ' payment approved', '_handleResponse', 'debug');
$comment = 'ApprovalCode: ' . $cap_response['ApprovalCode'] . '<br>Transaction_Id: ' . $cap_response['TransactionId'];
$this->_clearVelocitySession();
//.........这里部分代码省略.........
示例13: getRemoteCCFormParams
function getRemoteCCFormParams($xml_response_dcc = NULL, $error = FALSE)
{
$realvault = false;
$useSSL = $this->useSSL();
$submit_url = JRoute::_('index.php?option=com_virtuemart&Itemid=' . vRequest::getInt('Itemid') . '&lang=' . vRequest::getCmd('lang', ''), $this->cart->useXHTML, $useSSL);
$card_payment_button = $this->getPaymentButton();
if (!empty($xml_response_dcc)) {
$notificationTask = "handleRemoteDccForm";
} elseif ($this->_method->threedsecure and $this->isCC3DSVerifyEnrolled() and !$error) {
$notificationTask = "handleVerify3D";
} else {
$notificationTask = "handleRemoteCCForm";
}
if (empty($this->_method->creditcards)) {
$this->_method->creditcards = RealexHelperRealex::getRealexCreditCards();
} elseif (!is_array($this->_method->creditcards)) {
$this->_method->creditcards = (array) $this->_method->creditcards;
}
$ccDropdown = "";
$offer_save_card = false;
if (!JFactory::getUser()->guest and $this->_method->realvault) {
$selected_cc = $this->customerData->getVar('saved_cc_selected');
if (empty($selected_cc)) {
$selected_cc = -1;
}
$use_another_cc = true;
$ccDropdown = $this->getCCDropDown($this->_method->virtuemart_paymentmethod_id, JFactory::getUser()->id, $selected_cc, $use_another_cc, true);
if ($selected_cc > 0) {
$realvault = $this->getStoredCCsData($selected_cc);
}
$offer_save_card = $this->_method->offer_save_card;
}
$amountInCurrency = vmPSPlugin::getAmountInCurrency($this->order['details']['BT']->order_total, $this->_method->payment_currency);
$order_amount = vmText::sprintf('VMPAYMENT_REALEX_HPP_API_PAYMENT_TOTAL', $amountInCurrency['display']);
$cd = CurrencyDisplay::getInstance($this->cart->pricesCurrency);
$payment_name = $this->plugin->renderPluginName($this->_method);
$cvv_images = $this->_method->cvv_images;
$cvv_info = "";
$dccinfo = "";
if ($xml_response_dcc) {
$success = $this->isResponseSuccess($xml_response_dcc);
if ($success and isset($xml_response_dcc->dccinfo)) {
$dccinfo = $xml_response_dcc->dccinfo;
}
}
if ($xml_response_dcc and $realvault) {
$ccData['cc_type'] = $realvault->realex_hpp_api_saved_pmt_type;
$ccData['cc_number'] = $realvault->realex_hpp_api_saved_pmt_digits;
$ccData['cc_number_masked'] = $realvault->realex_hpp_api_saved_pmt_digits;
$ccData['cc_name'] = $realvault->realex_hpp_api_saved_pmt_name;
$ccData['cc_cvv_realvault'] = $this->customerData->getVar('cc_cvv_realvault');
$ccData['cc_cvv_masked'] = '***';
} else {
$ccData['cc_type'] = $this->customerData->getVar('cc_type');
$ccData['cc_number'] = $this->customerData->getVar('cc_number');
$ccData['cc_number_masked'] = $this->customerData->getMaskedCCnumber();
$ccData['cc_cvv'] = $this->customerData->getVar('cc_cvv');
$ccData['cc_cvv_masked'] = '***';
$ccData['cc_expire_month'] = $this->customerData->getVar('cc_expire_month');
$ccData['cc_expire_year'] = $this->customerData->getVar('cc_expire_year');
$ccData['cc_name'] = $this->customerData->getVar('cc_name');
$ccData['save_card'] = $this->customerData->getVar('save_card');
}
return array("order_amount" => $order_amount, "payment_name" => $payment_name, "submit_url" => $submit_url, "card_payment_button" => $card_payment_button, "notificationTask" => $notificationTask, 'creditcardsDropDown' => $ccDropdown, "dccinfo" => $dccinfo, "ccData" => $ccData, 'creditcards' => $this->_method->creditcards, 'offer_save_card' => $offer_save_card, 'order_number' => $this->order['details']['BT']->order_number, 'virtuemart_paymentmethod_id' => $this->_method->virtuemart_paymentmethod_id, 'integration' => $this->_method->integration, 'cvv_info' => $cvv_info, 'cvn_checking' => $this->_method->cvn_checking, 'cvv_images' => $cvv_images);
}
示例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->logInfo('plgVmConfirmedOrder order number: ' . $order['details']['BT']->order_number, 'message');
if (!class_exists('VirtueMartModelOrders')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'orders.php';
}
if (!class_exists('VirtueMartModelCurrency')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'currency.php';
}
$usrBT = $order['details']['BT'];
$address = isset($order['details']['ST']) ? $order['details']['ST'] : $order['details']['BT'];
if (!class_exists('TableVendors')) {
require VMPATH_ADMIN . DS . 'tables' . DS . 'vendors.php';
}
$vendorModel = VmModel::getModel('Vendor');
$vendorModel->setId(1);
$vendor = $vendorModel->getVendor();
$vendorModel->addImages($vendor, 1);
$this->getPaymentCurrency($method);
$q = 'SELECT `currency_code_3` FROM `#__virtuemart_currencies` WHERE `virtuemart_currency_id`="' . $method->payment_currency . '" ';
$db = JFactory::getDBO();
$db->setQuery($q);
$currency_code_3 = $db->loadResult();
$totalInPaymentCurrency = vmPSPlugin::getAmountInCurrency($order['details']['BT']->order_total, $method->payment_currency);
$cartCurrency = CurrencyDisplay::getInstance($cart->pricesCurrency);
if ($totalInPaymentCurrency['value'] <= 0) {
vmInfo(vmText::_('VMPAYMENT_TODOPAGO_PAYMENT_AMOUNT_INCORRECT'));
return FALSE;
}
$lang = JFactory::getLanguage();
$tag = substr($lang->get('tag'), 0, 2);
$post_variables = array();
require_once 'cs/TPConnector.php';
$tpconnector = new TPConnector();
$connector_data = $tpconnector->createTPConnector($method);
$this->logInfo("tpconnector" . json_encode($connector_data), "message");
$connector = $connector_data['connector'];
$security_code = $connector_data['security'];
$merchant = $connector_data['merchant'];
$return_url = JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . vRequest::getInt('Itemid') . '&lang=' . vRequest::getCmd('lang', '');
$cancel_url = JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginUserPaymentCancel&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . vRequest::getInt('Itemid') . '&lang=' . vRequest::getCmd('lang', '');
$status_url = JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginnotification&tmpl=component&lang=' . vRequest::getCmd('lang', '');
$optionsSAR_comercio = array('Security' => $security_code, 'EncodingMethod' => 'XML', 'Merchant' => $merchant, 'PUSHNOTIFYENDPOINT' => $return_url = JURI::root() . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id, 'URL_OK' => $return_url, 'URL_ERROR' => $cancel_url);
$customFieldsModel = VmModel::getModel('Customfields');
$optionsSAR_operacion = $this->getCommonFields($cart, $customFieldsModel, $this->tp_states);
$currency_model = VmModel::getModel('currency');
$currency = $currency_model->getCurrency($order['details']['BT']->user_currency_id);
$countryIso = ShopFunctions::getCountryByID($order['details']['BT']->virtuemart_country_id, 'country_2_code');
$countryName = ShopFunctions::getCountryByID($order['details']['BT']->virtuemart_country_id);
$extra_fields = array();
require 'cs/FactoryTodopago.php';
$extra_fields = FactoryTodopago::get_extractor($method->tp_vertical_type, $cart, $customFieldsModel);
$optionsSAR_operacion = array_merge($optionsSAR_operacion, $extra_fields);
$optionsSAR_operacion['MERCHANT'] = $merchant;
$optionsSAR_operacion['CURRENCYCODE'] = "032";
$optionsSAR_operacion['CSPTCURRENCY'] = "ARS";
$optionsSAR_operacion['OPERATIONID'] = $order['details']['BT']->order_number;
$optionsSAR_operacion['CSBTCOUNTRY'] = $countryIso;
$optionsSAR_operacion['CSMDD9'] = JFactory::getUser()->password;
$optionsSAR_operacion['CSSTSTATE'] = $this->tp_states;
$optionsSAR_operacion['CSSTCOUNTRY'] = $countryIso;
$optionsSAR_operacion['CSMDD12'] = $method->tp_dead_line;
$optionsSAR_operacion['CSMDD13'] = $this->_sanitize_string($cart->cartData['shipmentName']);
$this->logInfo("TP - SARcomercio - " . json_encode($optionsSAR_comercio), "message");
$this->logInfo("TP - SARoperacion - " . json_encode($optionsSAR_operacion), "message");
$rta = $connector->sendAuthorizeRequest($optionsSAR_comercio, $optionsSAR_operacion);
$this->logInfo("TP - SAR rta - " . json_encode($rta), "message");
if ($rta["StatusCode"] == 702) {
$this->logInfo("TP - SARoperacion - reintento SAR" . json_encode($optionsSAR_operacion), "message");
$rta = $connector->sendAuthorizeRequest($optionsSAR_comercio, $optionsSAR_operacion);
}
setcookie('RequestKey', $rta["RequestKey"], time() + 86400 * 30, "/");
$session = JFactory::getSession();
$return_context = $session->getId();
$dbValues['user_session'] = $return_context;
$dbValues['order_number'] = $order['details']['BT']->order_number;
$dbValues['payment_name'] = $this->renderPluginName($method, $order);
$dbValues['virtuemart_paymentmethod_id'] = $cart->virtuemart_paymentmethod_id;
$dbValues['cost_per_transaction'] = $method->cost_per_transaction;
$dbValues['cost_percent_total'] = $method->cost_percent_total;
$dbValues['payment_currency'] = $method->payment_currency;
$dbValues['payment_order_total'] = $totalInPaymentCurrency['value'];
$dbValues['tax_id'] = $method->tax_id;
$dbValues['security_code'] = $method->security_code;
$this->storePSPluginInternalData($dbValues);
$cart->_confirmDone = TRUE;
$cart->_dataValidated = TRUE;
$cart->setCartIntoSession();
if ($rta['StatusCode'] != -1) {
echo "<script>alert('Su pago no puede ser procesado. Intente nuevamente más tarde')</script>";
$this->logInfo("TP - Redirect to: " . $rta['URL_Request'], "message");
//.........这里部分代码省略.........
示例15: getOrderRecurringTerms
function getOrderRecurringTerms($payment, $order, $start)
{
$recurring = json_decode($payment->recurring);
$recurring_comment = "";
for ($i = $start; $i < $payment->recurring_number; $i++) {
$index_mont = "PBX_2MONT" . $i;
$index_date = "PBX_DATE" . $i;
$text_mont = vmText::_('VMPAYMENT_' . $this->plugin_name . '_PAYMENT_RECURRING_2MONT') . " ";
$text_date = vmText::_('VMPAYMENT_' . $this->plugin_name . '_PAYMENT_RECURRING_DATE') . " ";
$recurring_comment .= "<br />" . $text_date . " " . $recurring->{$index_date} . " ";
$amountInCurrency = vmPSPlugin::getAmountInCurrency($recurring->{$index_mont} * 0.01, $order['details']['BT']->order_currency);
$recurring_comment .= $text_mont . " " . $amountInCurrency['display'];
}
return $recurring_comment;
}