class ZipMoney::Configure

Attributes

params[RW]

Public Class Methods

new() click to toggle source

Initializes a ZipMoney::Configure object

Returns ZipMoney::Configure object

# File lib/zipMoney/api/configure.rb, line 12
def initialize 
  @params      = Struct::ConfigureParams.new
  @params.metadata = Struct::Metadata.new
  @params.version  = Struct::Version.new
end

Public Instance Methods

do() click to toggle source

Performs the Configure api call on zipMoney endpoint

Returns ZipMoney::Configure object

# File lib/zipMoney/api/configure.rb, line 21
def do  
  validate
  ZipMoney.api.configure(self.params)
end
validate() click to toggle source

Performs the parameters validation

# File lib/zipMoney/api/configure.rb, line 27
def validate
  raise ArgumentError, "Params emtpy" if params.nil? 
  @errors = []
  @errors << 'base_url must be provided' if self.params.txn_id.nil? 
  raise ZipMoney::RequestError.new("Following error(s) occurred while making request, please resolve them to make the request: #{@errors}") if @errors.any?
end