public function testPayWithSavedCard() { $this->setMockHttpResponse('RestCreateCardSuccess.txt'); $response = $this->gateway->createCard($this->options)->send(); $cardRef = $response->getCardReference(); $this->setMockHttpResponse('RestPurchaseSuccess.txt'); $response = $this->gateway->purchase(array('amount' => '10.00', 'cardReference' => $cardRef))->send(); $this->assertTrue($response->isSuccessful()); $this->assertEquals('44E89981F8714392Y', $response->getTransactionReference()); $this->assertNull($response->getMessage()); }