本文整理汇总了PHP中MS_Model_Member::set_gateway_profile方法的典型用法代码示例。如果您正苦于以下问题:PHP MS_Model_Member::set_gateway_profile方法的具体用法?PHP MS_Model_Member::set_gateway_profile怎么用?PHP MS_Model_Member::set_gateway_profile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MS_Model_Member
的用法示例。
在下文中一共展示了MS_Model_Member::set_gateway_profile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: save_cim_profile
/**
* Save CIM profile IDs.
*
* @since 1.0.0
* @param MS_Model_Member $member The member to save CIM IDs.
* @param string $cim_profile_id The CIM profile ID to save.
* @param string $cim_payment_profile_id The CIM payment profile ID to save.
*/
protected function save_cim_profile($member, $cim_profile_id, $cim_payment_profile_id)
{
$member->set_gateway_profile($this->id, 'cim_profile_id', $cim_profile_id);
$member->set_gateway_profile($this->id, 'cim_payment_profile_id', $cim_payment_profile_id);
$this->save_card_info($member);
$member->save();
do_action('ms_gateway_authorize_save_cim_profile', $member, $cim_profile_id, $cim_payment_profile_id, $this);
}