Class: Paystackapi::PaystackTransactions

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

Class Method Summary collapse

Class Method Details

.charge_authorization(body) ⇒ Object



29
30
31
32
33
34
# File 'lib/paystackapi.rb', line 29

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

.fetch_transaction(body) ⇒ Object



24
25
26
27
28
# File 'lib/paystackapi.rb', line 24

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

.list_transaction_totalsObject



19
20
21
22
23
# File 'lib/paystackapi.rb', line 19

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

.list_transactionsObject



14
15
16
17
18
# File 'lib/paystackapi.rb', line 14

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

.verify_payment(body) ⇒ Object



9
10
11
12
13
# File 'lib/paystackapi.rb', line 9

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