Class: Paystackapi::PaystackCustomers

Inherits:
Object
  • Object
show all
Defined in:
lib/paystackapi.rb

Class Method Summary collapse

Class Method Details

.create_customer(body) ⇒ Object



37
38
39
40
41
42
# File 'lib/paystackapi.rb', line 37

def self.create_customer(body)
  api = HTTParty.post("#{API::BASE_URL}" + "#{API::CUSTOMER_PATH}",
    :body => body.to_json,
    :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"})
  return api
end

.fetch_a_customer(body) ⇒ Object



48
49
50
51
52
# File 'lib/paystackapi.rb', line 48

def self.fetch_a_customer(body)
  api = HTTParty.get("#{API::BASE_URL}" + "#{API::CUSTOMER_PATH}/" + "#{body}",
    :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"})
  return api
end

.list_customerObject



43
44
45
46
47
# File 'lib/paystackapi.rb', line 43

def self.list_customer()
  api = HTTParty.get("#{API::BASE_URL}" + "#{API::CUSTOMER_PATH}",
    :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"})
  return api
end