Module: NeonApi::CreatePayer

Defined in:
lib/neon_api/methods/create_payer.rb

Constant Summary collapse

URL =
'V1/Payer/CreatePayersBySubAccount'

Class Method Summary collapse

Class Method Details

.create(bank_acc_id, name, cpf, email, address, number, complement, zipcode, city, state, country) ⇒ Object



4
5
6
# File 'lib/neon_api/methods/create_payer.rb', line 4

def self.create(bank_acc_id, name, cpf, email, address, number, complement, zipcode, city, state, country)
  NeonApi.client.send_request(payload(bank_acc_id, name, cpf, email, address, number, complement, zipcode, city, state, country), URL)
end

.payload(bank_acc_id, name, cpf, email, address, number, complement, zipcode, city, state, country) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/neon_api/methods/create_payer.rb', line 8

def self.payload(bank_acc_id, name, cpf, email, address, number, complement, zipcode, city, state, country)
  {
      "BankAccountId": bank_acc_id,
      "Name": name,
      "CPF": cpf,
      "Email": email,
      "ClientID": NeonApi.client.client_id,
      "Address": address,
      "Number": number,
      "Complement": complement,
      "PostalCode": zipcode,
      "City": city,
      "State": state,
      "Country": country
  }.to_json
end