D
D
Deprimovec2015-08-15 14:32:54
MODX
Deprimovec, 2015-08-15 14:32:54

How to set up automatic order status change in minishop when paying?

Website created on ModX Revo. The site must provide a paid subscription to its closed sections.
The following components are connected:

  • minishop2
  • msProfile
  • mspYaCassa
  • payandsee

The user registers, then replenishes his account. Replenishment of the account occurs through the payment of virtual goods. That is, an order is created - in the New status with this same virtual product.
After proceeding to payment / replenishment, the user flies to the selected option of the payment system. After he paid, he flies to the site and the payment is successful (tested on Yandex.Money), but the status of the order remains the same - New .
How to make an automatic transition from the New status to the Paid status ?
PS: as far as I understand, you need to additionally specify the payment option and delivery method. But in the account replenishment form, msProfile does not have these moments. Or I overlooked them.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2017-01-20
@lexikon

Notification by the system should be about successful payment, usually such a file comes with the payment module for modx, in your case mspYaCassa.
Look in /core/components/minishop2/custom/payment/*
And so you need to extend the mspaymenthandler.class.php class, in which the receive() method should contain code like

switch ($params['Status']) {
            case 'CONFIRMED':
                $this->changeOrderStatus($order, 2);
                break;
            case 'REJECTED':
                $this->changeOrderStatus($order, 4);
                break;
            default:
                break;
        }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question