/** * Authorize payment either online or offline (process auth notification) * Updates transactions hierarchy, if required * Prevents transaction double processing * Updates payment totals, updates order status and adds proper comments * * @param bool $isOnline * @param float $amount * * @return $this */ public function authorize($isOnline, $amount) { return $this->orderPaymentProcessor->authorize($this, $isOnline, $amount); }
/** * @param bool $isOnline * @param float $amount * @dataProvider authorizeDataProvider */ public function testAuthorize($isOnline, $amount) { $this->paymentProcessor->expects($this->once())->method('authorize')->with($this->payment, $isOnline, $amount)->willReturn($this->payment); $this->assertEquals($this->payment, $this->payment->authorize($isOnline, $amount)); }