开发者

magento payment gateway custom method return

I am doing a magento gateway for paysolution for 1.4 and 1.5 and i am stack in the return from the bank. It is my firs module an I confusing about the way MVC works.

  • The admin configuration part works perfect
  • the redirect to the bank works fine 开发者_JAVA技巧and the bank show the data from the order
  • I have the php code to analyze the return but i don't understand where to put it.

The problem is i don't know wich url i have to configure in the paysolution account and how I create the page in the module to get the return from the bank.

I you can point me the right direction I will really apriciate.

Regards,

Eduardo


you have to write a custom controller within your module in order to give the Payment Gateway a redirection URL to call.

Some gateways also requires server to server communication so they will require another URL the will call asynchronously in order to communicate transaction result.

In order to understand what is a controller I suggest you to carefully read the following tutorials:

  • http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-1-introduction-to-magento#3
  • http://blog.baobaz.com/en/blog/magento-module-create-your-own-controller

According to the fact that the transaction is successful or not, you will end your controller method with one of the following redirections:

$this->_redirect('checkout/onepage/success');

or

$this->_redirect('checkout/onepage/failure');

I suggest you to take a look at the Paypal StandardController.php under [mageinstalldir]/app/code/core/Mage/Paypal/controllers and the OnepageController.php under [mageinstalldir]/app/code/core/Mage/Checkout/controllers

Best wishes, Alessandro


Give this a try: http://colourgray.wordpress.com/2009/11/11/magento-create-a-custom-payment-method/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜