cancel
Showing results for 
Search instead for 
Did you mean: 

Auto cancel orders in custom payment method Magento 2

Auto cancel orders in custom payment method Magento 2

Hi.

 

I have a strange issue in my custom payment method with Magento 2.

 

When I put a new order, in the next day Magento auto cancel the order like if a cron job search my payments to cancel them. I have a webhook endpoint in the method, but in my logs any request has been registered to cancel the payments.

 

This is my Github repo of the method: ComproPago - Magento 2

Any idea about this?

 

Tanks for help.

1 REPLY

Re: Auto cancel orders in custom payment method Magento 2

@danteay

 

Magento2 added such a feature

 

https://github.com/magento/magento2/blob/develop/app/code/Magento/Sales/Model/CronJob/CleanExpiredOr...

 

Magento 2 doing cancel order those are pending order after some days

<job name="sales_clean_orders" instance="Magento\Sales\Model\CronJob\CleanExpiredOrders" method="execute">
            <schedule>0 * * * *</schedule>
        </job>

https://github.com/magento/magento2/blob/develop/app/code/Magento/Sales/etc/crontab.xml

 

you need to disable that cron code, so it will solved your probelm.

 

 

If it will work for you then mark as solution.