本文整理汇总了PHP中MS_Model_Member::get_gateway_profile方法的典型用法代码示例。如果您正苦于以下问题:PHP MS_Model_Member::get_gateway_profile方法的具体用法?PHP MS_Model_Member::get_gateway_profile怎么用?PHP MS_Model_Member::get_gateway_profile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MS_Model_Member
的用法示例。
在下文中一共展示了MS_Model_Member::get_gateway_profile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: find_customer
/**
* Get Member's Stripe Customer Object.
*
* @since 1.0.0
* @internal
*
* @param MS_Model_Member $member The member.
*/
public function find_customer($member)
{
$customer_id = $member->get_gateway_profile(self::ID, 'customer_id');
$customer = null;
if (!empty($customer_id)) {
$customer = M2_Stripe_Customer::retrieve($customer_id);
// Seems like the customer was manually deleted on Stripe website.
if (isset($customer->deleted) && $customer->deleted) {
$customer = null;
$member->set_gateway_profile(self::ID, 'customer_id', '');
}
}
return apply_filters('ms_gateway_stripe_find_customer', $customer, $member, $this);
}