2014-12-31 4 views
0

Добрый день.Проблемы с пурпуровыми методами оплаты

У меня возникли проблемы с моим методом оплаты.

Я следил за этим руководством http://inchoo.net/magento/how-to-create-magento-payment-module/.

На бэкэнде все хорошо.

Но на интерфейсе новый метод не появляется.

Вот некоторые код Creativator_Payfort.xml:

<?xml version="1.0"?> 
<config> 
    <modules> 
     <Creativator_Payfort> 
      <active>true</active> 
      <codePool>local</codePool> 
     </Creativator_Payfort> 
    </modules> 
</config> 

Тогда config.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<config> 
    <modules> 
     <Creativator_Payfort> 
      <version>1.0.0</version> 
     </Creativator_Payfort> 
    </modules> 

    <default> 
     <payment> 
      <payfort> 
       <model>payfort/standard</model> 
       <order_status>pending</order_status> 
       <title>CUSTOM CARD</title> 
       <payment_action>sale</payment_action> 
       <submit_url>https://someurl.com</submit_url> 
       <merchant_id>Insert merchant id</merchant_id> 
       <allowspecific>0</allowspecific> 
       <sort_order>15</sort_order> 
      </payfort> 
     </payment> 
    </default> 

    <global> 
     <models> 
      <creativator_payfort> 
       <class>Creativator_Payfort_Model</class> 
      </creativator_payfort> 
     </models> 
     <helpers> 
      <creativator_payfort> 
       <class>Creativator_Payfort_Helper</class> 
      </creativator_payfort> 
     </helpers> 

     <blocks> 
      <creativator_payfort> 
       <class>Creativator_Payfort_Block</class> 
      </creativator_payfort> 
     </blocks> 

    </global> 




    <frontend> 
     <routers> 
      <Creativator_Payfort> 
       <use>standard</use> 
       <args> 
        <module>Creativator_Payfort</module> 
        <frontName>payfort</frontName> 
       </args> 
      </Creativator_Payfort> 
     </routers> 
     <layout> 
      <updates> 
       <creativator_payfort> 
        <file>creativator/payfort.xml</file> 
       </creativator_payfort> 
      </updates> 
     </layout> 
    </frontend> 

</config> 

System.Xml:

<?xml version="1.0"?> 
<config> 
    <sections> 
     <payment> 
      <groups> 
       <payfort translate="label comment" module="payment"> 
        <label>Payfort</label> 
        <frontend_type>text</frontend_type> 
        <sort_order>0</sort_order> 
        <show_in_default>1</show_in_default> 
        <show_in_website>1</show_in_website> 
        <show_in_store>1</show_in_store> 
        <fields> 
         <active translate="label"> 
          <label>Enabled</label> 
          <frontend_type>select</frontend_type> 
          <source_model>adminhtml/system_config_source_yesno</source_model> 
          <sort_order>10</sort_order> 
          <show_in_default>1</show_in_default> 
          <show_in_website>1</show_in_website> 
          <show_in_store>0</show_in_store> 
         </active> 
         <title translate="label"> 
          <label>Title</label> 
          <frontend_type>text</frontend_type> 
          <sort_order>20</sort_order> 
          <show_in_default>1</show_in_default> 
          <show_in_website>1</show_in_website> 
          <show_in_store>1</show_in_store> 
         </title> 
         <order_status translate="label"> 
          <label>New Order Status</label> 
          <frontend_type>select</frontend_type> 
          <source_model>adminhtml/system_config_source_order_status</source_model> 
          <sort_order>50</sort_order> 
          <show_in_default>1</show_in_default> 
          <show_in_website>1</show_in_website> 
          <show_in_store>0</show_in_store> 
         </order_status> 
         <submit_url> 
          <label>Gateway URL</label> 
          <frontend_type>text</frontend_type> 
          <sort_order>58</sort_order> 
          <show_in_default>1</show_in_default> 
          <show_in_website>1</show_in_website> 
          <show_in_store>0</show_in_store> 
         </submit_url> 
         <merchant_id> 
          <label>Merchant ID</label> 
          <frontend_type>text</frontend_type> 
          <sort_order>59</sort_order> 
          <show_in_default>1</show_in_default> 
          <show_in_website>1</show_in_website> 
          <show_in_store>0</show_in_store> 
         </merchant_id> 
         <allowspecific translate="label"> 
          <label>Payment Applicable From</label> 
          <frontend_type>select</frontend_type> 
          <sort_order>60</sort_order> 
          <source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model> 
          <show_in_default>1</show_in_default> 
          <show_in_website>1</show_in_website> 
          <show_in_store>0</show_in_store> 
         </allowspecific> 
         <specificcountry translate="label"> 
          <label>Countries Payment Applicable From</label> 
          <frontend_type>multiselect</frontend_type> 
          <sort_order>70</sort_order> 
          <source_model>adminhtml/system_config_source_country</source_model> 
          <show_in_default>1</show_in_default> 
          <show_in_website>1</show_in_website> 
          <show_in_store>0</show_in_store> 
          <depends><allowspecific>1</allowspecific></depends> 
         </specificcountry> 
         <sort_order translate="label"> 
          <label>Sort Order</label> 
          <frontend_type>text</frontend_type> 
         </sort_order><sort_order>100</sort_order> 
         <show_in_default>1</show_in_default> 
         <show_in_website>1</show_in_website> 
         <show_in_store>0</show_in_store> 
        </fields> 
       </payfort> 
      </groups> 
     </payment> 
    </sections> 
</config> 

И, наконец, модель Standard.php:

<?php 

class Creativator_Payfort_Model_Standard extends Mage_Payment_Model_Method_Abstract 
{ 

    protected $_code = 'payfort'; 

    protected $_isInitializeNeeded  = true; 
    protected $_canUseInternal   = true; 
    protected $_canUseForMultishipping = true; 

/** 
* Return Order place redirect url 
* 
* @return string 
*/ 
    public function getOrderPlaceRedirectUrl() 
    { 
    //when you click on place order you will be redirected on this url, if you don't want this action remove this method 
     return Mage::getUrl('payfort'); 
    } 

} 

P.S. Я читал подобные сообщения о подобной проблеме, но это не помогло. Я наверняка пропустил что-то важное.

Так что я буду очень благодарностью за помощь

+0

вы должны добавить и вызвать блок в шаблоне оплаты. класс Creativator_Payfort_Block расширяет Mage_Checkout_Block_Onepage_Payment_Methods { // сделать свой материал здесь } – user3040610

+0

Спасибо, user3040610, но я не понимаю, как это поможет мне показать мой метод на странице оформления заказа в разделе методы оплаты? – Vladimir

+0

Я не уверен, но, возможно, конфликт в расширении класса Mage_Payment_Model_Method_Abstract. Отладка, чтобы проверить, возвращает ли функция getOrderPlaceRedirectUrl() значение или нет. – aton1004

ответ

0

1) Вы определили вашу модель внутри «creativator_payfort» тега, так что вы должны использовать «creativator_payfort/стандарт» для модели.

2) активная метка отсутствует

 <payfort> 
      <model>creativator_payfort/standard</model> 
      <active>1</active>` 
Смежные вопросы