Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

[paymment module] send itens like the gateway need…. how? 
 
tubadc
Sr. Member
 
Total Posts:  95
Joined:  2008-05-07
Floripa | BR
 

Hi, im creating a custom paymment module for a gateway in brazil, based on paypal module… and they need to receive some customs fields like the itens… for example if i send the form to them with a simple html form i have to create a loop for create the fields like that:

<input type="hidden" name="item_id_1" value="12345">
<input type="hidden" name="item_descr_1" value="Description 1">
<input type="hidden" name="item_quant_1" value="1">
<input type="hidden" name="item_price_1" value="100">
<input type="hidden" name="item_ship_1" value="0">
<input type="hidden" name="item_weight_1" value="0">
<input type="hidden" name="item_id_2" value="67890">
<input type="hidden" name="item_descr_2" value="Description 2">
<input type="hidden" name="item_quant_2" value="1">
<input type="hidden" name="item_price_2" value="199">
<input type="hidden" name="item_ship_2" value="0">
<input type="hidden" name="item_weight_2" value="0">
.....

how can i add this to the array....

$sArr = array(
            
'email_cobranca'          => Mage::getStoreConfig('PagSeguro/wps/business_account'),
            
'tipo'          => 'CP',
            
'return'            => Mage::getUrl('PagSeguro/standard/success',array('_secure' => true)),
            
'cancel_return'     => Mage::getUrl('PagSeguro/standard/cancel',array('_secure' => false)),
            
'notify_url'        => Mage::getUrl('PagSeguro/standard/ipn'),
            
'invoice'           => $this->getCheckout()->getLastRealOrderId(),
            
'moeda'     => $currency_code,
            
'address_override'  => 1,
            
'cliente_nome'        => $a->getFirstname()." ".$a->getLastname(),
            
'cliente_end'          => $a->getStreet(1),
            
'cliente_num'          => '',
            
'cliente_bairro'          => '',
            
'cliente_compl'          => $a->getStreet(2),
            
'cliente_cidade'              => $a->getCity(),
            
'cliente_uf'             => $a->getRegionCode(),
            
'cliente_pais'           => $a->getCountry(),
            
'cliente_cep'               => $a->getPostcode(),
            
'cliente_ddd'               => '',
            
'cliente_tel'               => '',
            
'cliente_email'               => $a->getEmail(),
        );

tks

 
Magento Community Magento Community
Magento Community
Magento Community
 
tubadc
Sr. Member
 
Total Posts:  95
Joined:  2008-05-07
Floripa | BR
 

im trying to do llike it

$sArr = array(
            
'email_cobranca'          => Mage::getStoreConfig('PagSeguro/wps/business_account'),
            
'tipo'          => 'CP',
            
'return'            => Mage::getUrl('PagSeguro/standard/success',array('_secure' => true)),
            
'cancel_return'     => Mage::getUrl('PagSeguro/standard/cancel',array('_secure' => false)),
            
'notify_url'        => Mage::getUrl('PagSeguro/standard/ipn'),
            
'invoice'           => $this->getCheckout()->getLastRealOrderId(),
            
'moeda'     => 'BRL',
            
'address_override'  => 1,
            
'cliente_nome'        => $a->getFirstname()." ".$a->getLastname(),
            
'cliente_end'          => $a->getStreet(1),
            
'cliente_num'          => '',
            
'cliente_bairro'          => '',
            
'cliente_compl'          => $a->getStreet(2),
            
'cliente_cidade'              => $a->getCity(),
            
'cliente_uf'             => $a->getRegionCode(),
            
'cliente_pais'           => $a->getCountry(),
            
'cliente_cep'               => $a->getPostcode(),
            
'cliente_ddd'               => '',
            
'cliente_tel'               => '',
            
'cliente_email'               => $a->getEmail(),
            
'tipo_frete' => 'EN',
        );
        
         
$items $this->getQuote()->getAllItems();
            if (
$items{
                $i 
1;
                foreach(
$items as $item){
                     
//echo "<pre>"; print_r($item->getData()); echo"</pre>";
                     
$sArr array_merge($sArr, array(
                        
'item_descr_'.$i      => $item->getName(),
                        
'item_id_'.$i      => $item->getSku(),
                        
'item_quant_'.$i      => $item->getQty(),
                        
'item_valor_'.$i      => ($item->getBaseCalculationPrice() - $item->getBaseDiscountAmount()),
                    ));
}}

but dosent work =)

 
Magento Community Magento Community
Magento Community
Magento Community
 
tubadc
Sr. Member
 
Total Posts:  95
Joined:  2008-05-07
Floripa | BR
 

i solved tks…

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top