public function createCreditCardViaTr($regularParams, $trParams)
 {
     $trData = Braintree\TransparentRedirect::createCreditCardData(array_merge($trParams, array("redirectUrl" => "http://www.example.com")));
     return Test\Helper::submitTrRequest(Braintree\CreditCard::createCreditCardUrl(), $regularParams, $trData);
 }
 public function testCreateCreditCardFromTransparentRedirect()
 {
     $customer = Braintree\Customer::create(array('firstName' => 'Mike', 'lastName' => 'Jonez'))->customer;
     $params = array('credit_card' => array('number' => Braintree\Test\CreditCardNumbers::$visa));
     $trParams = array('creditCard' => array('customerId' => $customer->id, 'expirationMonth' => '01', 'expirationYear' => '10'));
     $trData = Braintree\TransparentRedirect::createCreditCardData(array_merge($trParams, array("redirectUrl" => "http://www.example.com")));
     $queryString = Test\Helper::submitTrRequest(Braintree\TransparentRedirect::url(), $params, $trData);
     $result = Braintree\TransparentRedirect::confirm($queryString);
     $this->assertTrue($result->success);
     $creditCard = $result->creditCard;
     $this->assertequals('401288', $creditCard->bin);
     $this->assertequals('1881', $creditCard->last4);
     $this->assertequals('01/2010', $creditCard->expirationDate);
 }