Class: Client

Inherits:
Object
  • Object
show all
Defined in:
lib/compropago_sdk/client.rb

Constant Summary collapse

API_LIVE_URI =
'https://api.compropago.com/v1/'
API_SANDBOX_URI =
'https://api.compropago.com/v1/'
VERSION =
'3.0.4'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(publickey, privatekey, live) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/compropago_sdk/client.rb', line 10

def initialize(publickey, privatekey, live)
  @publickey = publickey
  @privatekey = privatekey
  @live = live

  if live
    @deploy_uri = API_LIVE_URI
  else
    @deploy_uri = API_SANDBOX_URI
  end

  @api = Service.new self
end

Instance Attribute Details

#apiObject

Returns the value of attribute api.



8
9
10
# File 'lib/compropago_sdk/client.rb', line 8

def api
  @api
end

#deploy_uriObject

Returns the value of attribute deploy_uri.



8
9
10
# File 'lib/compropago_sdk/client.rb', line 8

def deploy_uri
  @deploy_uri
end

#liveObject

Returns the value of attribute live.



8
9
10
# File 'lib/compropago_sdk/client.rb', line 8

def live
  @live
end

#privatekeyObject

Returns the value of attribute privatekey.



8
9
10
# File 'lib/compropago_sdk/client.rb', line 8

def privatekey
  @privatekey
end

#publickeyObject

Returns the value of attribute publickey.



8
9
10
# File 'lib/compropago_sdk/client.rb', line 8

def publickey
  @publickey
end

Instance Method Details

#get_passObject



28
29
30
# File 'lib/compropago_sdk/client.rb', line 28

def get_pass
  @publickey
end

#get_userObject



24
25
26
# File 'lib/compropago_sdk/client.rb', line 24

def get_user
  @privatekey
end