Ejemplo n.º 1
0
 /**
  * Setup
  */
 protected function setUp()
 {
     $methods = ['id', 'merchantAccountId', 'orderId', 'paypalPaymentId', 'createdUsing', 'type', 'createdAt', 'amount', 'status', 'settlementBatchId', 'paymentInstrumentType'];
     $this->braintreeSearchAdapterMock = $this->getMockBuilder(BraintreeSearchAdapter::class)->setMethods($methods)->disableOriginalConstructor()->getMock();
     foreach ($methods as $method) {
         $this->braintreeSearchAdapterMock->expects($this->once())->method($method)->willReturn(new BraintreeSearchNodeStub());
     }
     $this->appliersPoolMock = $this->getMockBuilder(AppliersPool::class)->setMethods(['getApplier'])->disableOriginalConstructor()->getMock();
     $this->applierMock = $this->getMockBuilder(ApplierInterface::class)->setMethods(['apply'])->disableOriginalConstructor()->getMock();
 }
 /**
  * @param OrderPaymentInterface $payment
  * @return boolean
  */
 private function isExpiredAuthorization(OrderPaymentInterface $payment)
 {
     $collection = $this->braintreeAdapter->search([$this->braintreeSearchAdapter->id()->is($payment->getLastTransId()), $this->braintreeSearchAdapter->status()->is(Transaction::AUTHORIZATION_EXPIRED)]);
     return $collection->maximumCount() > 0;
 }
Ejemplo n.º 3
0
 /**
  * Init fields map with Braintree filters
  * @return void
  */
 private function initFieldsToFiltersMap()
 {
     $this->searchFieldsToFiltersMap = ['id' => $this->braintreeSearchAdapter->id(), 'merchantAccountId' => $this->braintreeSearchAdapter->merchantAccountId(), 'orderId' => $this->braintreeSearchAdapter->orderId(), 'paypalDetails_paymentId' => $this->braintreeSearchAdapter->paypalPaymentId(), 'createdUsing' => $this->braintreeSearchAdapter->createdUsing(), 'type' => $this->braintreeSearchAdapter->type(), 'createdAt' => $this->braintreeSearchAdapter->createdAt(), 'amount' => $this->braintreeSearchAdapter->amount(), 'status' => $this->braintreeSearchAdapter->status(), 'settlementBatchId' => $this->braintreeSearchAdapter->settlementBatchId(), 'paymentInstrumentType' => $this->braintreeSearchAdapter->paymentInstrumentType()];
 }