Class: Rma::Payment::Gateway::Client
- Inherits:
-
Object
- Object
- Rma::Payment::Gateway::Client
- Defined in:
- lib/rma/payment/gateway/client.rb
Overview
Client class for RMA Payment Gateway. Handles all communication with the RMA Payment Gateway API.
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
Instance Method Summary collapse
-
#account_inquiry ⇒ Object
Account Inquiry methods.
-
#authorization ⇒ Object
Authorization methods.
-
#debit_request ⇒ Object
Debit Request methods.
- #get(headers: {}) ⇒ Object
-
#initialize(config = nil) ⇒ Client
constructor
A new instance of Client.
-
#post(body: {}, headers: {}) ⇒ Object
HTTP request methods.
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_token ⇒ Object (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 |
#config ⇒ Object (readonly)
Returns the value of attribute config.
20 21 22 |
# File 'lib/rma/payment/gateway/client.rb', line 20 def config @config end |
#private_key ⇒ Object (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_inquiry ⇒ Object
Account Inquiry methods
33 34 35 |
# File 'lib/rma/payment/gateway/client.rb', line 33 def account_inquiry @account_inquiry ||= AccountInquiry.new(self) end |
#authorization ⇒ Object
Authorization methods
28 29 30 |
# File 'lib/rma/payment/gateway/client.rb', line 28 def @authorization ||= Authorization.new(self) end |
#debit_request ⇒ Object
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 |