Beispiel #1
0
 public function testRetrieve()
 {
     self::authorizeFromEnv();
     $token = Token::create(array("card" => array("number" => "4242424242424242", "exp_month" => 6, "exp_year" => date('Y') + 3, "cvc" => "314")));
     $token_retrieve = Token::retrieve($token->id);
     $this->assertSame($token->id, $token_retrieve->id);
 }
 public function testTokenRetrieve()
 {
     $this->mockResponse($this->success_token_create_response());
     $id = 'ctn_oLyYPaymB2AozoABZYYHnb3g';
     $token = Token::retrieve($id);
     $this->assertObjectHasAttribute('token', $token);
     $this->assertFalse($token->is_used);
     $this->assertFalse($token->has_expired);
 }
Beispiel #3
0
 /**
  *
  * @group   ecommerce
  */
 public function testTokenRetrieveInvalidToken()
 {
     $this->mockResponse($this->failed_token_create_response_invalid_token());
     $response = Token::retrieve('ctn_oLyYPaymB2AozoABZYYH');
     $this->assertObjectHasAttribute('error', $response);
     $this->assertEquals($response->error->code, 20005);
 }