Inheritance: extends Recurly_Resource
  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);
  }
 protected function uri()
 {
     if (!empty($this->_href)) {
         return $this->getHref();
     } else {
         if (!empty($this->uuid)) {
             return Recurly_Transaction::uriForTransaction($this->uuid);
         } else {
             throw new Recurly_Error('"uuid" is not supplied');
         }
     }
 }
 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);
 }
Esempio n. 4
0
 public static function get($uuid, $client = null)
 {
     return Recurly_Base::_get(Recurly_Transaction::uriForTransaction($uuid), $client);
 }