本文整理匯總了PHP中yii\db\ActiveRecord::updateCard方法的典型用法代碼示例。如果您正苦於以下問題:PHP ActiveRecord::updateCard方法的具體用法?PHP ActiveRecord::updateCard怎麽用?PHP ActiveRecord::updateCard使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類yii\db\ActiveRecord
的用法示例。
在下文中一共展示了ActiveRecord::updateCard方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getStripeCustomer
/**
* Get the Stripe customer instance for the current user and token.
*
* @param string|null $token
* @param array $options
*
* @return \Stripe\Customer
*/
protected function getStripeCustomer($token = null, array $options = [])
{
if (!$this->user->stripeId) {
$customer = $this->user->createAsStripeCustomer($token, array_merge($options, array_filter(['coupon' => $this->coupon])));
} else {
$customer = $this->user->asStripeCustomer();
if ($token) {
$this->user->updateCard($token);
}
}
return $customer;
}
示例2: getBraintreeCustomer
/**
* Get the Braintree customer instance for the current user and token.
*
* @param string|null $token
* @param array $options
*
* @return \Braintree\Customer
*/
protected function getBraintreeCustomer($token = null, array $options = [])
{
if (!$this->user->braintreeId) {
$customer = $this->user->createAsBraintreeCustomer($token, $options);
} else {
$customer = $this->user->asBraintreeCustomer();
if ($token) {
$this->user->updateCard($token);
}
}
return $customer;
}