【问题标题】:Recurly : Get Account Info from Email IdRecurly : 从电子邮件 ID 获取帐户信息
【发布时间】:2016-06-14 11:53:23
【问题描述】:

我正在使用 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);

这可能吗?

【问题讨论】:

    标签: recurly


    【解决方案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);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-22
      • 1970-01-01
      • 2016-04-05
      • 1970-01-01
      • 2014-09-08
      • 1970-01-01
      • 2017-03-17
      相关资源
      最近更新 更多