当前位置: 首页>>代码示例>>PHP>>正文


PHP Braintree_TransparentRedirect::createCustomerData方法代码示例

本文整理汇总了PHP中Braintree_TransparentRedirect::createCustomerData方法的典型用法代码示例。如果您正苦于以下问题:PHP Braintree_TransparentRedirect::createCustomerData方法的具体用法?PHP Braintree_TransparentRedirect::createCustomerData怎么用?PHP Braintree_TransparentRedirect::createCustomerData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Braintree_TransparentRedirect的用法示例。


在下文中一共展示了Braintree_TransparentRedirect::createCustomerData方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testData_doesNotClobberDefaultTimezone

 function testData_doesNotClobberDefaultTimezone()
 {
     $originalZone = date_default_timezone_get();
     date_default_timezone_set('Europe/London');
     $trData = Braintree_TransparentRedirect::createCustomerData(array('redirectUrl' => 'http://www.example.com'));
     $zoneAfterCall = date_default_timezone_get();
     date_default_timezone_set($originalZone);
     $this->assertEquals('Europe/London', $zoneAfterCall);
 }
开发者ID:kingsolmn,项目名称:CakePHP-Braintree-Plugin,代码行数:9,代码来源:TransparentRedirectTest.php

示例2: testCreateCustomerFromTransparentRedirect

 function testCreateCustomerFromTransparentRedirect()
 {
     $params = array('customer' => array('first_name' => 'Second'));
     $trParams = array('customer' => array('lastName' => 'Penultimate'));
     $trData = Braintree_TransparentRedirect::createCustomerData(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);
     $customer = $result->customer;
     $this->assertequals('Second', $customer->firstName);
     $this->assertequals('Penultimate', $customer->lastName);
 }
开发者ID:kingsolmn,项目名称:CakePHP-Braintree-Plugin,代码行数:12,代码来源:TransparentRedirectTest.php

示例3: 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)));
     }
 }
开发者ID:technomagegithub,项目名称:inmed-magento,代码行数:15,代码来源:Management.php

示例4: createForm

 function createForm()
 {
     $form = $this->plugin->createForm(Am_Form_CreditCard::PAYFORM, $this->invoice);
     $form->addHidden(Am_Controller::ACTION_KEY)->setValue($this->_request->getActionName());
     $form->addHidden('cc_id')->setValue($this->getFiltered('cc_id'));
     $user = $this->invoice->getUser();
     $form->setDataSources(array($this->_request, new HTML_QuickForm2_DataSource_Array($form->getDefaultValues($user))));
     $form->addHidden('tr_data')->setValue(Braintree_TransparentRedirect::createCustomerData(array('redirectUrl' => $this->plugin->getPluginUrl(Am_Paysystem_Braintree::ACTION_CC) . "?cc_id=" . $this->getFiltered('cc_id'), 'customer' => array('firstName' => $this->invoice->getUser()->name_f, 'lastName' => $this->invoice->getUser()->name_l, 'email' => $this->invoice->getUser()->email, 'phone' => $this->invoice->getUser()->phone))));
     return $form;
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:10,代码来源:braintree.php

示例5: createCustomerViaTr

 function createCustomerViaTr($regularParams, $trParams)
 {
     Braintree_TestHelper::suppressDeprecationWarnings();
     $trData = Braintree_TransparentRedirect::createCustomerData(array_merge($trParams, array("redirectUrl" => "http://www.example.com")));
     return Braintree_TestHelper::submitTrRequest(Braintree_Customer::createCustomerUrl(), $regularParams, $trData);
 }
开发者ID:beevo,项目名称:disruptivestrong,代码行数:6,代码来源:CustomerTest.php

示例6: htmlentities

<?php

$trData = Braintree_TransparentRedirect::createCustomerData(array('redirectUrl' => 'http://localhost:8080/braintree'));
?>

<html>
  <head>
    <style type='text/css'>label {display: block;} input {margin-bottom: 10px;}</style>
  </head>
  <body>
    <h1>Braintree Credit Card Transaction Form</h1>
    <form id='payment-form' action='<?php 
echo Braintree_TransparentRedirect::url();
?>
' method='POST'>
      <input type='hidden' name='tr_data' value='<?php 
echo htmlentities($trData);
?>
' />
      <div>
        <h2>Customer Information</h2>
        <label for='customer_first_name'>First Name</label>
        <input type='text' name='customer[first_name]' id='customer_first_name'></input>
        <label for='customer_last_name'>Last Name</label>
        <input type='text' name='customer[last_name]' id='customer_last_name'></input>
        <label for='customer_email'>Email</label>
        <input type='text' name='customer[email]' id='customer_email'></input>
        <h2>Billing Address</h2>
        <label for='billing_street_address'>Street Address</label>
        <input type='text' name='customer[credit_card][billing_address][street_address]' id='billing_street_address'></input>
        <label for='billing_extended_address'>Extended Address</label>
开发者ID:Justin-Leung,项目名称:braintree_php_guide,代码行数:31,代码来源:form.php


注:本文中的Braintree_TransparentRedirect::createCustomerData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。