Jump to content

Mahagi

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • First Name
    Mateusz
  • Last Name
    Haglauer

Mahagi's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • One Month Later Rare
  • One Year In Rare

Recent Badges

0

Reputation

  1. Whole payment processing script: <?php /** * * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author Piotr Karecki <[email protected]> * @copyright Dotpay * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * */ class dotpaypaymentModuleFrontController extends ModuleFrontController { public function initContent() { $this->display_column_left = false; parent::initContent(); $control=(int)Tools::getValue('control'); $cart = $this->context->cart; if (!empty($control)) $cart = new Cart($control); if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) Tools::redirect('index.php?controller=order&step=1'); $customer = new Customer($cart->id_customer); if (!Validate::isLoadedObject($customer)) Tools::redirect('index.php?controller=order&step=1'); $address = new Address($cart->id_address_invoice); $params = null; $template = "payment_return"; if ($cart->OrderExists() == true) Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$this->module->id.'&id_order='.Order::getOrderByCartId($cart->id).'&key='.$customer->secure_key); elseif (Tools::getValue("status") == "OK") $form_url = $this->context->link->getModuleLink('dotpay', 'payment', array('control' => $cart->id, 'status' => 'OK'), Configuration::get('DP_SSL', false)); else { // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process $authorized = false; foreach (Module::getPaymentModules() as $module) if ($module['name'] == 'dotpay') { $authorized = true; break; } if (!$authorized) die('This payment method is not available.'); $template = "payment"; $form_url = "https://ssl.dotpay.pl/"; $currency = Currency::getCurrency($cart->id_currency); if (Configuration::get('DP_TEST')==1) $form_url.="test_payment/"; $params = array( 'id' => Configuration::get('DP_ID'), 'amount' => (float)$cart->getOrderTotal(true, Cart::BOTH), 'currency' => $currency["iso_code"], // 'description' => Configuration::get('PS_SHOP_NAME'), // 'url' => $this->context->link->getModuleLink('dotpay', 'payment', array('control' => $cart->id), Configuration::get('DP_SSL', false)), 'type' => 0, 'urlc' => $this->context->link->getModuleLink('dotpay', 'callback', array('ajax' => '1'), Configuration::get('DP_SSL', false)), 'control' => $cart->id, 'firstname' => $customer->firstname, 'lastname' => $customer->lastname, 'email' => $customer->email, 'street' => $address->address1, 'city' => $address->city, 'postcode'=> $address->postcode, 'api_version' => 'legacy', 'description' = $params['id'].$params['firstname'].$params['lastname'].$params['city'].$params['email'] ); $chk = $params['id'].$params['amount'].$params['currency'].$params['description'].$params['control'].Configuration::get('DP_PIN'); $chk = rawurlencode($chk); if(Configuration::get('DP_CHK')) $params['chk']=hash('md5', $chk); } $this->context->smarty->assign(array( 'params' => $params, 'module_dir' => $this->module->getPathUri(), 'form_url' => $form_url, )); $this->setTemplate($template.".tpl"); } }
  2. I guess you re right, but the error remains the same: mod_fcgid: stderr: PHP Parse error: syntax error, unexpected '=', expecting ')
  3. Hello everyone I am having an issue with Dotpay payment module. It sends to server a shop name as payment description. I was trying to make it in such syntax: cart id, firstname, lastname, city, email of client but i am not into SMARTY so there was no effect but only such errors in Apache errorlog: PHP Parse error: syntax error, unexpected ''description'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' Below you can se i made one change in script: $params = array( 'id' => Configuration::get('DP_ID'), 'amount' => (float)$cart->getOrderTotal(true, Cart::BOTH), 'currency' => $currency["iso_code"], // 'description' => Configuration::get('PS_SHOP_NAME'), // <--- original 'url' => $this->context->link->getModuleLink('dotpay', 'payment', array('control' => $cart->id), Configuration::get('DP_SSL', false)), 'type' => 0, 'urlc' => $this->context->link->getModuleLink('dotpay', 'callback', array('ajax' => '1'), Configuration::get('DP_SSL', false)), 'control' => $cart->id, 'firstname' => $customer->firstname, 'lastname' => $customer->lastname, 'email' => $customer->email, 'street' => $address->address1, 'city' => $address->city, 'postcode'=> $address->postcode, 'api_version' => 'legacy' 'description' = $params['id'].$params['firstname'].$params['lastname'].$params['city'].$params['email'] <--- changed ); I would appreciate any help.
  4. Witam wszystkich Mam problem z modułem dotpay, który jako opis transakcji przesyłany do systemu podaje mi nazwę sklepu. Chcę żeby zamiast nazwy sklepu przesyłane było ID koszyka, imię i nazwisko, miasto oraz email składającego zamówienie. Próbowałem jak widać ze składnią, ale niestety bez skutku otrzymując błędy Będę wdzięczny za pomoc PHP Parse error: syntax error, unexpected ''description'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' Kod: $params = array( 'id' => Configuration::get('DP_ID'), 'amount' => (float)$cart->getOrderTotal(true, Cart::BOTH), 'currency' => $currency["iso_code"], // 'description' => Configuration::get('PS_SHOP_NAME'), // <--- oryginalnie 'url' => $this->context->link->getModuleLink('dotpay', 'payment', array('control' => $cart->id), Configuration::get('DP_SSL', false)), 'type' => 0, 'urlc' => $this->context->link->getModuleLink('dotpay', 'callback', array('ajax' => '1'), Configuration::get('DP_SSL', false)), 'control' => $cart->id, 'firstname' => $customer->firstname, 'lastname' => $customer->lastname, 'email' => $customer->email, 'street' => $address->address1, 'city' => $address->city, 'postcode'=> $address->postcode, 'api_version' => 'legacy' 'description' = $params['id'].$params['firstname'].$params['lastname'].$params['city'].$params['email'] <--- zmienione );
×
×
  • Create New...