Esempio n. 1
0
 public function __construct($model)
 {
     if (false == (is_array($model) || $model instanceof \ArrayAccess)) {
         throw new InvalidArgumentException('Given model is invalid. Should be an array or ArrayAccess instance.');
     }
     parent::__construct($model);
 }
 function it_should_execute_same_request_with_details_wrapped_by_array_object(Generic $request, PaymentInterface $payment, PayumPaymentInterface $payumPayment)
 {
     $this->setPayment($payumPayment);
     $request->getModel()->willReturn($payment);
     $payment->getDetails()->willReturn(array('foo' => 'fooValue'));
     $request->setModel(Argument::type('Payum\\Core\\Bridge\\Spl\\ArrayObject'))->shouldBeCalled()->will(function ($args) use($request) {
         $request->getModel()->willReturn($args[0]);
     });
     $request->getModel()->willReturn($payment);
     $payumPayment->execute($request)->shouldBeCalled()->will(function ($args) {
         $details = $args[0]->getModel();
         $details['bar'] = 'barValue';
     });
     $payment->setDetails(array('foo' => 'fooValue', 'bar' => 'barValue'))->shouldBeCalled();
     $this->execute($request);
 }
 /**
  * @param mixed $model
  * @param int   $paymentRequestN
  */
 public function __construct($model, $paymentRequestN)
 {
     parent::__construct($model);
     $this->paymentRequestN = $paymentRequestN;
 }
 /**
  * @param mixed $model
  * @param bool  $force
  */
 public function __construct($model, $force = false)
 {
     parent::__construct($model);
     $this->force = $force;
 }
Esempio n. 5
0
 /**
  * @param object|null $firstModel
  * @param object|null $currentModel
  */
 public function __construct($firstModel = null, $currentModel = null)
 {
     parent::__construct($firstModel);
     $this->setModel($currentModel);
 }
 /**
  * @param \ArrayAccess $details
  * @param \Klarna      $klarna
  */
 public function __construct(\ArrayAccess $details, \Klarna $klarna)
 {
     parent::__construct($details);
     $this->klarna = $klarna;
 }