Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3877278
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:28:46+00:00 2026-05-19T22:28:46+00:00

My payment module is required to sent notifications to the payment service if an

  • 0

My payment module is required to sent notifications to the payment service if an order is canceled or refunded. I assume that the “Cancel” button on the order page (in the administration backend) will cancel the order, and that the “Credit memo” button (after an invoice has been created) will refund the order.

How do I run my code on these events? I tried using the cancel() method in my payment method model, but the code did not run.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:28:46+00:00Added an answer on May 19, 2026 at 10:28 pm

    Seems like your payment method is not using transactions or does not create authorization transaction id. It is common beginner mistake in Payment gateways development.

    To enable your payment gateway with online actions you need to implement something like this in your payment method:

    class MyBest_Payment_Model_Method extends Mage_Payment_Model_Method_Abstract
    {
        protected $_canAuthorize            = true; // Set true, if you have authorization step.
        protected $_canCapture              = true; // Set true, if you payment method allows to perform capture transaction (usally only credit cards methods)
        protected $_canRefund               = true; // Set true, if online refunds are available
        protected $_canVoid                 = true; // Set true, if you can cancel authorization via API online
    
        public function authorize(Varien_Object $payment, $amount)
        { 
    
            // ... You payment method authorization goes here ...
            // Here goes retrieving or generation non-zero, 
            // non-null value as transaction ID. 
            $transactionId = $api->someCall(); 
            // Setting tranasaction id to payment object
            // It is improtant, if you want perform online actions 
            // in future with this order!
            $payment->setTransactionId($transactionId); 
    
            // ... some other your actions ... 
            return $this;
        }
    
        public function void(Varien_Object $payment)
        {
            // ... some actions for sending cancel notification to your payment gateway
        }
    
        public function refund(Varien_Object $payment, $amount)
        {
            // ... some actions for performing an online refund ...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a payment page in asp.net, however the page where you order your
I searching for a module that can do API in Moneris payment gateway. I
I see there are some people that got Amazon’s payment module working w/ Magento
I am using Authorize.net payment module(AIM) with my cakephp framework. Payment functionality is working
I was trying to create a payment module for opencart. When i tried to
I have the following code in my simple ubercart payment gateway module to redirect
In my shipping module I'm trying to check the payment type and only return
Can someone recommend a payment gateway that allows incremental (irregularly recurring) charges to the
I wrote a payment module for X-Cart. My return url section is: require './auth.php';
I am trying to add a new payment module into Magento. However, even after

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.