class SynapsePayRest::ClientEndpoint
Wrapper class for /client endpoint
Attributes
client[RW]
@!attribute [rw] client
@return [SynapsePayRest::HTTPClient]
Public Class Methods
new(client)
click to toggle source
@param client [SynapsePayRest::HTTPClient]
# File lib/synapse_pay_rest/api/client.rb, line 10 def initialize(client) @client = client end
Public Instance Methods
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")
click to toggle source
Sends a GET request to /client endpoint to issue public key, and returns the response.
@param scope [String]
@raise [SynapsePayRest::Error] may return subclasses of error based on HTTP response from API
@return [Hash] API response
# File lib/synapse_pay_rest/api/client.rb, line 23 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") path = '/client?issue_public_key=YES' path += "&scope=#{scope}" client.get(path) end