/** * Returns, if payment redirect for the payment method is enabled * * @param Registration $registration * @return bool */ public function redirectPaymentEnabled($registration) { if ($registration->getEvent()->getEnablePayment() === false) { return false; } /** @var AbstractPayment $paymentInstance */ $paymentInstance = $this->paymentService->getPaymentInstance($registration->getPaymentmethod()); if ($paymentInstance !== null && $paymentInstance->isRedirectEnabled()) { return true; } else { return false; } }
/** * @test * @return void */ public function getPaymentInstanceReturnsTransferPaymentInsance() { $this->subject = new PaymentService(); $this->assertInstanceOf('DERHANSEN\\SfEventMgt\\Payment\\Transfer', $this->subject->getPaymentInstance('transfer')); }