Payum\Paypal\ExpressCheckout\Nvp\Action\CaptureAction::execute PHP Method

execute() public method

{@inheritDoc}
public execute ( $request )
    public function execute($request)
    {
        /** @var $request Capture */
        RequestNotSupportedException::assertSupports($this, $request);
        $details = ArrayObject::ensureArrayObject($request->getModel());
        $details['PAYMENTREQUEST_0_PAYMENTACTION'] = Api::PAYMENTACTION_SALE;
        foreach (range(0, 9) as $index) {
            if (Api::PENDINGREASON_AUTHORIZATION == $details['PAYMENTINFO_' . $index . '_PENDINGREASON']) {
                $details->defaults(['PAYMENTREQUEST_' . $index . '_COMPLETETYPE' => 'Complete']);
                $this->gateway->execute(new DoCapture($details, $index));
            }
        }
        parent::execute($request);
    }

Usage Example

コード例 #1
0
ファイル: CaptureActionTest.php プロジェクト: eamador/Payum
 /**
  * @test
  */
 public function shouldNotAddNotifyUrlIfCaptureTokenNotSet()
 {
     $details = new \ArrayObject();
     $tokenFactoryMock = $this->getMock(GenericTokenFactoryInterface::class);
     $tokenFactoryMock->expects($this->never())->method('createNotifyToken');
     $action = new CaptureAction();
     $action->setGateway($this->createGatewayMock());
     $action->setGenericTokenFactory($tokenFactoryMock);
     $action->execute(new Capture($details));
     $this->assertNotEmpty($details);
     $this->assertArrayNotHasKey('PAYMENTREQUEST_0_NOTIFYURL', $details);
 }
All Usage Examples Of Payum\Paypal\ExpressCheckout\Nvp\Action\CaptureAction::execute
CaptureAction