使用Balanced参考现有买家和商家


Reference existing buyers and merchants with Balanced

我正在研究这个问题(获得对现有买家和商家账户的引用),该问题询问如何通过电子邮件为ruby引用一个账户,并想知道如何对php进行同样的操作?

下面是一个如何使用平衡PHP库在PHP中通过电子邮件地址查找帐户的示例:

$buyer = $marketplace->accounts->query()->filter(Balanced'Account::$f->email_address->eq("buyer2@example.org"))->one();

如果您查看平衡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";