本文整理汇总了PHP中Stripe_Customer::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Stripe_Customer::all方法的具体用法?PHP Stripe_Customer::all怎么用?PHP Stripe_Customer::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stripe_Customer
的用法示例。
在下文中一共展示了Stripe_Customer::all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_all
/**
* Get last (n) charges up to 100 (default). Cannot return more than 100 at a time. Data
* returned is sorted with most recent first.
*
* @return array - function returns associative array from stripe, we cant get objects
*/
public function get_all($num_customers = 100, $offset = 0)
{
try {
$ch = Stripe_Customer::all(array('count' => $num_customers, 'offset' => $offset));
return $ch;
} catch (Exception $e) {
$this->error = TRUE;
$this->message = $e->getMessage();
$this->code = $e->getCode();
return FALSE;
}
}
示例2: getCustomers
/**
* Get all customers
* @param string $limit Number of customers to retrieve
* @param string $ending_before ID of the first element in the previous list
* @param string $starting_after ID of the last element in the previous list
* @param mixed $created Created hash
* @return array|false
*/
public function getCustomers($limit = 10, $ending_before = null, $starting_after = null, $created = null)
{
try {
$params = array_filter(array('limit' => $limit, 'ending_before' => $ending_before, 'starting_after' => $starting_after, 'created' => $created));
return Stripe_Customer::all($params, $this->access_token);
} catch (Exception $ex) {
$this->log($ex);
return false;
}
}