Magento Forum

   
Create a new payment module based on Authorize.net
 
Inline Media
Sr. Member
 
Avatar
Total Posts:  130
Joined:  2007-09-17
The Netherlands
 

We are working on an dutch payment module (iDEAL) based on the current payment module Authorize.net.
Currently we’re stuck and we have the following questions.

1) What happens after the PLACE ORDER button is pressed?
The javascript on the button opens up the url ‘<?=$this->getUrl('checkout/onepage/saveOrder')?>’ which refers to the OnepageController I think?
But I can’t figurer what happens next.

2) How to debug Http_Client?
In the Authorize.net payment module the function onOrderValidate calls the function postRequest to post some data to Authorize.net cgi url.
I changed the url to the url of the dutch payment provider and posted some data, but this doesn’t work.
My problem is how can I debug the information posted and returned in the Varien_Http_Client?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Inline Media
Sr. Member
 
Avatar
Total Posts:  130
Joined:  2007-09-17
The Netherlands
 

Any help maybe? So I can continue developing the payment module.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@bluemotion: you are right the url goes to Mage_Checkout_OnepageController :: saveOrderAction method.

in the configuration there’s a “Enable Debug Log” flag which tells to the module to log all the requests and responses to `paygate_authorizenet_debug` table - will this help?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Inline Media
Sr. Member
 
Avatar
Total Posts:  130
Joined:  2007-09-17
The Netherlands
 
Moshe - 29 October 2007 08:03 AM

@bluemotion: you are right the url goes to Mage_Checkout_OnepageController :: saveOrderAction method.

in the configuration there’s a “Enable Debug Log” flag which tells to the module to log all the requests and responses to `paygate_authorizenet_debug` table - will this help?

Can you tell me where the flag is located?  Does it has to be in one of the Authorize.net files?
Or do you mean the Mage_Log in the admin/configuration/advanced page? This is enabled by default.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

You can see the field in Admin / System / Configuration / Payment Methods / Authorize.Net / Enable Debug Log

In the code it is retrieved by Mage::getStoreConfig(’payment/authorizenet/debug’)

The definition of this flag field is in table core_config_field where path=’payment/authorizenet/debug’

Configuration fields are added by sql/resource_setup/mysql4-(install|upgrade) files, you can see an example in Mage/Paypal/sql/paypal_setup/mysql4-upgrade-01.0-0.1.1.php

 
Magento Community Magento Community
Magento Community
Magento Community
 
Grayson
Member
 
Avatar
Total Posts:  58
Joined:  2007-11-20
Netherlands
 
bluemotion - 27 October 2007 06:19 AM

1) What happens after the PLACE ORDER button is pressed?
The javascript on the button opens up the url ‘<?=$this->getUrl('checkout/onepage/saveOrder')?>’ which refers to the OnepageController I think?

Moshe (or others), does this mean that orders in Magento get saved to the database before payment processing is done? That would be great news for an iDEAL implementation, since this payment system does not provide transaction feedback to the store (the store owner is expected to independently poll transaction status daily). This relatively unique setup (most payment providers do provide automated feedback to the store independent of the customer returning) required significant hacking in another eCommerce system that didn’t store orders until after payment processing. (In that case, if your customer pays but doesn’t return to the store upon completion, you have a payment but no order to match it to.)

 
Magento Community Magento Community
Magento Community
Magento Community
 
seldon
Sr. Member
 
Total Posts:  92
Joined:  2007-11-08
 

I’m also interested in an IDEAL addon. Please let me know how far you are! Thx!

 
Magento Community Magento Community
Magento Community
Magento Community
 
peach
Jr. Member
 
Total Posts:  22
Joined:  2008-01-11
 

am also very interested in iDEAL implementation, let me know if you need any help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Holtkamp
Jr. Member
 
Total Posts:  4
Joined:  2007-12-15
 
Inline media - 27 October 2007 06:19 AM


2) How to debug Http_Client?
In the Authorize.net payment module the function onOrderValidate calls the function postRequest to post some data to Authorize.net cgi url.
I changed the url to the url of the dutch payment provider and posted some data, but this doesn’t work.
My problem is how can I debug the information posted and returned in the Varien_Http_Client?

I did some work on having iDEAL work within the Zend Framework: Zend_Service_Ideal. Maybe this can be of additional support. I have not investigated the Varien application in detail, but since it extends the Zend Framework it should be usable in someway. Whenever your interested I can provide you with the source.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Inline Media
Sr. Member
 
Avatar
Total Posts:  130
Joined:  2007-09-17
The Netherlands
 
Holtkamp - 11 March 2008 01:12 PM

Inline media - 27 October 2007 06:19 AM


2) How to debug Http_Client?
In the Authorize.net payment module the function onOrderValidate calls the function postRequest to post some data to Authorize.net cgi url.
I changed the url to the url of the dutch payment provider and posted some data, but this doesn’t work.
My problem is how can I debug the information posted and returned in the Varien_Http_Client?

I did some work on having iDEAL work within the Zend Framework: Zend_Service_Ideal. Maybe this can be of additional support. I have not investigated the Varien application in detail, but since it extends the Zend Framework it should be usable in someway. Whenever your interested I can provide you with the source.

I’m very interested in the source, I havent had the time to take a look at it again.
I was waiting for the final version. Maybe your source could help me some how.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Holtkamp
Jr. Member
 
Total Posts:  4
Joined:  2007-12-15
 
Inline media - 11 March 2008 01:23 PM

I’m very interested in the source, I havent had the time to take a look at it again.
I was waiting for the final version. Maybe your source could help me some how.

Ok, well the code is currently working fine in another Zend Framework project, but there is still some work to do. Some logic has to be put in a kind of ‘IdealController’, or ‘TransactionController’, have a look at the manual for details.

Globally the idea is:

//Create service object and appropriate request object 
$idealConfigArray = array();
$idealConfigArray['privatecert''/securePath/certificate.cer'
$idealConfigArray['privatekey']  '/securePath/privateKey.pem'
$idealConfigArray['bankCertDir''/securePath/ideal.cer'
$ideal = new Zend_Service_Ideal($idealConfigArrayfalse); 
$request = new Zend_Service_Ideal_AcquirerTrxRequest();

//Set parameters for TransactionRequest
$request->setIssuerId$issuerId );
//Make sure your ideal controller has a idealAcquirerStatusAction which processes the incoming user,process transaction status etc
$request->setMerchantReturnURL'yourserver/idealAcquirerStatus/' );  
$request->setPurchaseId$orderId  ); 
$amount *= 100;//Multiply amount by 100 to remove decimals as required by iDEAL 
$request->setAmount($amount );
$request->setCurrency'EUR' ); 
$request->setExpirationPeriod'PT1H' ); //One hour $request->setLanguage( 'nl' ); 
$request->setDescription('OrderDescription here'); //Calculate entrancecode 
$entranceCode md5(time().'MySecret'.microtime());
$entranceCode str_pad($entranceCode40md5(time()-12345), STR_PAD_LEFT); 
$request->setEntranceCode$entranceCode );

//Send request
try{
    $result 
$ideal->processRequest($request);
    if(
$result->isOK()){
    
        
//Process the transaction, store the identifier etc
    
}

catch (Zend_Service_Exception $ex{
    
//code for exception logging goes here
}//catch

Maybe this comes in handy, but it still got some work to do to integrate it in Magento. Somebody already did some effort on this?

File Attachments
iDEAL Advanced PHP NL v1.3.pdf  (File Size: 609KB - Downloads: 1800)
Zend_Service_Ideal.zip  (File Size: 14KB - Downloads: 392)
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top