Class: Bitpagos::Client
- Inherits:
-
Object
- Object
- Bitpagos::Client
- Defined in:
- lib/bitpagos/client.rb
Constant Summary collapse
- API_BASE =
"https://www.bitpagos.com/api/v1".freeze
Instance Attribute Summary collapse
-
#api_base ⇒ Object
Returns the value of attribute api_base.
-
#headers ⇒ Object
Returns the value of attribute headers.
Instance Method Summary collapse
- #all_transactions ⇒ Object
- #completed_transactions ⇒ Object
- #get_transaction(transaction_id) ⇒ Object
-
#initialize(api_key) ⇒ Client
constructor
A new instance of Client.
- #partially_paid_transactions ⇒ Object
- #pending_transactions ⇒ Object
- #waiting_transactions ⇒ Object
Constructor Details
#initialize(api_key) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 15 |
# File 'lib/bitpagos/client.rb', line 7 def initialize(api_key) if api_key.to_s.empty? raise Bitpagos::Errors::InvalidApiKey.new("No API key provided") end @api_key = "ApiKey #{api_key}" @headers = { authorization: @api_key, content_type: :json, accept: :json } @api_base = API_BASE end |
Instance Attribute Details
#api_base ⇒ Object
Returns the value of attribute api_base.
5 6 7 |
# File 'lib/bitpagos/client.rb', line 5 def api_base @api_base end |
#headers ⇒ Object
Returns the value of attribute headers.
5 6 7 |
# File 'lib/bitpagos/client.rb', line 5 def headers @headers end |
Instance Method Details
#all_transactions ⇒ Object
20 21 22 |
# File 'lib/bitpagos/client.rb', line 20 def all_transactions retrieve_transactions end |
#completed_transactions ⇒ Object
24 25 26 |
# File 'lib/bitpagos/client.rb', line 24 def completed_transactions retrieve_transactions end |
#get_transaction(transaction_id) ⇒ Object
17 18 |
# File 'lib/bitpagos/client.rb', line 17 def get_transaction(transaction_id) end |
#partially_paid_transactions ⇒ Object
34 35 |
# File 'lib/bitpagos/client.rb', line 34 def partially_paid_transactions end |
#pending_transactions ⇒ Object
31 32 |
# File 'lib/bitpagos/client.rb', line 31 def pending_transactions end |
#waiting_transactions ⇒ Object
28 29 |
# File 'lib/bitpagos/client.rb', line 28 def waiting_transactions end |