Module: Bcash::Api::Accounts
- Included in:
- Client
- Defined in:
- lib/bcash/api/accounts.rb
Instance Method Summary collapse
Instance Method Details
#create_account(data) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/bcash/api/accounts.rb', line 8 def create_account(data) data = Bcash::Api::AccountCreationRequest.new(data) if data.valid? response = json_request :post, '/createAccount/json', data: data.to_json Bcash::Api::CreateAccountResponse.new(response) else Bcash::Api::AccountNotValidResponse.new(data) end end |
#search_account_by_cpf(cpf) ⇒ Object
3 4 5 6 |
# File 'lib/bcash/api/accounts.rb', line 3 def search_account_by_cpf(cpf) response = json_request :post, '/searchAccount/json', data: { cpf: cpf }.to_json Bcash::Api::AccountResponse.new(response) end |