public function testGetFailedTransaction() { // GET response is "200 OK", yet transaction had an error $this->client->addResponse('GET', '/transactions/012345678901234567890123456789ab', 'transactions/show-200-error.xml'); $transaction = Recurly_Transaction::get('012345678901234567890123456789ab', $this->client); $this->assertInstanceOf('Recurly_Transaction', $transaction); $this->assertInstanceOf('Recurly_TransactionError', $transaction->transaction_error); }
public function testGetFailedTransaction() { // GET response is "200 OK", yet transaction had an error $this->client->addResponse('GET', '/transactions/012345678901234567890123456789ab', 'transactions/show-200-error.xml'); $transaction = Recurly_Transaction::get('012345678901234567890123456789ab', $this->client); $this->assertInstanceOf('Recurly_Transaction', $transaction); $this->assertInstanceOf('Recurly_TransactionError', $transaction->transaction_error); $this->assertEquals('invalid_card_number', $transaction->transaction_error->error_code); $this->assertEquals('hard', $transaction->transaction_error->error_category); $this->assertEquals('The credit card number is not valid. The customer needs to try a different number.', $transaction->transaction_error->merchant_message); $this->assertEquals('Your card number is not valid. Please update your card number.', $transaction->transaction_error->customer_message); $this->assertEquals('123', $transaction->transaction_error->gateway_error_code); }