Module: Transaction

Defined in:
lib/paystackapi/core/transaction.rb

Class Method Summary collapse

Class Method Details

.charge_authorization(body) ⇒ Object



22
23
24
25
26
27
# File 'lib/paystackapi/core/transaction.rb', line 22

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



17
18
19
20
21
# File 'lib/paystackapi/core/transaction.rb', line 17

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



12
13
14
15
16
# File 'lib/paystackapi/core/transaction.rb', line 12

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



7
8
9
10
11
# File 'lib/paystackapi/core/transaction.rb', line 7

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



2
3
4
5
6
# File 'lib/paystackapi/core/transaction.rb', line 2

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