Class: SaasRunner::Resource::Transaction
- Inherits:
-
Object
- Object
- SaasRunner::Resource::Transaction
- Defined in:
- lib/saas_runner/resource/transaction.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #charge!(params = {}) ⇒ Object
-
#initialize(client) ⇒ Transaction
constructor
A new instance of Transaction.
- #refund!(params = {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ Transaction
Returns a new instance of Transaction.
6 7 8 |
# File 'lib/saas_runner/resource/transaction.rb', line 6 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/saas_runner/resource/transaction.rb', line 4 def client @client end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/saas_runner/resource/transaction.rb', line 4 def response @response end |
Instance Method Details
#charge!(params = {}) ⇒ Object
10 11 12 13 |
# File 'lib/saas_runner/resource/transaction.rb', line 10 def charge!(params = {}) @response = client.post('/transactions/charge', { transaction: params }) @response.body end |
#refund!(params = {}) ⇒ Object
15 16 17 18 |
# File 'lib/saas_runner/resource/transaction.rb', line 15 def refund!(params = {}) @response = client.post('/transactions/refund', { transaction: params }) @response.body end |