Balanced Payments - Documentation on obtaining ref

2019-06-28 09:08发布

问题:

How would I get a reference to buyer and merchant accounts that have already been created?

I'm only finding examples for creating buyer and merchant accounts. I'm not finding any examples on getting that information back for reuse. Is there existing documentation on this or just what's in the rdoc?

回答1:

From the reference to rdoc I'll assume you're using the Ruby gem here.

There are two primary ways to lookup accounts using a unique identifier, by email_address:

account = Balanced::Account.find_by_email(email_address)

or by URI:

account = Balanced::Account.find(account_uri)

All resources within Balanced are referenced primarily by URI so you can do something like Balanced::Credit.find(credit_uri) as well.



回答2:

This has been deprecated instead now you now use Balanced::Customer.find_by_email(email_address)