本文整理匯總了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;
}
}