Esempio n. 1
0
 function onBeforeOrderCreate(&$order, &$do)
 {
     if (parent::onBeforeOrderCreate($order, $do) === true) {
         return true;
     }
     if (!function_exists('curl_init')) {
         $this->app->enqueueMessage('The eSelect payment plugin needs the CURL library installed but it seems that it is not available on your server. Please contact your web hosting to set it up.', 'error');
         $do = false;
         return false;
     }
     $this->ccLoad();
     ob_start();
     $dbg = '';
     $amount = number_format($order->cart->full_total->prices[0]->price_value_with_tax, 2, '.', '');
     require_once dirname(__FILE__) . DS . 'eselect_lib.php';
     $txnArray = array('type' => 'purchase', 'order_id' => uniqid(), 'cust_id' => $this->user->user_id, 'amount' => $amount, 'pan' => $this->cc_number, 'expdate' => $this->cc_month . $this->cc_year, 'crypt_type' => '7', 'dynamic_descriptor' => '');
     $mpgTxn = new mpgTransaction($txnArray);
     if ($this->payment_params->ask_ccv) {
         $cvdTemplate = array('cvd_indicator' => 1, 'cvd_value' => $this->cc_CCV);
         $mpgCvdInfo = new mpgCvdInfo($cvdTemplate);
         $mpgTxn->setCvdInfo($mpgCvdInfo);
     }
     $mpgRequest = new mpgRequest($mpgTxn);
     $mpgHttpPost = new mpgHttpsPost($this->payment_params->store_id, $this->payment_params->api_token, $mpgRequest, (int) $this->payment_params->debug != 0);
     $mpgResponse = $mpgHttpPost->getMpgResponse();
     $ret = $mpgResponse->getResponseCode();
     if ($ret !== null && $ret != 'null') {
         $ret = (int) $ret;
         if ($ret < 50 && $mpgResponse->getComplete() == 'true') {
             ob_get_clean();
             ob_start();
             $this->modifyOrder($order, $this->payment_params->verified_status, true, true);
         } else {
             $responseMsg = $mpgResponse->getMessage();
             if (!empty($responseMsg)) {
                 $this->app->enqueueMessage($responseMsg);
             } else {
                 $this->app->enqueueMessage('Eselect/Moneris Response Error');
             }
             $do = false;
         }
     } else {
         if (!empty($mpgHttpPost->curl_err)) {
             $this->app->enqueueMessage($mpgHttpPost->curl_err_msg);
         } else {
             $msg = $mpgResponse->getMessage();
             if (empty($msg)) {
                 $this->app->enqueueMessage('Eselect/Moneris Generic Error');
             } else {
                 $this->app->enqueueMessage('Eselect/Moneris: ' . $msg);
             }
         }
         $do = false;
     }
     if ($do == false) {
         return true;
     }
     $this->ccClear();
     return true;
 }
Esempio n. 2
0
    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));
        }
    }
Esempio n. 3
0
 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&notif_payment=cmcic&tmpl=component&orderId=' . $order->order_id . '&lang=' . $this->locale;
     $return_url = $httpsHikashop . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_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;
 }
Esempio n. 4
0
 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&notif_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');
 }
Esempio n. 5
0
 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');
     }
 }
Esempio n. 6
0
 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&notif_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');
 }
Esempio n. 7
0
 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&notif_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');
 }
 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&notif_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');
 }
Esempio n. 9
0
    function onAfterOrderConfirm(&$order, &$methods, $method_id)
    {
        parent::onAfterOrderConfirm($order, $methods, $method_id);
        // echo HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_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()">';
        }
    }
Esempio n. 10
0
 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');
 }
Esempio n. 11
0
File: epay.php Progetto: rodhoff/MNW
 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');
 }
Esempio n. 12
0
 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));
 }
Esempio n. 13
0
 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&notif_payment=' . $this->name . '&tmpl=component&orderid=' . $order->order_id;
     $this->order =& $order;
     return $this->showPage('end');
 }
Esempio n. 14
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     if ($order->order_status != $this->payment_params->order_status) {
         $this->modifyOrder($order->order_id, $this->payment_params->order_status, (bool) @$this->payment_params->status_notif_email, false);
     }
     $this->removeCart = true;
     $currencyClass = hikashop_get('class.currency');
     $this->amount = $currencyClass->format($order->order_full_price, $order->order_currency_id);
     $this->order_number = $order->order_number;
     $this->showPage('end');
 }
Esempio n. 15
0
 function onBeforeOrderCreate(&$order, &$do)
 {
     if (parent::onBeforeOrderCreate($order, $do) === true) {
         return true;
     }
     if ($order->order_payment_method == 'purchaseorder') {
         $history = new stdClass();
         $history->type = 'purchase order';
         $history->notified = 0;
         $history->data = JText::_('PURCHASE_ORDER_NUMBER') . @$_SESSION['hikashop_purchase_order_number'];
         $this->modifyOrder($order, $this->payment_params->order_status, $history, false);
     }
 }
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     // adding PagSeguro API
     require_once 'PagSeguroLibrary/PagSeguroLibrary.php';
     $notify_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=pagseguro&tmpl=component&invoice=' . $order->order_id;
     $return_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=' . $order->order_id . $this->url_itemid;
     // performing PagSeguro transaction
     $pagSeguroPaymentRequest = $this->_generatePagSeguroRequestData($order, $notify_url, $return_url);
     $url = $this->_performPagSeguroRequest($pagSeguroPaymentRequest);
     $this->payment_params->url = $url;
     return $this->showPage('end');
 }
Esempio n. 17
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     $method =& $methods[$method_id];
     $this->modifyOrder($order->order_id, $method->payment_params->order_status, @$method->payment_params->status_notif_email, false);
     $this->removeCart = true;
     $this->information = $method->payment_params->information;
     if (preg_match('#^[a-z0-9_]*$#i', $this->information)) {
         $this->information = JText::_($this->information);
     }
     $currencyClass = hikashop_get('class.currency');
     $this->amount = $currencyClass->format($order->order_full_price, $order->order_currency_id);
     $this->order_number = $order->order_number;
     return $this->showPage('end');
 }
Esempio n. 18
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     $totalAmount = round($order->order_full_price, (int) $this->currency->currency_locale['int_frac_digits']);
     $orderId = $order->order_id;
     $paymentSuccessfulURL = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_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';
     $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 = 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;
     }
     $vars = array('ApplicationID' => $applicationId, 'Signature' => $signature, 'PaymentSuccessfulURL' => $paymentSuccessfulURL, 'PaymentCancelledURL' => $cancelUrl, 'ReturnCustomerInfo' => 'false', 'Iframe' => 'false', 'OrderId' => $orderId, 'TotalAmount' => $totalAmount, 'MaxNumberOfInstallments' => $maxInstallments);
     $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 = $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;
     return $this->showPage('end');
 }
Esempio n. 19
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     if ($this->payment_params->type == 'hosted') {
         $address = trim($order->cart->shipping_address->address_street . ' ' . $order->cart->billing_address->address_city);
         $customerName = trim($order->cart->billing_address->address_firstname . ' ' . $order->cart->billing_address->address_lastname);
         $redirectUrl = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=' . $this->name . '&tmpl=component&orderid=' . $order->order_id;
         $callbackUrl = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=' . $order->order_id;
         $fields = array('merchantID' => $this->payment_params->merchantid, 'action' => 'SALE', 'type' => 1, 'amount' => round($order->cart->full_total->prices[0]->price_value_with_tax, 2) * 100, 'countryCode' => $this->payment_params->country_code, 'currencyCode' => $this->payment_params->currency_code, 'redirectURL' => $redirectUrl, 'callbackURL' => $callbackUrl, 'transactionUnique' => $order->order_id . '-' . date('Y-m-d'), 'orderRef' => $order->order_id, 'customerName' => $customerName, 'customerAddress' => $address, 'customerPostCode' => $order->cart->shipping_address->address_post_code, 'customerPhone' => $order->cart->shipping_address->address_telephone, 'customerEmail' => $this->user->user_email);
         $fields['signature'] = createSignature($fields, $this->payment_params->secret);
         $this->fields = $fields;
         return $this->showPage('end');
     }
     if ($this->payment_params->type == 'direct') {
     }
 }
Esempio n. 20
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     $return_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=' . $order->order_id . $this->url_itemid;
     $notif_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=' . $this->name . '&notif_id=' . $method_id . '&order_id=' . $order->order_id . '&lang=' . $this->locale . $this->url_itemid;
     require_once dirname(__FILE__) . '/lib/payplug.php';
     try {
         Payplug::setConfigFromFile(HIKASHOP_MEDIA . "payplug_parameters.json");
         $paymentUrl = PaymentUrl::generateUrl(array('amount' => (int) (round($order->cart->full_total->prices[0]->price_value_with_tax, 2) * 100), 'currency' => 'EUR', 'ipnUrl' => $notif_url, 'email' => $this->user->user_email, 'firstName' => @$order->cart->billing_address->address_firstname, 'lastName' => @$order->cart->billing_address->address_lastname, 'order' => $order->order_id, 'returnUrl' => $return_url));
     } catch (Exception $e) {
         $this->app->enqueueMessage($e->getMessage());
         return;
     }
     header("Location: {$paymentUrl}");
     exit;
 }
Esempio n. 21
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     if (empty($this->payment_params->merchant_id) || empty($this->payment_params->secret_key)) {
         $this->app->enqueueMessage('You have to configure a merchant account and its secret key for the Platron plugin payment first. Please check your payment method parameters on your website backend', 'error');
         return false;
     }
     include_once dirname(__FILE__) . DS . 'PG_Signature.php';
     $viewType = 'end';
     $strDescription = '';
     foreach ($order->cart->products as $objItem) {
         $strDescription .= $objItem->order_product_name;
         if ($objItem->order_product_quantity > 1) {
             $strDescription .= "*" . $objItem->order_product_quantity;
         }
         $strDescription .= "; ";
     }
     $server_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=platron&notif_id=' . $method_id . '&tmpl=component' . $this->url_itemid;
     $failure_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=' . $order->order_id . $this->url_itemid;
     $success_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=' . $order->order_id . $this->url_itemid;
     $strCurrency = $this->currency->currency_code;
     if ($strCurrency == 'RUB') {
         $strCurrency = 'RUR';
     }
     $arrFields = array('pg_merchant_id' => $this->payment_params->merchant_id, 'pg_order_id' => $order->order_id, 'pg_currency' => $strCurrency, 'pg_amount' => sprintf('%0.2f', $order->cart->full_total->prices[0]->price_value_with_tax), 'pg_lifetime' => isset($this->payment_params->lifetime) ? $this->payment_params->lifetime * 60 : 0, 'pg_testing_mode' => $this->payment_params->testmode, 'pg_description' => $strDescription, 'pg_user_ip' => $_SERVER['REMOTE_ADDR'], 'pg_language' => JFactory::getLanguage()->getTag() == 'ru-RU' ? 'ru' : 'en', 'pg_check_url' => $server_url, 'pg_result_url' => $server_url, 'pg_success_url' => $success_url, 'pg_failure_url' => $failure_url, 'pg_request_method' => 'GET', 'pg_salt' => rand(21, 43433));
     if (!empty($order->cart->shipping_address->address_telephone)) {
         preg_match_all("/\\d/", $order->cart->shipping_address->address_telephone, $array);
         $strPhone = implode('', @$array[0]);
         $arrFields['pg_user_phone'] = $strPhone;
     } elseif (!empty($order->cart->billing_address->address_telephone)) {
         preg_match_all("/\\d/", $order->cart->billing_address->address_telephone, $array);
         $strPhone = implode('', @$array[0]);
         $arrFields['pg_user_phone'] = $strPhone;
     }
     if (!empty($order->cart->customer->email)) {
         $arrFields['pg_user_email'] = $order->cart->customer->email;
         $arrFields['pg_user_contact_email'] = $order->cart->customer->email;
     }
     if (!empty($this->payment_params->payment_system)) {
         $arrFields['pg_payment_system'] = $this->payment_params->payment_system;
     }
     $arrFields['pg_sig'] = PG_Signature::make('payment.php', $arrFields, $this->payment_params->secret_key);
     $this->arrPaymentParams = $arrFields;
     return $this->showPage($viewType);
 }
Esempio n. 22
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     $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;
     $notif_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=' . $this->name . '&notif_id=' . $method_id . '&order_id=' . $order->order_id . '&lang=' . $this->locale . $this->url_itemid;
     $locale = strtoupper($this->locale);
     if (!in_array($locale, $this->languages)) {
         $locale = 'EN';
     }
     if (isset($this->payment_params->sandbox) && $this->payment_params->sandbox) {
         $this->url = 'https://test.borgun.is/SecurePay/default.aspx';
     } else {
         $this->url = 'https://securepay.borgun.is/securepay/default.aspx';
     }
     $this->vars = array('MerchantId' => @$this->payment_params->merchantid, 'paymentgatewayid' => @$this->payment_params->paymentgatewayid, 'Orderid' => $order->order_id, 'reference' => $order->order_number, 'checkhash' => md5(@$this->payment_params->merchantid . $notif_url . @$this->payment_params->securecode), 'amount' => number_format($order->cart->full_total->prices[0]->price_value_with_tax, 2, ',', ''), 'currency' => $this->currency->currency_code, 'language' => $locale, 'Itemdescription_1' => JText::_('CART_PRODUCT_TOTAL_PRICE'), 'Itemcount_1' => '1', 'Itemunitamount_1' => number_format($order->cart->full_total->prices[0]->price_value_with_tax, 2, ',', ''), 'Itemamount_1' => number_format($order->cart->full_total->prices[0]->price_value_with_tax, 2, ',', ''), 'buyername' => '', 'buyeremail' => $this->user->user_email, 'returnurlsuccess' => $notif_url, 'returnurlsuccessserver' => $notif_url, 'returnurlcancel' => $cancel_url, 'returnurlerror' => $cancel_url);
     return $this->showPage('end');
 }
Esempio n. 23
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     require_once dirname(__FILE__) . '/library/sofortLib.php';
     $viewType = 'end';
     if (empty($this->payment_params->return_url)) {
         $return_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=' . $order->order_id . $this->url_itemid;
     } else {
         $return_url = $this->payment_params->return_url;
     }
     $notify_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=' . $this->name . '&tmpl=component&lang=nl';
     if (empty($this->payment_params->cancel_url)) {
         $cancel_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=order&task=cancel_order';
     } else {
         $cancel_url = $this->payment_params->cancel_url;
     }
     $configkey = $this->payment_params->user_id . ':' . $this->payment_params->project_id . ':' . $this->payment_params->token;
     $amount = round($order->cart->full_total->prices[0]->price_value_with_tax, (int) $this->currency->currency_locale['int_frac_digits']);
     $order_text = "\r\n" . JText::sprintf('betaling Feeen en ridders: order ', $order->order_id);
     $transactionId = 0;
     $Sofort = new SofortLib_Multipay($configkey);
     $Sofort->setSofortueberweisung();
     $Sofort->setAmount($amount, $this->currency->currency_code);
     $Sofort->setReason($order_text);
     $Sofort->addUserVariable($order->order_id);
     //$Sofort->setSofortrechnungOrderId($order->order_id);
     $Sofort->addUserVariable($method_id);
     $Sofort->setSuccessUrl($return_url);
     $Sofort->setAbortUrl($cancel_url);
     $Sofort->setTimeoutUrl($cancel_url);
     $Sofort->setNotificationUrl($notify_url);
     $Sofort->sendRequest();
     if ($Sofort->isError()) {
         //PNAG-API didn't accept the data
         echo $Sofort->getError();
         return false;
     } else {
         //buyer must be redirected to $paymentUrl else payment cannot be successfully completed!
         $this->redirect_url = $Sofort->getPaymentUrl();
         //header('Location: '.$this->redirect_url);
     }
     return $this->showPage('end');
 }
Esempio n. 24
0
    function onPaymentConfiguration(&$element)
    {
        parent::onPaymentConfiguration($element);
        if (empty($element->payment_params->email)) {
            $app = JFactory::getApplication();
            $doc = JFactory::getDocument();
            $js = "window.hikashop.ready( function() {\r\n\t\t\t\t\tvar element = document.getElementById('link_to_plateform');\r\n\t\t\t\t\telement.onclick = function() {\r\n\t\t\t\t\t\tdocument.getElementById('hikashop_be2bill_form').submit();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t};\r\n\t\t\t\t});";
            $config = hikashop_config();
            $email = $config->get('from_email');
            $form = '<form id="hikashop_be2bill_form" name="hikashop_be2bill_form" action="https://setup.be2bill.com/ouverture-vad" method="post">
			<input type="hidden" name="partner-code" value="P-6a0831" />
			<input type="hidden" name="email" value="' . $email . '" />
			<input type="hidden" name="website" value="' . $_SERVER['HTTP_HOST'] . '" />
			<input type="hidden" name="ecommerce-platform" value="Hikashop" />
			</form>';
            $doc->addScriptDeclaration($js);
            $app->enqueueMessage(JText::sprintf('ENTER_INFO_REGISTER_IF_NEEDED', 'Be2bill', 'identifer', 'Be2bill', '') . $form);
        }
    }
Esempio n. 25
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     $surl = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=' . $this->name . '&tmpl=component&lang=' . $this->locale . $this->url_itemid;
     $curl = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=order&task=cancel_order&order_id=' . $order->order_id . $this->url_itemid;
     $debug = @$this->payment_params->debug;
     $vars = array('key' => $this->payment_params->key, 'txnid' => $order->order_id, 'surl' => $surl, 'furl' => $curl, 'curl' => $curl, 'productinfo' => JText::_('ORDER_NUMBER') . ' ' . $order->order_number, 'charset' => 'utf-8', 'firstname' => $order->cart->shipping_address->address_firstname, 'lastname' => $order->cart->shipping_address->address_lastname, 'email' => $this->user->user_email, 'phone' => $order->cart->shipping_address->address_telephone, 'amount' => round($order->cart->full_total->prices[0]->price_value_with_tax, (int) $this->currency->currency_locale['int_frac_digits']));
     $vars['hash'] = $this->get_hash($vars, $this->payment_params->salt);
     if (@$this->payment_params->paisa) {
         $vars['service_provider'] = 'payu_paisa';
     }
     if ($this->payment_params->environnement == 'test') {
         $this->payment_params->url = 'https://test.payu.in/_payment';
     } else {
         $this->payment_params->url = 'https://secure.payu.in/_payment';
     }
     $this->vars = $vars;
     return $this->showPage('end');
 }
Esempio n. 26
0
 function onBeforeOrderCreate(&$order, &$do)
 {
     if (parent::onBeforeOrderCreate($order, $do) === true) {
         return true;
     }
     $this->ccLoad();
     if ($order->order_payment_method == 'creditcard') {
         $order->credit_card_info = $this;
         $obj = new stdClass();
         $obj->cc_number = substr($this->cc_number, 0, 8);
         $obj->cc_month = $this->cc_month;
         $obj->cc_year = $this->cc_year;
         $obj->cc_type = @$this->cc_type;
         $history = new stdClass();
         $history->type = 'credit card';
         $history->notified = 0;
         $history->data = base64_encode(serialize($obj));
         $this->modifyOrder($order, $this->payment_params->order_status, $history, false);
     }
 }
Esempio n. 27
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     if (empty($this->payment_params->merchantID)) {
         $this->app->enqueueMessage('You have to configure a merchant ID for the Atos sips plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
         return false;
     }
     if (empty($this->payment_params->keyVersion)) {
         $this->app->enqueueMessage('You have to configure the Key Version for the Atos sips plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
         return false;
     }
     if (empty($this->payment_params->secretKey)) {
         $this->app->enqueueMessage('You have to configure the Secret Key for the Atos sips plugin payment first : check your plugin\'s parameters, on your website backend', 'error');
         return false;
     }
     $PostUrl = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=' . $this->name . '&tmpl=component&lang=' . $this->locale . $this->url_itemid;
     $userPostUrl = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=' . $this->name . '&tmpl=component&user_return=1&lang=' . $this->locale . $this->url_itemid;
     if ($this->payment_params->testmode == true) {
         $url = 'https://payment-webinit.simu.sips-atos.com/paymentInit';
     } else {
         $url = 'https://payment-webinit.sips-atos.com/paymentInit';
     }
     $vars0 = array("currencyCode" => @$this->sync_currencies[$this->currency->currency_code], "merchantId" => trim($this->payment_params->merchantID), "normalReturnUrl" => $userPostUrl, "amount" => str_replace(array('.', ','), '', round($order->cart->full_total->prices[0]->price_value_with_tax, 2) * 100), "transactionReference" => $order->order_number, "keyVersion" => trim($this->payment_params->keyVersion), "automaticResponseUrl" => $PostUrl, "orderId" => $order->order_id, "statementReference" => $order->order_number);
     $this->payment_params->url = $url;
     $data = '';
     foreach ($vars0 as $key => $val) {
         if (!empty($val)) {
             $data .= $key . '=' . trim($val) . '|';
         }
     }
     $data = substr($data, 0, -1);
     $secretKey = utf8_encode($this->payment_params->secretKey);
     $seal = hash('sha256', utf8_encode($data . $secretKey));
     $vars = array("Data" => $data, "InterfaceVersion" => "HP_2.3", "Seal" => $seal);
     if ($this->payment_params->debug) {
         $this->writeToLog("Data sent to Atos Sips: \n\n\n");
         $this->writeToLog(print_r($vars, true));
     }
     $this->vars = $vars;
     return $this->showPage('end');
 }
Esempio n. 28
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     $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("ap_purchasetype" => "item", "ap_merchant" => $this->payment_params->email, "apc_1" => $order->order_id, "ap_itemname" => $order->order_number, "ap_currency" => $this->currency->currency_code, "ap_returnurl" => $return_url, "ap_cancelurl" => $cancel_url, "ap_amount" => round($order->cart->full_total->prices[0]->price_value_with_tax, (int) $this->currency->currency_locale['int_frac_digits']));
     if (!empty($this->payment_params->address_type)) {
         $address_type = $this->payment_params->address_type . '_address';
         $this->app =& JFactory::getApplication();
         $address = $this->app->getUserState(HIKASHOP_COMPONENT . '.' . $address_type);
         if (!empty($address)) {
             $cart = hikashop_get('class.cart');
             $cart->loadAddress($order->cart, $address, 'object', $this->payment_params->address_type);
             $vars["ap_fname"] = @$order->cart->{$address_type}->address_firstname;
             $vars["ap_lname"] = @$order->cart->{$address_type}->address_lastname;
             $address1 = '';
             $address2 = '';
             if (!empty($order->cart->{$address_type}->address_street)) {
                 if (strlen($order->cart->{$address_type}->address_street) > 100) {
                     $address1 = substr($order->cart->{$address_type}->address_street, 0, 99);
                     $address2 = substr($order->cart->{$address_type}->address_street, 99, 199);
                 } else {
                     $address1 = $order->cart->{$address_type}->address_street;
                 }
             }
             $vars["ap_addressline1"] = $address1;
             $vars["ap_addressline2"] = $address2;
             $vars["ap_zippostalcode"] = @$order->cart->{$address_type}->address_post_code;
             $vars["ap_city"] = @$order->cart->{$address_type}->address_city;
             $vars["ap_stateprovince"] = @$order->cart->{$address_type}->address_state->zone_code_3;
             $vars["ap_country"] = @$order->cart->{$address_type}->address_country->zone_code_3;
             $vars["ap_contactemail"] = $this->user->user_email;
             $vars["ap_contactphone"] = @$order->cart->{$address_type}->address_telephone;
         }
     }
     $this->payment_params->url = 'https://secure.payza.com/checkout';
     $this->vars = $vars;
     return $this->showPage('end');
 }
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     $method = $methods[$method_id];
     if (isset($order->order_status) && !empty($method->payment_params->order_status) && $method->payment_params->order_status != $order->order_status) {
         $orderObj = new stdClass();
         $orderObj->order_id = $order->order_id;
         $orderObj->order_status = $method->payment_params->order_status;
         if (!empty($method->payment_params->status_notif_email)) {
             $orderObj->history->history_notified = $method->payment_params->status_notif_email;
         }
         $orderClass = hikashop_get('class.order');
         $orderClass->save($orderObj);
     }
     $this->removeCart = true;
     $this->order_number = $order->order_number;
     $this->information = $method->payment_params->information;
     if (preg_match('#^[a-z0-9_]*$#i', $this->information)) {
         $this->information = JText::_($this->information);
     }
     return $this->showPage('end');
 }
Esempio n. 30
0
 function onAfterOrderConfirm(&$order, &$methods, $method_id)
 {
     parent::onAfterOrderConfirm($order, $methods, $method_id);
     $notify_url = HIKASHOP_LIVE . 'index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=okpay&tmpl=component&&invoice=' . $order->order_id . '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("ok_receiver" => $this->payment_params->walletid, "ok_currency" => $this->currency->currency_code, "invoice" => $order->order_id, "ok_return_success" => $return_url, "ok_ipn" => $notify_url, "ok_return_fail" => $cancel_url);
     $i = 1;
     $config =& hikashop_config();
     $group = $config->get('group_options', 0);
     foreach ($order->cart->products as $product) {
         if ($group && $product->order_product_option_parent_id) {
             continue;
         }
         $item_price = round($product->order_product_price, (int) $this->currency->currency_locale['int_frac_digits']) + round($product->order_product_tax, (int) $this->currency->currency_locale['int_frac_digits']) * $product->order_product_quantity;
         $vars["ok_item_" . $i . "_name"] = substr(strip_tags($product->order_product_name), 0, 127);
         $vars["ok_item_" . $i . "_quantity"] = $product->order_product_quantity;
         $vars["ok_item_" . $i . "_price"] = $item_price;
         $i++;
     }
     $this->vars = $vars;
     return $this->showPage('end');
 }