Class: Rma::Payment::Gateway::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/rma/payment/gateway/client.rb

Overview

Client class for RMA Payment Gateway. Handles all communication with the RMA Payment Gateway API.

Examples:

client = Rma::Payment::Gateway::Client.new
client.authorization
client.
client.debit_request

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = nil) ⇒ Client

Returns a new instance of Client.



22
23
24
25
# File 'lib/rma/payment/gateway/client.rb', line 22

def initialize(config = nil)
  @config = config || Rma::Payment::Gateway.configuration
  validate_configuration!
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



20
21
22
# File 'lib/rma/payment/gateway/client.rb', line 20

def access_token
  @access_token
end

#configObject (readonly)

Returns the value of attribute config.



20
21
22
# File 'lib/rma/payment/gateway/client.rb', line 20

def config
  @config
end

#private_keyObject (readonly)

Returns the value of attribute private_key.



20
21
22
# File 'lib/rma/payment/gateway/client.rb', line 20

def private_key
  @private_key
end

Instance Method Details

#account_inquiryObject

Account Inquiry methods



33
34
35
# File 'lib/rma/payment/gateway/client.rb', line 33

def 
  @account_inquiry ||= AccountInquiry.new(self)
end

#authorizationObject

Authorization methods



28
29
30
# File 'lib/rma/payment/gateway/client.rb', line 28

def authorization
  @authorization ||= Authorization.new(self)
end

#debit_requestObject

Debit Request methods



38
39
40
# File 'lib/rma/payment/gateway/client.rb', line 38

def debit_request
  @debit_request ||= DebitRequest.new(self)
end

#get(headers: {}) ⇒ Object



47
48
49
# File 'lib/rma/payment/gateway/client.rb', line 47

def get(headers: {})
  request(:get, headers: headers)
end

#post(body: {}, headers: {}) ⇒ Object

HTTP request methods



43
44
45
# File 'lib/rma/payment/gateway/client.rb', line 43

def post(body: {}, headers: {})
  request(:post, body: body, headers: headers)
end