Class: SynapsePayRest::Client
- Inherits:
-
Object
- Object
- SynapsePayRest::Client
- Defined in:
- lib/synapse_pay_rest/client.rb
Overview
Initializes various wrapper settings such as development mode and request header values. Also stores and initializes endpoint class instances (Users, Nodes, Transactions) for making API calls.
Instance Attribute Summary collapse
-
#atms ⇒ Object
Returns the value of attribute atms.
-
#client_endpoint ⇒ Object
Returns the value of attribute client_endpoint.
-
#crypto_quotes ⇒ Object
Returns the value of attribute crypto_quotes.
- #http_client ⇒ SynapsePayRest::HTTPClient (also: #client)
-
#institutions ⇒ Object
Returns the value of attribute institutions.
- #nodes ⇒ SynapsePayRest::Nodes
-
#statements ⇒ Object
Returns the value of attribute statements.
-
#subnets ⇒ Object
Returns the value of attribute subnets.
- #subscriptions ⇒ SynapsePayRest::Subscriptions
- #transactions ⇒ SynapsePayRest::Transactions (also: #trans)
- #users ⇒ SynapsePayRest::Users
Instance Method Summary collapse
- #get_crypto_quotes ⇒ Object
-
#initialize(client_id:, client_secret:, ip_address:, fingerprint: nil, development_mode: true, **options) ⇒ Client
constructor
A new instance of Client.
- #issue_public_key(scope: "OAUTH|POST,USERS|POST,USERS|GET,USER|GET,USER|PATCH,SUBSCRIPTIONS|GET,SUBSCRIPTIONS|POST,SUBSCRIPTION|GET,SUBSCRIPTION|PATCH,CLIENT|REPORTS,CLIENT|CONTROLS") ⇒ Object
Constructor Details
#initialize(client_id:, client_secret:, ip_address:, fingerprint: nil, development_mode: true, **options) ⇒ Client
Returns a new instance of Client.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/synapse_pay_rest/client.rb', line 31 def initialize(client_id:, client_secret:, ip_address:, fingerprint: nil, development_mode: true, **) base_url = if development_mode 'https://uat-api.synapsefi.com/v3.1' else 'https://api.synapsefi.com/v3.1' end @http_client = HTTPClient.new(base_url: base_url, client_id: client_id, client_secret: client_secret, fingerprint: fingerprint, ip_address: ip_address, **) @users = Users.new @http_client @nodes = Nodes.new @http_client @subnets = Subnets.new @http_client @transactions = Transactions.new @http_client @subscriptions = Subscriptions.new @http_client @institutions = Institutions.new @http_client @client_endpoint = ClientEndpoint.new @http_client @atms = Atms.new @http_client @crypto_quotes = CryptoQuotes.new @http_client @statements = Statements.new @http_client end |
Instance Attribute Details
#atms ⇒ Object
Returns the value of attribute atms.
16 17 18 |
# File 'lib/synapse_pay_rest/client.rb', line 16 def atms @atms end |
#client_endpoint ⇒ Object
Returns the value of attribute client_endpoint.
16 17 18 |
# File 'lib/synapse_pay_rest/client.rb', line 16 def client_endpoint @client_endpoint end |
#crypto_quotes ⇒ Object
Returns the value of attribute crypto_quotes.
16 17 18 |
# File 'lib/synapse_pay_rest/client.rb', line 16 def crypto_quotes @crypto_quotes end |
#http_client ⇒ SynapsePayRest::HTTPClient Also known as: client
16 17 18 |
# File 'lib/synapse_pay_rest/client.rb', line 16 def http_client @http_client end |
#institutions ⇒ Object
Returns the value of attribute institutions.
16 17 18 |
# File 'lib/synapse_pay_rest/client.rb', line 16 def institutions @institutions end |
#nodes ⇒ SynapsePayRest::Nodes
16 17 |
# File 'lib/synapse_pay_rest/client.rb', line 16 attr_accessor :http_client, :users, :nodes, :subnets, :transactions, :subscriptions, :institutions, :client_endpoint, :atms, :crypto_quotes, :statements |
#statements ⇒ Object
Returns the value of attribute statements.
16 17 18 |
# File 'lib/synapse_pay_rest/client.rb', line 16 def statements @statements end |
#subnets ⇒ Object
Returns the value of attribute subnets.
16 17 18 |
# File 'lib/synapse_pay_rest/client.rb', line 16 def subnets @subnets end |
#subscriptions ⇒ SynapsePayRest::Subscriptions
16 17 |
# File 'lib/synapse_pay_rest/client.rb', line 16 attr_accessor :http_client, :users, :nodes, :subnets, :transactions, :subscriptions, :institutions, :client_endpoint, :atms, :crypto_quotes, :statements |
#transactions ⇒ SynapsePayRest::Transactions Also known as: trans
16 17 |
# File 'lib/synapse_pay_rest/client.rb', line 16 attr_accessor :http_client, :users, :nodes, :subnets, :transactions, :subscriptions, :institutions, :client_endpoint, :atms, :crypto_quotes, :statements |
#users ⇒ SynapsePayRest::Users
16 17 |
# File 'lib/synapse_pay_rest/client.rb', line 16 attr_accessor :http_client, :users, :nodes, :subnets, :transactions, :subscriptions, :institutions, :client_endpoint, :atms, :crypto_quotes, :statements |
Instance Method Details
#get_crypto_quotes ⇒ Object
63 64 65 |
# File 'lib/synapse_pay_rest/client.rb', line 63 def get_crypto_quotes() CryptoQuote.get(client: self) end |
#issue_public_key(scope: "OAUTH|POST,USERS|POST,USERS|GET,USER|GET,USER|PATCH,SUBSCRIPTIONS|GET,SUBSCRIPTIONS|POST,SUBSCRIPTION|GET,SUBSCRIPTION|PATCH,CLIENT|REPORTS,CLIENT|CONTROLS") ⇒ Object
59 60 61 |
# File 'lib/synapse_pay_rest/client.rb', line 59 def issue_public_key(scope: "OAUTH|POST,USERS|POST,USERS|GET,USER|GET,USER|PATCH,SUBSCRIPTIONS|GET,SUBSCRIPTIONS|POST,SUBSCRIPTION|GET,SUBSCRIPTION|PATCH,CLIENT|REPORTS,CLIENT|CONTROLS") PublicKey.issue(client: self, scope: scope) end |