Module: Synapsis

Defined in:
lib/synapsis_v3.rb,
lib/synapsis_v3.rb

Overview

Namespacing

Defined Under Namespace

Modules: APIOperations, V01 Classes: APIResource, Error, Node, Response, Subscription, Transaction, User

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.client_idObject

Returns the value of attribute client_id.



27
28
29
# File 'lib/synapsis_v3.rb', line 27

def client_id
  @client_id
end

.client_secretObject

Returns the value of attribute client_secret.



27
28
29
# File 'lib/synapsis_v3.rb', line 27

def client_secret
  @client_secret
end

.environmentObject

Returns the value of attribute environment.



27
28
29
# File 'lib/synapsis_v3.rb', line 27

def environment
  @environment
end

.loggingObject

Returns the value of attribute logging.



27
28
29
# File 'lib/synapsis_v3.rb', line 27

def logging
  @logging
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Synapsis)

    the object that the method was called on



51
52
53
# File 'lib/synapsis_v3.rb', line 51

def configure(&params)
  yield(self)
end

.connectionObject



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/synapsis_v3.rb', line 29

def connection
  @connection ||= Faraday.new(url: synapse_url) do |faraday|
    faraday.request  :multipart              # form-encode POST params

    if Synapsis.logging
      faraday.response  :detailed_logger        # form-encode POST params
    end

    faraday.request  :url_encoded            # form-encode POST params
    faraday.response :logger                 # log requests to STDOUT
    faraday.adapter  Faraday.default_adapter # make requests with Net::HTTP
  end
end

.synapse_urlObject



43
44
45
46
47
48
49
# File 'lib/synapsis_v3.rb', line 43

def synapse_url
  if environment == 'production'
    'https://synapsepay.com/'
  else
    'https://sandbox.synapsepay.com/'
  end
end