/** * @coversNothing */ public function testCardReferenceRequest() { $this->setMockHttpResponse('AuthoriseCardReferenceSuccess.http'); $request = new PaymentRequest($this->getHttpClient(), $this->getHttpRequest()); $request->initialize(array('intent' => 'authorize', 'amount' => '3.00', 'currency' => 'USD', 'cardReference' => 'CARD-36F38182Y8875171YKRACCUQ', 'transactionReference' => 'referenceID1')); $response = $request->send(); $this->assertInstanceOf('Omnipay\\PaypalRest\\Message\\PaymentResponse', $response); $this->assertTrue($response->isSuccessful()); $this->assertEquals('1CF71998H9869342R', $response->getTransactionReference()); }
public function testGetDataInvalid() { $request = new PaymentRequest($this->getHttpClient(), $this->getHttpRequest()); $request->initialize(array('intent' => 'test')); $this->setExpectedException('Omnipay\\Common\\Exception\\InvalidRequestException', 'Intent can only be "sale" or "authorize"'); $data = $request->getData(); }