Module: Transaction
- Defined in:
- lib/paystackapi/core/transaction.rb
Class Method Summary collapse
- .charge_authorization(body) ⇒ Object
- .fetch_transaction(body) ⇒ Object
- .list_transaction_totals ⇒ Object
- .list_transactions ⇒ Object
- .verify_payment(body) ⇒ Object
Class Method Details
.charge_authorization(body) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/paystackapi/core/transaction.rb', line 22 def self.(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_totals ⇒ Object
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_transactions ⇒ Object
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 |