submitTrRequest() public static method

public static submitTrRequest ( $url, $regularParams, $trData )
 public function testUpdateCreditCardFromTransparentRedirect()
 {
     $customer = Braintree\Customer::create(array('firstName' => 'Mike', 'lastName' => 'Jonez'))->customer;
     $creditCard = Braintree\CreditCard::create(array('customerId' => $customer->id, 'number' => Braintree\Test\CreditCardNumbers::$masterCard, 'expirationMonth' => '10', 'expirationYear' => '10'))->creditCard;
     $params = array('credit_card' => array('number' => Braintree\Test\CreditCardNumbers::$visa));
     $trParams = array('paymentMethodToken' => $creditCard->token, 'creditCard' => array('expirationMonth' => '11', 'expirationYear' => '11'));
     $trData = Braintree\TransparentRedirect::updateCreditCardData(array_merge($trParams, array("redirectUrl" => "http://www.example.com")));
     $queryString = Test\Helper::submitTrRequest(Braintree\TransparentRedirect::url(), $params, $trData);
     Braintree\TransparentRedirect::confirm($queryString);
     $creditCard = Braintree\CreditCard::find($creditCard->token);
     $this->assertequals('401288', $creditCard->bin);
     $this->assertequals('1881', $creditCard->last4);
     $this->assertequals('11/2011', $creditCard->expirationDate);
 }
Ejemplo n.º 2
0
 public function updateCreditCardViaTr($regularParams, $trParams)
 {
     $trData = Braintree\TransparentRedirect::updateCreditCardData(array_merge($trParams, array("redirectUrl" => "http://www.example.com")));
     return Test\Helper::submitTrRequest(Braintree\CreditCard::updateCreditCardUrl(), $regularParams, $trData);
 }
Ejemplo n.º 3
0
 public function updateCustomerViaTr($regularParams, $trParams)
 {
     Test\Helper::suppressDeprecationWarnings();
     $trData = Braintree\TransparentRedirect::updateCustomerData(array_merge($trParams, ["redirectUrl" => "http://www.example.com"]));
     return Test\Helper::submitTrRequest(Braintree\Customer::updateCustomerUrl(), $regularParams, $trData);
 }