Jump to content

Модуль оплаты Yandex для физ лиц


Recommended Posts

vanina200988

Подскажите если модуль оплаты  Yandex для физ лиц ? то есть где вписываешь номер кошелька и клиенты оплачивают. Как модуль в Vamshp1 

Link to post
Share on other sites
support

Возьмите любой стандартный модуль и сделайте из него яндекс.деньги.

Например модул MoneyOrderCheck.

В Админке переименуйте его в Яндекс деньги.

А в /app/Plugin/Payment/Controller/MoneyOrderCheckController.php поменяйте:

		$content = '	
		<form action="' . BASE . '/orders/place_order/" method="post">
		<button class="btn btn-default" type="submit" value="{lang}Confirm Order{/lang}"><i class="fa fa-check"></i> {lang}Confirm Order{/lang}</button>
		</form>';

на что-то типа:

		$order = $this->Order->read(null,$_SESSION['Customer']['order_id']);
		$content = 'Для оплаты заказа переведите ' .$order['Order']['total']. ' руб. на наш кошелёк 4110000';	
		<form action="' . BASE . '/orders/place_order/" method="post">
		<button class="btn btn-default" type="submit" value="{lang}Confirm Order{/lang}"><i class="fa fa-check"></i> {lang}Confirm Order{/lang}</button>
		</form>';

 

order.php

Edited by VaM
Link to post
Share on other sites
vanina200988

как сделать на примере вебмани

Link to post
Share on other sites
support

Webmoney перхеодит на сайт платёжной системы.

Вам же этого не надо, тогда берите за основу например GoolgleHtml, StorePickup, Creditcard, они без перехода на сайт платёжной системы.

Link to post
Share on other sites
vanina200988

как только не пытался ни как не получается настроить

Link to post
Share on other sites
support

Покажите код, что именно и куда Вы вставляли.

Link to post
Share on other sites
vanina200988

было 

<?php 
/* -----------------------------------------------------------------------------------------
   VamShop - http://vamshop.com
   -----------------------------------------------------------------------------------------
   Copyright (c) 2014 VamSoft Ltd.
   License - http://vamshop.com/license.html
   ---------------------------------------------------------------------------------------*/
App::uses('PaymentAppController', 'Payment.Controller');

class StorePickupController extends PaymentAppController {
    public $uses = array('PaymentMethod', 'Order');
    public $module_name = 'StorePickup';
    public $icon = 'pickup.png';

    public function settings ()
    {
    }

    public function install()
    {

        $new_module = array();
        $new_module['PaymentMethod']['active'] = '1';
        $new_module['PaymentMethod']['default'] = '0';
        $new_module['PaymentMethod']['name'] = Inflector::humanize($this->module_name);
        $new_module['PaymentMethod']['icon'] = $this->icon;
        $new_module['PaymentMethod']['alias'] = $this->module_name;

        $this->PaymentMethod->saveAll($new_module);

        $this->Session->setFlash(__('Module Installed'));
        $this->redirect('/payment_methods/admin/');
    }

    public function uninstall()
    {

        $module_id = $this->PaymentMethod->findByAlias($this->module_name);

        $this->PaymentMethod->delete($module_id['PaymentMethod']['id'], true);
            
        $this->Session->setFlash(__('Module Uninstalled'));
        $this->redirect('/payment_methods/admin/');
    }

    public function before_process () 
    {
        $content = '
        <form action="' . BASE . '/orders/place_order/" method="post">
        <button class="btn btn-default" type="submit" value="{lang}Confirm Order{/lang}"><i class="fa fa-check"></i> {lang}Confirm Order{/lang}</button>
        </form>';
        return $content;    
    }

    public function after_process()
    {
        $payment_method = $this->PaymentMethod->find('first', array('conditions' => array('alias' => $this->module_name)));
        $order_data = $this->Order->find('first', array('conditions' => array('Order.id' => $_SESSION['Customer']['order_id'])));
        if ($payment_method['PaymentMethod']['order_status_id'] > 0) {
        $order_data['Order']['order_status_id'] = $payment_method['PaymentMethod']['order_status_id'];
        
        $this->Order->save($order_data);
        }
    }
    
}

?>

стало

<?php 
/* -----------------------------------------------------------------------------------------
   VamShop - http://vamshop.com
   -----------------------------------------------------------------------------------------
   Copyright (c) 2014 VamSoft Ltd.
   License - http://vamshop.com/license.html
   ---------------------------------------------------------------------------------------*/
App::uses('PaymentAppController', 'Payment.Controller');

class StorePickupController extends PaymentAppController {
    public $uses = array('PaymentMethod', 'Order');
    public $module_name = 'StorePickup';
    public $icon = 'pickup.png';

    public function settings ()
    {
    }

    public function install()
    {

        $new_module = array();
        $new_module['PaymentMethod']['active'] = '1';
        $new_module['PaymentMethod']['default'] = '0';
        $new_module['PaymentMethod']['name'] = Inflector::humanize($this->module_name);
        $new_module['PaymentMethod']['icon'] = $this->icon;
        $new_module['PaymentMethod']['alias'] = $this->module_name;

        $this->PaymentMethod->saveAll($new_module);

        $this->Session->setFlash(__('Module Installed'));
        $this->redirect('/payment_methods/admin/');
    }

    public function uninstall()
    {

        $module_id = $this->PaymentMethod->findByAlias($this->module_name);

        $this->PaymentMethod->delete($module_id['PaymentMethod']['id'], true);
            
        $this->Session->setFlash(__('Module Uninstalled'));
        $this->redirect('/payment_methods/admin/');
    }

    public function before_process () 
    {
        $order = $this->Order->read(null,$_SESSION['Customer']['order_id']);
        $content = 'Для оплаты заказа переведите ' .$order['Order']['total']. ' руб. на наш кошелёк 4110000';    
        <form action="' . BASE . '/orders/place_order/" method="post">
        <button class="btn btn-default" type="submit" value="{lang}Confirm Order{/lang}"><i class="fa fa-check"></i> {lang}Confirm Order{/lang}</button>
        </form>';    
    }

    public function after_process()
    {
        $payment_method = $this->PaymentMethod->find('first', array('conditions' => array('alias' => $this->module_name)));
        $order_data = $this->Order->find('first', array('conditions' => array('Order.id' => $_SESSION['Customer']['order_id'])));
        if ($payment_method['PaymentMethod']['order_status_id'] > 0) {
        $order_data['Order']['order_status_id'] = $payment_method['PaymentMethod']['order_status_id'];
        
        $this->Order->save($order_data);
        }
    }
    
}

?>

Link to post
Share on other sites
support

Попробуйте так:

   public function before_process () 
    {
        $order = $this->Order->read(null,$_SESSION['Customer']['order_id']);
        $content = 'Для оплаты заказа переведите ' .$order['Order']['total']. ' руб. на наш кошелёк 4110000';    
        $content .= '<form action="' . BASE . '/orders/place_order/" method="post">
        <button class="btn btn-default" type="submit" value="{lang}Confirm Order{/lang}"><i class="fa fa-check"></i> {lang}Confirm Order{/lang}</button>
        </form>';    
    }

 

Link to post
Share on other sites
vanina200988

нет не работает нет кнопки потвердить заказ

Link to post
Share on other sites
support

А так:

   public function before_process () 
    {
        $order = $this->Order->read(null,$_SESSION['Customer']['order_id']);
        $content = 'Для оплаты заказа переведите ' .$order['Order']['total']. ' руб. на наш кошелёк 4110000';    
        $content .= '<form action="' . BASE . '/orders/place_order/" method="post">
        <button class="btn btn-default" type="submit" value="{lang}Confirm Order{/lang}"><i class="fa fa-check"></i> {lang}Confirm Order{/lang}</button>
        </form>';    
        return $content;
    }

Всё есть, проверил.

Edited by VaM
Link to post
Share on other sites
vanina200988

спасибо терерь точно все работает

Link to post
Share on other sites
vanina200988

а как для этого модуля назвать фаил иконки картинки просто там нет под модуль картинки

Link to post
Share on other sites
support

Возьмите другой модуль, где есть иконка.

Link to post
Share on other sites
  • 4 weeks later...
vanina200988

Подскажите Пожалуйста как изменить или создать модуль оплаты яндекс деньги? В яндекс деньгах есть функция создать кнопку для оплаты, так вот в этом коде 

<iframe frameborder="0" allowtransparency="true" scrolling="no" src="https://money.yandex.ru/embed/shop.xml?account=41001313137357&quickpay=shop&payment-type-choice=on&writer=seller&targets=Smok-Elektro.ru&default-sum=&button-text=01&successURL=smok-elektro.ru" width="450" height="196"></iframe>

есть ссылка на оплату. Как внедрить или создать модуль оплаты яндекс для физ лиц по переходу по ссылке https://money.yandex.ru/embed/shop.xml?account=41001313137357&quickpay=shop&payment-type-choice=on&writer=seller&targets=Smok-Elektro.ru&default-sum=&button-text=01&successURL=smok-elektro.ru" width="450" height="196"></iframe>

это же на примере оплаты робокассы. Робокасса тоже переходишь по ссылке. И чтобы назначение платежа было номер заказа, а сумма автоматически прописывалась

Безымянный.png

Edited by vanina200988
Link to post
Share on other sites

Правкой кода.

Берёте любой стандартный модуль и вставляете его код в него в /app/Plugin/Payment/Controller/

Link to post
Share on other sites
  • 5 months later...
myasnik1985

Добрый день, для vamshop 1 какой брать файл для редактирования?

Link to post
Share on other sites

Если вопрос по VamShop 1, создайте тему в соответствующем разделе форума.

Link to post
Share on other sites
×
×
  • Create New...