I am developing a payment module, which works with a webservice. After submit order, there is a session var with webservice response status. If this returns OK, the order must be set as paid and processing, else it must be canceled.

I am using capture() in my Payment model:

public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
        /** @var \Magento\Sales\Model\Order $order */
        $order = $payment->getOrder();

        /** @var \Magento\Sales\Model\Order\Address $billing */
        $billing = $order->getBillingAddress();

        try {
              //Process invoice and get 


//Also tried:



How can I do that?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.