public function testUpdateCustomerFromTransparentRedirect()
 {
     $customer = Braintree\Customer::create(array('firstName' => 'Mike', 'lastName' => 'Jonez'))->customer;
     $params = array('customer' => array('first_name' => 'Second'));
     $trParams = array('customerId' => $customer->id, 'customer' => array('lastName' => 'Penultimate'));
     $trData = Braintree\TransparentRedirect::updateCustomerData(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);
     $customer = $result->customer;
     $this->assertequals('Second', $customer->firstName);
     $this->assertequals('Penultimate', $customer->lastName);
 }
예제 #2
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);
 }