module Bcash::Api::Accounts

Public Instance Methods

create_account(data) click to toggle source
# 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) click to toggle source
# 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