0

I am trying to return the items in my order to send it for payment as such:

$orderItems = $this->getItems();

But the $orderItems is always null. I tried this with an offsite gateway, onsite gateway, it is always null. I am using it in Craft's Commerce 2.

Paras
  • 804
  • 1
  • 10
  • 25

1 Answers1

0

If anyone gets stuck here, I found out what I missed. I forgot to set the $sendCartInfo to true in my gateway. So my gateway is now like this:

<?php

namespace onegr\mine\Gateways;

use ...;

class Gateway extends CreditCardGateway
{
    public $sendCartInfo = true;

    }
    protected function createGateway(): AbstractGateway
    {
        /** @var OmnipayGateway $gateway */
        $gateway = Omnipay::create($this->getGatewayClassName());
        return $gateway;
    }
    protected function getGatewayClassName()
    {
        return '\\'.OmnipayGateway::class;
    }
}