function it_should_mark_captured(GetStatusInterface $request)
 {
     $model = new ArrayObject(array('PaymentOrder' => array('Status' => APIClient::STATUS_CHARGED)));
     $request->getModel()->willReturn($model);
     $request->markCaptured()->shouldBeCalled();
     $this->execute($request);
 }
 function it_should_do_status_subrequest_with_payment_details_as_model(PaymentInterface $payment, GetStatusInterface $statusRequest, PayumPaymentInterface $payment)
 {
     $details = array('foo' => 'foo', 'bar' => 'baz');
     $statusRequest->getModel()->willReturn($payment);
     $statusRequest->setModel($details)->shouldBeCalled();
     $statusRequest->setModel($payment)->shouldBeCalled();
     $payment->execute($statusRequest)->shouldBeCalled();
     $payment->getDetails()->willReturn($details);
     $this->setPayment($payment);
     $this->execute($statusRequest);
 }
 /**
  * @param GetStatusInterface $request
  */
 public function execute($request)
 {
     /** @var BitPayResponse $model */
     $model = $request->getModel()->getResponse();
     switch ($model->getStatus()) {
         case BitPayResponse::STATUS_NEW:
             $request->markNew();
             break;
         case BitPayResponse::STATUS_PAID:
             $request->markPending();
             break;
         case BitPayResponse::STATUS_INVALID:
             $request->markFailed();
             break;
         case BitPayResponse::STATUS_EXPIRED:
             $request->markExpired();
             break;
         case BitPayResponse::STATUS_CONFIRMED:
         case BitPayResponse::STATUS_COMPLETE:
             $request->markSuccess();
             break;
         default:
             $request->markUnknown();
     }
 }
 /**
  * @param GetStatusInterface $request
  */
 public function execute($request)
 {
     $model = $request->getModel();
     if (false == isset($model['status'])) {
         $request->markNew();
         return;
     }
     if (isset($model['status']) && 'captured' == $model['status']) {
         $request->markCaptured();
         return;
     }
     if (isset($model['status']) && 'error' == $model['status']) {
         $request->markFailed();
         return;
     }
     $request->markUnknown();
 }
 function it_supports_get_status(Transaction $model, GetStatusInterface $request)
 {
     $request->getModel()->willReturn($model);
     $this->supports($request)->shouldReturn(true);
 }
Esempio n. 6
0
 /**
  * {@inheritDoc}
  *
  * @param GetStatusInterface $request
  */
 public function execute($request)
 {
     $request->markCaptured();
 }