本文整理汇总了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;
}