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


PHP Braintree_Customer::search方法代码示例

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


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

示例1: searchUserInBrainTree

 public function searchUserInBrainTree($objUser)
 {
     echo 'searchUserInBrainTree';
     //        $braintree_id = '12';
     $collection = Braintree_Customer::search([Braintree_CustomerSearch::id()->is($objUser->braintree_id), Braintree_CustomerSearch::addressFirstName()->is($objUser->full_name)]);
     //        $customer = Braintree_Customer::find($objUser->braintree_id);
     //        pr($customer);
     $arrUser = $collection->_ids;
     pr($arrUser);
 }
开发者ID:CapsuleCorpIndonesia,项目名称:martabak_revolution,代码行数:10,代码来源:Payment.php

示例2: test_createdAt

 function test_createdAt()
 {
     $customer = Braintree_Customer::createNoValidate();
     $past = clone $customer->createdAt;
     $past->modify("-1 hour");
     $future = clone $customer->createdAt;
     $future->modify("+1 hour");
     $collection = Braintree_Customer::search(array(Braintree_CustomerSearch::id()->is($customer->id), Braintree_CustomerSearch::createdAt()->between($past, $future)));
     $this->assertEquals(1, $collection->maximumCount());
     $this->assertEquals($customer->id, $collection->firstItem()->id);
     $collection = Braintree_Customer::search(array(Braintree_CustomerSearch::id()->is($customer->id), Braintree_CustomerSearch::createdAt()->lessThanOrEqualTo($future)));
     $this->assertEquals(1, $collection->maximumCount());
     $this->assertEquals($customer->id, $collection->firstItem()->id);
     $collection = Braintree_Customer::search(array(Braintree_CustomerSearch::id()->is($customer->id), Braintree_CustomerSearch::createdAt()->greaterThanOrEqualTo($past)));
     $this->assertEquals(1, $collection->maximumCount());
     $this->assertEquals($customer->id, $collection->firstItem()->id);
 }
开发者ID:robelkin,项目名称:braintree_php,代码行数:17,代码来源:CustomerAdvancedSearchTest.php

示例3: test_throwsIfNoOperatorNodeGiven

 function test_throwsIfNoOperatorNodeGiven()
 {
     $this->setExpectedException('InvalidArgumentException', 'Operator must be provided');
     Braintree_Customer::search(array(Braintree_CustomerSearch::creditCardExpirationDate()));
 }
开发者ID:buga1234,项目名称:buga_segforours,代码行数:5,代码来源:CustomerAdvancedSearchTest.php

示例4: _selectBulk

 /**
  * Selects bulk of customers to process
  * 
  * @param Datetime $startDate
  * @param Datetime $endDate
  */
 protected function _selectBulk($startDate, $endDate = null)
 {
     if (is_null($endDate)) {
         $endDate = new Datetime();
     }
     try {
         $customers = Braintree_Customer::search(array(Braintree_CustomerSearch::createdAt()->between($startDate, $endDate)));
     } catch (Exception $e) {
         Mage::logException($e);
         $customers = false;
     }
     if ($customers) {
         if ($customers->maximumCount() == 0) {
             return;
         } else {
             if ($customers->maximumCount() >= self::BULK_MAX_SIZE) {
                 $this->_output('There are more than ' . self::BULK_MAX_SIZE . ' customers in interval between ' . $startDate->format('Y-m-d') . ' and ' . $endDate->format('Y-m-d') . '. Selecting smaller periods');
                 $customers = false;
             }
         }
     }
     if ($customers === false) {
         $median = clone $startDate;
         $interval = new DateInterval('P' . ceil($endDate->diff($startDate)->days / 2) . 'D');
         $median->add($interval);
         $this->_selectBulk($startDate, $median);
         $this->_selectBulk($median, $endDate);
     } else {
         $this->_processBulk($customers);
     }
 }
开发者ID:portchris,项目名称:NaturalRemedyCompany,代码行数:37,代码来源:braintreeIds.php

示例5: DateTime

if (isset($_GET['action']) && $_GET['action'] == 'generateNewCustomer') {
    $faker = Faker\Factory::create();
    $firstName = $faker->firstName;
    $lastName = $faker->lastName;
    $createCustomer = Braintree_Customer::create(['firstName' => $firstName, 'lastName' => $lastName, 'company' => $faker->company, 'email' => $firstName . "." . $lastName . "@dummy.com", 'phone' => $faker->phoneNumber, 'fax' => $faker->phoneNumber]);
    if ($createCustomer->success) {
        echo '<div class="alert alert-success" role="alert">Customer "' . $firstName . " " . $lastName . '" is generated.</div>';
    } else {
        echo "<div class='alert alert-danger' role='alert'>{$createCustomer->message}</div>";
    }
}
// continue loading customers page
$now = new DateTime();
$past = clone $now;
$past = $past->modify("-5 month");
$customerCollection = Braintree_Customer::search([Braintree_CustomerSearch::createdAt()->between($past, $now)]);
?>

<div class="page-header">
  <h1>Customers <small>click payment method to charge</small></h1>
</div>

<a href="./customers.php?action=generateNewCustomer" class="btn btn-primary">Generate new customer</a>
<br/><br/>

<table class="table table-striped">
  <thead>
    <tr>
      <th>ID</th>
      <th>First Name</th>
      <th>Last Name</th>
开发者ID:joseph-peng,项目名称:braintree-chicago,代码行数:31,代码来源:customers.php


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