本文整理汇总了PHP中Braintree_TransparentRedirect::createCreditCardData方法的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_TransparentRedirect::createCreditCardData方法的具体用法?PHP Braintree_TransparentRedirect::createCreditCardData怎么用?PHP Braintree_TransparentRedirect::createCreditCardData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Braintree_TransparentRedirect
的用法示例。
在下文中一共展示了Braintree_TransparentRedirect::createCreditCardData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildTrData
function buildTrData($redirectUrl)
{
$customer = Mage::getSingleton('customer/session')->getCustomer();
if ($this->braintree->exists($customer->getId())) {
return Braintree_TransparentRedirect::createCreditCardData(array('redirectUrl' => $redirectUrl, 'creditCard' => array('customerId' => $customer->getId())));
} else {
$credit_card_billing = array();
$billing = $customer->getDefaultBilling();
if ($billing) {
$address = Mage::getModel('customer/address')->load($billing);
$credit_card_billing['billingAddress'] = $this->braintree->toBraintreeAddress($address);
}
return Braintree_TransparentRedirect::createCustomerData(array('redirectUrl' => $redirectUrl, 'customer' => array('id' => $customer->getId(), 'firstName' => $customer->getFirstname(), 'lastName' => $customer->getLastname(), 'company' => $customer->getCompany(), 'phone' => $customer->getTelephone(), 'fax' => $customer->getFax(), 'email' => $customer->getEmail(), 'creditCard' => $credit_card_billing)));
}
}
示例2: createCreditCardViaTr
function createCreditCardViaTr($regularParams, $trParams)
{
$trData = Braintree_TransparentRedirect::createCreditCardData(array_merge($trParams, array("redirectUrl" => "http://www.example.com")));
return Braintree_TestHelper::submitTrRequest(Braintree_CreditCard::createCreditCardUrl(), $regularParams, $trData);
}
示例3: testCreateCreditCardFromTransparentRedirect
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 = Braintree_TestHelper::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);
}
示例4: createCreditCardData
public function createCreditCardData($params)
{
return Braintree_TransparentRedirect::createCreditCardData($params);
}