本文整理汇总了PHP中hikashopPaymentPlugin::onAfterOrderConfirm方法的典型用法代码示例。如果您正苦于以下问题:PHP hikashopPaymentPlugin::onAfterOrderConfirm方法的具体用法?PHP hikashopPaymentPlugin::onAfterOrderConfirm怎么用?PHP hikashopPaymentPlugin::onAfterOrderConfirm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hikashopPaymentPlugin
的用法示例。
在下文中一共展示了hikashopPaymentPlugin::onAfterOrderConfirm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAfterOrderConfirm
/**
*
* @param object $order
* @param array $methods
* @param integer $method_id
*/
public function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
//
//
$this->response = $this->generateTransaction($order, $method_id);
// Store the Access Code directly in the order object
//
if (!$this->response->getErrors()) {
$update_order = new stdClass();
$update_order->order_id = (int) $order->order_id;
$update_order->order_payment_params = @$order->order_payment_params;
if (!empty($update_order->order_payment_params) && is_string($update_order->order_payment_params)) {
$update_order->order_payment_params = unserialize($update_order->order_payment_params);
}
if (empty($update_order->order_payment_params)) {
$update_order->order_payment_params = new stdClass();
}
$update_order->order_payment_params->eway_accesscode = $this->response->AccessCode;
$orderClass = hikashop_get('class.order');
$orderClass->save($update_order);
} else {
$app = JFactory::getApplication();
$error_msg = array();
foreach ($this->response->getErrors() as $error) {
$error_mgs[] = eWayRapidBridge::getErrorMessage(trim($error));
}
$this->app->enqueueMessage('eWay Errors<br/>' . implode('<br/>', $error_msgs), 'error');
}
return $this->showPage('end');
}
示例2: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
// This is a mandatory line in order to initialize the attributes of the payment method
//Here we can do some checks on the options of the payment method and make sure that every required parameter is set and otherwise display an error message to the user
if (empty($this->payment_params->identifier)) {
$this->app->enqueueMessage('You have to configure an identifier for the Mpesa plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
//Enqueued messages will appear to the user, as Joomla's error messages
return false;
} elseif (empty($this->payment_params->password)) {
$this->app->enqueueMessage('You have to configure a password for the Mpesa plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
return false;
} elseif (empty($this->payment_params->payment_url)) {
$this->app->enqueueMessage('You have to configure a payment url for the Mpesa plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
return false;
} else {
//Here, all the required parameters are valid, so we can proceed to the payment platform
$amout = round($order->cart->full_total->prices[0]->price_value_with_tax, 2) * 100;
//The order's amount, here in cents and rounded with 2 decimals because of the payment plateform's requirements
//There is a lot of information in the $order variable, such as price with/without taxes, customer info, products... you can do a var_dump here if you need to display all the available information
//This array contains all the required parameters by the payment plateform
//Not all the payment platforms will need all these parameters and they will probably have a different name.
//You need to look at the payment gateway integration guide provided by the payment gateway in order to know what is needed here
$vars = array('IDENTIFIER' => $this->payment_params->identifier, 'CLIENTIDENT' => $order->order_user_id, 'DESCRIPTION' => "order number : " . $order->order_number, 'ORDERID' => $order->order_id, 'VERSION' => 2.0, 'AMOUNT' => $amout);
$vars['HASH'] = $this->mpesa_signature($this->payment_params->password, $vars);
//Hash generated to certify the values integrity
//This hash is generated according to the plateform requirements
$this->vars = $vars;
//Ending the checkout, ready to be redirect to the plateform payment final form
//The showPage function will call the mpesa_end.php file which will display the redirection form containing all the parameters for the payment platform
return $this->showPage('end');
}
}
示例3: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
if (empty($this->payment_params->identifier)) {
$this->app->enqueueMessage(JText::sprintf('CONFIGURE_X_PAYMENT_PLUGIN_ERROR', 'an identifer', 'Paygate'), 'error');
return false;
} elseif (empty($this->payment_params->key)) {
$this->app->enqueueMessage(JText::sprintf('CONFIGURE_X_PAYMENT_PLUGIN_ERROR', 'a key', 'Paygate'), 'error');
return false;
} elseif (empty($this->payment_params->payment_url)) {
$this->app->enqueueMessage(JText::sprintf('CONFIGURE_X_PAYMENT_PLUGIN_ERROR', 'a payment url', 'Paygate'), 'error');
return false;
} else {
$date = date('Y-m-d h:i:s');
$reference = $order->order_id . '-' . $order->order_number;
$currency = $this->currency->currency_code;
$amout = round($order->cart->full_total->prices[0]->price_value_with_tax, 2) * 100;
$notif_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=' . $this->name . '&tmpl=component';
if ($this->payment_params->sandbox) {
$id = '10011013800';
$key = 'secret';
} else {
$id = $this->payment_params->identifier;
$key = $this->payment_params->key;
}
$vars = array('PAYGATE_ID' => $id, 'REFERENCE' => $reference, 'AMOUNT' => $amout, 'CURRENCY' => $currency, 'RETURN_URL' => $notif_url, 'TRANSACTION_DATE' => $date);
$vars['CHECKSUM'] = $this->paygate_signature($key, $vars);
if ($this->payment_params->debug) {
var_dump($vars);
}
$this->vars = $vars;
return $this->showPage('end');
}
}
示例4: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
if ($this->payment_params->testingMode == true) {
$this->payment_params->url = "https://sandbox.google.com/checkout/inapp/lib/buy.js";
} else {
$this->payment_params->url = "https://wallet.google.com/inapp/lib/buy.js";
}
if (empty($this->payment_params->sellerIdentifier)) {
$this->app->enqueueMessage('You have to configure an seller Identifier for the googlewallet plugin payment first : check your plugin\'s parameters,
on your website backend', 'error');
return false;
}
if (empty($this->payment_params->sellerSecret)) {
$this->app->enqueueMessage('You have to configure the seller Secret for the googlewallet plugin payment first : check your plugin\'s parameters,
on your website backend', 'error');
return false;
}
$amount = round($order->cart->full_total->prices[0]->price_value_with_tax, 2);
$succes_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=' . $order->order_id . $this->url_itemid;
$cancel_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=' . $order->order_id . $this->url_itemid;
$this->payment_params->succes_url = $succes_url;
$this->payment_params->cancel_url = $cancel_url;
$vars = array('iss' => trim($this->payment_params->sellerIdentifier), 'aud' => "Google", 'typ' => "google/payments/inapp/item/v1", 'exp' => time() + 3600, 'iat' => time(), 'request' => array('name' => $order->order_number, 'description' => "", 'price' => $amount, 'currencyCode' => $this->currency->currency_code, 'sellerData' => $order->order_id));
$sellerSecret = $this->payment_params->sellerSecret;
$token = JWT::encode($vars, $sellerSecret);
$this->token = $token;
$this->showPage('end');
if ($this->payment_params->debug) {
$this->writeToLog("Data send to googlewallet: \n\n\n" . print_r($vars, true));
}
}
示例5: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
$httpsHikashop = HIKASHOP_LIVE;
//str_replace('http://','https://', HIKASHOP_LIVE);
$notify_url = $httpsHikashop . 'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=cmcic&tmpl=component&orderId=' . $order->order_id . '&lang=' . $this->locale;
$return_url = $httpsHikashop . 'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=cmcic&tmpl=component&cmcic_return=1&orderId=' . $order->order_id . '&lang=' . $this->locale;
$localeCM = 'FR';
if (in_array($this->locale, array('fr', 'en', 'de', 'it', 'es', 'nl', 'pt'))) {
$localCM = strtoupper($this->locale);
}
if (@$this->payment_params->sandbox) {
$urls = array('cm' => 'https://paiement.creditmutuel.fr/test/paiement.cgi', 'cic' => 'https://ssl.paiement.cic-banques.fr/test/paiement.cgi', 'obc' => 'https://ssl.paiement.banque-obc.fr/test/paiement.cgi');
} else {
$urls = array('cm' => 'https://paiement.creditmutuel.fr/paiement.cgi', 'cic' => 'https://ssl.paiement.cic-banques.fr/paiement.cgi', 'obc' => 'https://ssl.paiement.banque-obc.fr/paiement.cgi');
}
if (!isset($this->payment_params->bank) || !isset($urls[$this->payment_params->bank])) {
$this->payment_params->bank = 'cm';
}
$this->url = $urls[$this->payment_params->bank];
$this->vars = array('TPE' => trim($this->payment_params->tpe), 'date' => date('d/m/Y:H:i:s'), 'montant' => number_format($order->cart->full_total->prices[0]->price_value_with_tax, 2, '.', '') . $this->currency->currency_code, 'reference' => $order->order_number, 'texte-libre' => '', 'version' => '3.0', 'lgue' => $localeCM, 'societe' => trim($this->payment_params->societe), 'mail' => $this->user->user_email);
$this->vars['MAC'] = $this->generateHash($this->vars, $this->payment_params->key, 19);
if (@$this->payment_params->debug) {
echo 'Data sent<pre>' . var_export($this->vars, true) . '</pre>';
}
$this->vars['url_retour'] = HIKASHOP_LIVE . 'index.php?option=com_hikashop';
$this->vars['url_retour_ok'] = $return_url;
$this->vars['url_retour_err'] = $return_url;
$this->showPage('end');
return true;
}
示例6: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
if ($this->payment_params->testingMode == true) {
$this->payment_params->url = "https://sandbox.payfast.co.za/eng/process";
} else {
$this->payment_params->url = "https://www.payfast.co.za/eng/process";
}
if (empty($this->payment_params->merchant_id)) {
$this->app->enqueueMessage('You have to configure an merchant id for the payfast plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
return false;
}
if (empty($this->payment_params->merchant_key)) {
$this->app->enqueueMessage('You have to configure the merchant key for the payfast plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
return false;
}
$amount = round($order->cart->full_total->prices[0]->price_value_with_tax, 2);
$notify_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=' . $this->name . '&tmpl=component&lang=' . $this->locale . $this->url_itemid;
$return_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=' . $order->order_id . $this->url_itemid;
$cancel_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=' . $order->order_id . $this->url_itemid;
$vars = array('merchant_id' => trim($this->payment_params->merchant_id), 'merchant_key' => trim($this->payment_params->merchant_key), 'return_url' => $return_url, 'cancel_url' => $cancel_url, 'notify_url' => $notify_url, 'name_first' => substr(@$order->cart->billing_address->address_firstname, 0, 99), 'name_last' => substr(@$order->cart->billing_address->address_lastname, 0, 99), 'email_address' => substr($this->user->user_email, 0, 99), 'm_payment_id' => (int) $order->order_id, 'amount' => $amount, 'item_name' => $order->order_number);
$this->vars = $vars;
$pfOutput = array();
foreach ($vars as $key => $val) {
if (!empty($val)) {
$pfOutput[] = $key . '=' . urlencode(trim($val));
}
}
$getString = implode('&', $pfOutput);
$vars['signature'] = md5($getString);
if ($this->payment_params->debug) {
$this->writeToLog("Data sent to PayFast: \n\n" . print_r($vars, true));
}
return $this->showPage('end');
}
示例7: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
$address = $this->app->getUserState(HIKASHOP_COMPONENT . '.billing_address');
if (!empty($address)) {
$firstname = @$order->cart->billing_address->address_firstname;
$lastname = @$order->cart->billing_address->address_lastname;
$address1 = '';
if (!empty($order->cart->billing_address->address_street)) {
$address1 = substr($order->cart->billing_address->address_street, 0, 200);
}
$zip = @$order->cart->billing_address->address_post_code;
$city = @$order->cart->billing_address->address_city;
$state = @$order->cart->billing_address->address_state->zone_code_3;
$country = @$order->cart->billing_address->address_country->zone_code_2;
$email = $this->user->user_email;
$phone = @$order->cart->billing_address->address_telephone;
}
$notify_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=alipay&tmpl=component&lang=' . $this->locale . $this->url_itemid;
$return_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=' . $order->order_id . $this->url_itemid;
$out_trade_no = $order->order_id;
if ($this->payment_params->Mode == "Partner") {
$order_params = array("seller_email" => $this->payment_params->email, "service" => "create_partner_trade_by_buyer", "partner" => $this->payment_params->partner_id, "return_url" => $return_url, "notify_url" => $notify_url, "_input_charset" => "utf-8", "subject" => 'order number : ' . $out_trade_no, "body" => '', "out_trade_no" => $out_trade_no, "payment_type" => "1", "price" => round($order->order_full_price, (int) $this->currency->currency_locale['int_frac_digits']), "quantity" => "1", "logistics_type" => "EXPRESS", "logistics_fee" => "0.00", "logistics_payment" => "BUYER_PAY", 'receive_name' => $lastname . ' ' . $firstname, 'receive_address' => $address1, 'receive_zip' => $zip, 'receive_phone' => $phone);
} else {
$order_params = array("seller_email" => $this->payment_params->email, "service" => "create_direct_pay_by_user", "partner" => $this->payment_params->partner_id, "return_url" => $return_url, "notify_url" => $notify_url, "_input_charset" => "utf-8", "subject" => 'order number : ' . $out_trade_no, "body" => '', "out_trade_no" => $out_trade_no, "payment_type" => "1", "total_fee" => round($order->order_full_price, (int) $this->currency->currency_locale['int_frac_digits']));
}
$alipay = new alipay();
$alipay->set_order_params($order_params);
$alipay->set_transport($this->payment_params->transport);
$alipay->set_security_code($this->payment_params->security_code);
$alipay->set_sign_type($this->payment_params->sign_type);
$sign = $alipay->_sign($alipay->_order_params);
$this->payment_params->url = $alipay->create_payment_link();
return $this->showPage('end');
}
示例8: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
// This is a mandatory line in order to initialize the attributes of the payment method
$notify_url = HIKASHOP_LIVE . 'paypaladvanced_' . $method_id . '_' . $this->payment_params->secret_code . '.php';
$cancel_url = HIKASHOP_LIVE . 'paypaladvanced_cancel_' . $method_id . '.php';
$return_url = HIKASHOP_LIVE . 'paypaladvanced_return_' . $method_id . '.php';
//return URL to the page of redirection created in onPaymentConfigurationSave(), this can't change
$vars = array('USER' => $this->payment_params->user, 'PWD' => $this->payment_params->password, 'VENDOR' => $this->payment_params->vendor, 'PARTNER' => $this->payment_params->partner, 'SECURETOKENID' => uniqid('', true), 'SECURETOKEN' => '', 'AMT' => @round($order->cart->order_full_price, (int) $this->currency->currency_locale['int_frac_digits']), 'SILENT_POST_URL' => $notify_url, 'RETURN_URL' => $return_url, 'CANCEL_URL' => $cancel_url, 'CURRENCYCODE' => $this->currency->currency_code, 'EMAIL' => $this->user->user_email, 'HOST_ADDR' => 'https://payflowpro.paypal.com');
if ($this->payment_params->test_mode == '1') {
//if we are in test mode, the adress isn't the same
$vars['HOST_ADDR'] = 'https://pilot-payflowpro.paypal.com';
}
$type = @$this->payment_params->validation ? 'A' : 'S';
$postdata = "USER=" . $vars['USER'] . "&VENDOR=" . $vars['VENDOR'] . "&PARTNER=" . $vars['PARTNER'] . "&PWD=" . $vars['PWD'] . "&CREATESECURETOKEN=" . 'Y' . "&SECURETOKENID=" . $vars['SECURETOKENID'] . "&TRXTYPE=" . $type . "&AMT=" . $vars['AMT'] . "&CURRENCY=" . $vars['CURRENCYCODE'] . "&SHOWAMOUNT=TRUE" . "&INVNUM=" . $order->order_id . "&SILENTPOSTURL=" . $vars['SILENT_POST_URL'] . "&RETURNURL=" . $vars['RETURN_URL'] . "&CANCELURL=" . $vars['CANCEL_URL'] . "&BILLTOEMAIL=" . $vars['EMAIL'] . "&BILLTOFIRSTNAME=" . @$order->cart->billing_address->address_firstname . "&BILLTOLASTNAME=" . @$order->cart->billing_address->address_lastname . "&BILLTOSTREET=" . @$order->cart->billing_address->address_street . "&BILLTOCITY=" . @$order->cart->billing_address->address_city . "&BILLTOZIP=" . @$order->cart->billing_address->address_post_code . "&BILLTOSTATE=" . @$order->cart->billing_address->address_state->zone_name . "&BILLTOCOUNTRY=" . @$order->cart->billing_address->address_country->zone_code_2 . "&SHIPTOFIRSTNAME=" . @$order->cart->shipping_address->address_firstname . "&SHIPTOLASTNAME=" . @$order->cart->shipping_address->address_lastname . "&SHIPTOSTREET=" . @$order->cart->shipping_address->address_street . "&SHIPTOCITY=" . @$order->cart->shipping_address->address_city . "&SHIPTOZIP=" . @$order->cart->shipping_address->address_post_code . "&SHIPTOSTATE=" . @$order->cart->shipping_address->address_state->zone_name . "&SHIPTOCOUNTRY=" . @$order->cart->shipping_address->address_country->zone_code_2;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $vars['HOST_ADDR']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$resp = curl_exec($ch);
if (!$resp) {
echo "<p>No response from PayPal's servers, please try again. </p>";
}
$arr = null;
parse_str($resp, $arr);
if ($arr['RESULT'] != 0) {
echo "<p>An error has occurred, please try again.</p>";
}
$vars['SECURETOKEN'] = $arr['SECURETOKEN'];
$this->vars = $vars;
return $this->showPage('end');
}
示例9: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
if (empty($this->payment_params->sessionvalidity)) {
$this->payment_params->sessionvalidity = 1;
}
if (empty($this->payment_params->merchantaccount)) {
$this->app->enqueueMessage('You have to configure a merchant account for the adyen plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
return false;
}
if (empty($this->payment_params->skincode)) {
$this->app->enqueueMessage('You have to configure the Skin Code for the adyen plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
return false;
} elseif (empty($this->payment_params->hmacKey)) {
$this->app->enqueueMessage('You have to configure the Hmac Key for the adyen plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
return false;
}
$amount = round($order->cart->full_total->prices[0]->price_value_with_tax, 2) * 100;
list($shipping_house, $shipping_street) = $this->splitStreet($order->cart->shipping_address->address_street);
list($billing_house, $billing_street) = $this->splitStreet($order->cart->billing_address->address_street);
$resURL = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=adyen&tmpl=component' . $this->url_itemid;
$vars = array('merchantReference' => $order->order_id, 'paymentAmount' => $amount, 'currencyCode' => $this->currency->currency_code, 'shipBeforeDate' => date('Y-m-d', strtotime('+3 days')), 'skinCode' => trim($this->payment_params->skincode), 'merchantAccount' => trim($this->payment_params->merchantaccount), 'sessionValidity' => date('c', strtotime('+' . (int) $this->payment_params->sessionvalidity . ' days')), 'shopperLocale' => trim($this->payment_params->language_code), 'shopperEmail' => $this->user->user_email, 'shopperReference' => $this->user->user_id, 'resURL' => $resURL, 'allowedMethods' => preg_replace('#[^a-z0-9_\\-,]#i', '', $this->payment_params->allowedmethods), 'blockedMethods' => preg_replace('#[^a-z0-9_\\-,]#i', '', $this->payment_params->blockedmethods), 'billingAddress.street' => $billing_street, 'billingAddress.houseNumberOrName' => $billing_house, 'billingAddress.city' => $order->cart->billing_address->address_city, 'billingAddress.stateOrProvince' => $order->cart->billing_address->address_state->zone_name, 'billingAddress.country' => $order->cart->billing_address->address_country->zone_code_2, 'billingAddress.postalCode' => @$order->cart->billing_address->address_post_code, 'deliveryAddress.street' => $shipping_street, 'deliveryAddress.houseNumberOrName' => $shipping_house, 'deliveryAddress.city' => $order->cart->shipping_address->address_city, 'deliveryAddress.postalCode' => @$order->cart->shipping_address->address_post_code, 'deliveryAddress.stateOrProvince' => @$order->cart->shipping_address->address_state->zone_name, 'deliveryAddress.country' => $order->cart->shipping_address->address_country->zone_code_2, 'shopper.firstName' => @$order->cart->billing_address->address_firstname, 'shopper.lastName' => @$order->cart->billing_address->address_lastname, 'shopper.telephoneNumber' => @$order->cart->billing_address->address_telephone);
$vars['merchantSig'] = base64_encode(pack('H*', hash_hmac('sha1', $vars['paymentAmount'] . $vars['currencyCode'] . $vars['shipBeforeDate'] . $vars['merchantReference'] . $vars['skinCode'] . $vars['merchantAccount'] . $vars['sessionValidity'] . $vars['shopperEmail'] . $vars['shopperReference'] . $vars['allowedMethods'] . $vars['blockedMethods'], trim($this->payment_params->hmacKey))));
$vars['billingAddressSig'] = base64_encode(pack('H*', hash_hmac('sha1', $vars['billingAddress.street'] . $vars['billingAddress.houseNumberOrName'] . $vars['billingAddress.city'] . $vars['billingAddress.postalCode'] . $vars['billingAddress.stateOrProvince'] . $vars['billingAddress.country'], trim($this->payment_params->hmacKey))));
$vars['deliveryAddressSig'] = base64_encode(pack('H*', hash_hmac('sha1', $vars['deliveryAddress.street'] . $vars['deliveryAddress.houseNumberOrName'] . $vars['deliveryAddress.city'] . $vars['deliveryAddress.postalCode'] . $vars['deliveryAddress.stateOrProvince'] . $vars['deliveryAddress.country'], trim($this->payment_params->hmacKey))));
$vars['shopperSig'] = base64_encode(pack('H*', hash_hmac('sha1', $vars['shopper.firstName'] . $vars['shopper.lastName'] . $vars['shopper.telephoneNumber'], trim($this->payment_params->hmacKey))));
$this->vars = $vars;
return $this->showPage('end');
}
示例10: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
//Order Header values
$totalAmount = round($order->order_full_price, (int) $this->currency->currency_locale['int_frac_digits']);
$orderId = $order->order_id;
//Option values
$paymentSuccessfulURL = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=netgiro&lang=' . $this->locale . $this->url_itemid;
$cancelUrl = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=' . $orderId . $this->url_itemid;
$applicationId = $this->payment_params->application_id;
$secretKey = $this->payment_params->secret_key;
$maxInstallments = $this->payment_params->max_installments;
$returnCustomerInfo = 'false';
/*showP1 = show pay later option (14 days delay in payment)
*showP2 = show partial payments
*showP3 = show partial payments without interest
*/
$paymentOptions = new paymentOptionsCls();
$paymentOptions->showP1 = $this->payment_params->payment_opt1;
$paymentOptions->showP2 = $this->payment_params->payment_opt2;
$paymentOptions->showP3 = $this->payment_params->payment_opt3;
//Signature - Signature for the message, calculated as SHA256(SecretKey + OrderId + TotalAmount + ApplicationId)
$signature = hash('sha256', $secretKey . $orderId . $totalAmount . $applicationId);
switch ($this->payment_params->mode) {
case 'LIVE':
$netGiropaymentUrl = 'https://www.netgiro.is/SecurePay';
break;
case 'TEST':
$netGiropaymentUrl = 'http://test.netgiro.is/user/securepay';
break;
default:
$netGiropaymentUrl = 'http://test.netgiro.is/user/securepay';
break;
}
// Values that will be posted to Netgiro
$vars = array('ApplicationID' => $applicationId, 'Signature' => $signature, 'PaymentSuccessfulURL' => $paymentSuccessfulURL, 'PaymentCancelledURL' => $cancelUrl, 'ReturnCustomerInfo' => 'false', 'Iframe' => 'false', 'OrderId' => $orderId, 'TotalAmount' => $totalAmount, 'MaxNumberOfInstallments' => $maxInstallments);
//Order Item values
$n = 0;
foreach ($order->cart->products as $product) {
$productPrice = round($product->order_product_price, (int) $this->currency->currency_locale['int_frac_digits']);
$tax = round($product->order_product_tax, (int) $this->currency->currency_locale['int_frac_digits']);
$unitPrice = $productPrice + $tax;
$productAmount = round($product->order_product_total_price, (int) $this->currency->currency_locale['int_frac_digits']);
//Quantity should be passed in 1/1000 units. For example if the quantity is 2 then it should be represented as 2000
$quantity = $product->order_product_quantity * 1000;
$vars["Items[{$n}].ProductNo"] = $product->order_product_code;
$vars["Items[{$n}].Name"] = $product->order_product_name;
$vars["Items[{$n}].UnitPrice"] = $unitPrice;
$vars["Items[{$n}].Quantity"] = $quantity;
$vars["Items[{$n}].Amount"] = $productAmount;
$n++;
}
$this->vars = $vars;
$this->netGiropaymentUrl = $netGiropaymentUrl;
$this->paymentOptions = $paymentOptions;
$this->appId = $applicationId;
//call the netgiro_end.php
return $this->showPage('end');
}
示例11: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
// echo HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment='.$this->name;
// die;
$amount = $order->cart->full_total->prices[0]->price_value_with_tax;
$url = JURI::root() . 'plugins/hikashoppayment/ubrir/catcher.php?id=' . $order->order_number;
$readyToPay = false;
// возможность платежа
$bankHandler = new Ubrir(array('shopId' => $this->payment_params->twpg_id, 'order_id' => $order->order_number, 'sert' => $this->payment_params->twpg_private_pass, 'amount' => $amount, 'approve_url' => $url, 'cancel_url' => $url, 'decline_url' => $url));
$response_order = $bankHandler->prepare_to_pay();
// что вернул банк
if (!empty($response_order)) {
$db = JFactory::getDBO();
$sql = " INSERT INTO #__twpg_orders \n\t\t\t(`shoporderid`, `OrderID`, `SessionID`) \n\t\t\tVALUES \n\t\t\t('" . $order->order_number . "', '" . $response_order->OrderID[0] . "', '" . $response_order->SessionID[0] . "') ";
$db->setQuery($sql);
if (!$db->query()) {
exit('error_1101');
}
} else {
switch ($response_order) {
case 30:
echo 'Неверный формат сообщения';
break;
case 10:
echo 'ИМ не имеет доступа к этой операции';
break;
case 54:
case 96:
echo 'недопустимая операция';
break;
}
exit;
}
$twpg_url = $response_order->URL[0] . '?orderid=' . $response_order->OrderID[0] . '&sessionid=' . $response_order->SessionID[0];
echo '<p>Данный заказ необходимо оплатить одним из методов, приведенных ниже: </p> <INPUT TYPE="button" value="Оплатить Visa" onclick="document.location = \'' . $twpg_url . '\'">';
if ($this->payment_params->two == 1) {
$id = trim($this->payment_params->uniteller_id);
$login = trim($this->payment_params->uniteller_login);
$pass = trim($this->payment_params->uniteller_pass);
$orderid = $order->order_number;
$amount = round($amount, 2);
$sign = strtoupper(md5(md5($id) . '&' . md5($login) . '&' . md5($pass) . '&' . md5($orderid) . '&' . md5($amount)));
echo '<form action="https://91.208.121.201/estore_listener.php" name="uniteller" method="post" hidden>
<input type="number" name="SHOP_ID" value="' . $id . '">
<input type="text" name="LOGIN" value="' . $login . '">
<input type="text" name="ORDER_ID" value="' . $orderid . '">
<input type="number" name="PAY_SUM" value="' . $amount . '">
<input type="text" name="VALUE_1" value="' . $orderid . '">
<input type="text" name="URL_OK" value="' . JURI::root() . 'plugins/hikashoppayment/ubrir/catcher.php?status=ok&">
<input type="text" name="URL_NO" value="' . JURI::root() . 'plugins/hikashoppayment/ubrir/catcher.php?status=no&">
<input type="text" name="SIGN" value="' . $sign . '">
<input type="text" name="LANG" value="RU">
</form>';
// die;
echo '<INPUT TYPE="button" value="Оплатить MasterCard" onclick="document.forms.uniteller.submit()">';
}
}
示例12: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
$this->methods = $methods;
$this->method_id = $method_id;
$this->amount_total = round($order->cart->full_total->prices[0]->price_value_with_tax, 2) * 100;
$this->id_pedido = $order->order_id;
return $this->showPage('end');
}
示例13: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
if (empty($this->payment_params)) {
return false;
}
$this->vars = $this->getVars($order);
return $this->showPage('end');
}
示例14: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
parent::onAfterOrderConfirm($order, $methods, $method_id);
$plugin = $this->loadCurrentPlugin($order->order_payment_id, $this->payment_params->common_payment_plugin);
if (!is_object($plugin) || !method_exists($plugin, 'onTP_GetHTML')) {
return '';
}
echo $plugin->onTP_GetHTML($this->_loadVars($order));
}
示例15: onAfterOrderConfirm
function onAfterOrderConfirm(&$order, &$methods, $method_id)
{
if (!$this->init()) {
return false;
}
parent::onAfterOrderConfirm($order, $methods, $method_id);
$this->notifyurl = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify¬if_payment=' . $this->name . '&tmpl=component&orderid=' . $order->order_id;
$this->order =& $order;
return $this->showPage('end');
}