我正在查看问题(obtaining references to existing buyer and merchant accounts),该问题询问如何通过电子邮件为ruby引用帐户,并想知道如何使用php执行相同操作?
答案 0 :(得分:1)
以下是使用balanced-php库在PHP中通过电子邮件地址查找帐户的示例:
$buyer = $marketplace->accounts->query()->filter(Balanced\Account::$f->email_address->eq("buyer2@example.org"))->one();
如果查看balanced-php库附带的example.php文件,您可以看到如何通过URI查找现有帐户:
print "how do we look up an existing object from the URI?\n";
$the_buyer = Balanced\Account::get($buyer->uri);
print "we got the buyer " . $the_buyer->email_address . "\n";