重申:从电子邮件ID中获取帐户信息

时间:2016-06-14 11:53:24

标签: recurly

我正在使用Recurly来处理订阅。 在我显示付款表单之前,我需要知道登录的用户是否已经订阅。

https://dev.recurly.com/docs/get-account处的文档说account_code:

try { $account = Recurly_Account::get('1'); print "Account: $account\n"; } catch (Recurly_NotFoundError $e) { print "Account not found.\n"; }

但我试图找出一个类似于此的电话:

$account = Recurly_Account::get($User->Email);

这可能吗?

1 个答案:

答案 0 :(得分:1)

看起来您可以通过$account = Recurly_Account::get($User->Email);完成此操作 编辑:如果电子邮件地址是 account_code ,上述内容仅适用于

$found = FALSE;
$accounts = Recurly_AccountList::get();
foreach ($accounts as $account)
{
    if ($account->email == $User->Email)
    {
        $found = TRUE;
        # Do Something
    }
}
# print_r($account);