Class: Smartcoin::Charge

Inherits:
SmartcoinObject show all
Includes:
ApiOperations::Create, ApiOperations::List, ApiOperations::Retrieve, ApiOperations::Update, ApiResource
Defined in:
lib/smartcoin/charge.rb

Constant Summary

Constants included from ApiResource

ApiResource::BASE_URL, ApiResource::SSL_BUNDLE_PATH

Instance Method Summary collapse

Methods included from ApiOperations::List

included, #list_all

Methods included from ApiOperations::Update

#save, #update

Methods included from ApiOperations::Retrieve

included, #retrieve

Methods included from ApiOperations::Create

#create, included

Methods included from ApiResource

#api_request, #encode, included, #url_encode

Methods inherited from SmartcoinObject

class_name, #create_fields, create_from, #initialize, #metaclass, #method_missing, #reflesh_object, #serialize_params, #set_properties, #to_hash, #to_json, #to_s, #url, url

Constructor Details

This class inherits a constructor from Smartcoin::SmartcoinObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Smartcoin::SmartcoinObject

Instance Method Details

#capture(amount = nil) ⇒ Object



9
10
11
12
# File 'lib/smartcoin/charge.rb', line 9

def capture(amount=nil)
  params = {amount: amount} if amount
  update(params, '/capture')
end

#refund(amount = nil) ⇒ Object



14
15
16
17
# File 'lib/smartcoin/charge.rb', line 14

def refund(amount=nil)
  params = {amount: amount} if amount
  update(params, '/refund')
end