Your order integration
<?php
namespace App\Model;
class Payment
{
public $details;
public $price;
public $currency;
}<?php
namespace App\Payum\Action;
use App\Model\Payment;
use Payum\Core\Request\Capture;
use Payum\Core\Exception\RequestNotSupportedException;
use Payum\Core\Action\ActionInterface;
use Payum\Core\GatewayAwareTrait;
use Payum\Core\GatewayAwareInterface;
class CaptureOrderUsingFooAction implements ActionInterface, GatewayAwareInterface
{
use GatewayAwareTrait
public function execute($request)
{
RequestNotSupportedException::assertSupports($this, $request);
$order = $request->getModel();
$request->setModel(new \ArrayObject(array(
'foo_price' => $order->price,
'foo_currency' => $order->currency
)));
$this->gateway->execute($request);
$order->details = $request->getModel();
$request->setModel($order);
}
public function supports($request)
{
return
$request instanceof Capture &&
$request->getModel() instanceof Payment
;
}
}Supporting Payum
Last updated