Module: Transfer

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

Class Method Summary collapse

Class Method Details

.create_transfer_reciept(body) ⇒ Object



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

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

.finalize_transfers(body) ⇒ Object



30
31
32
33
34
35
# File 'lib/paystackapi/core/transfer.rb', line 30

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

.init_transfer(body) ⇒ Object



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

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

.list_transfer_recieptObject



8
9
10
11
12
# File 'lib/paystackapi/core/transfer.rb', line 8

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

.list_transfersObject



25
26
27
28
29
# File 'lib/paystackapi/core/transfer.rb', line 25

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

.update_transfer_reciept(body, trf_code) ⇒ Object



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

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