Module: Cryptomus::Client
- Defined in:
- lib/cryptomus/client.rb
Class Method Summary collapse
- .balance ⇒ Hash
- .connection ⇒ Object
- .create_payment(attributes) ⇒ Hash
- .create_wallet(attributes) ⇒ Hash
- .list_payments(cursor: nil, date_from: nil, date_to: nil) ⇒ Hash
- .list_services ⇒ Hash
- .payment(uuid: nil, order_id: nil) ⇒ Hash
Class Method Details
.balance ⇒ Hash
77 78 79 |
# File 'lib/cryptomus/client.rb', line 77 def balance connection.post('/v1/balance') end |
.connection ⇒ Object
81 82 83 |
# File 'lib/cryptomus/client.rb', line 81 def connection @connection ||= Connection.new end |
.create_payment(attributes) ⇒ Hash
20 21 22 |
# File 'lib/cryptomus/client.rb', line 20 def create_payment(attributes) connection.post('/v1/payment', body: attributes) end |
.create_wallet(attributes) ⇒ Hash
68 69 70 |
# File 'lib/cryptomus/client.rb', line 68 def create_wallet(attributes) connection.post('/v1/wallet', body: attributes) end |
.list_payments(cursor: nil, date_from: nil, date_to: nil) ⇒ Hash
30 31 32 33 34 35 36 |
# File 'lib/cryptomus/client.rb', line 30 def list_payments(cursor: nil, date_from: nil, date_to: nil) attributes = { date_from:, date_to: }.compact attributes = nil if attributes.empty? query = { cursor: }.compact query = nil if query.empty? connection.post('/v1/payment/list', body: attributes, query:) end |
.list_services ⇒ Hash
51 52 53 |
# File 'lib/cryptomus/client.rb', line 51 def list_services connection.post('/v1/payment/services', body: {}) end |
.payment(uuid: nil, order_id: nil) ⇒ Hash
43 44 45 46 |
# File 'lib/cryptomus/client.rb', line 43 def payment(uuid: nil, order_id: nil) attributes = { uuid:, order_id: }.compact connection.post('/v1/payment/info', body: attributes) end |