Sha256: 1a4fba8f131e75ad41862c5200f6fa0fc712ec91af5b4fb5b59df2aebc84fa2e

Contents?: true

Size: 1.13 KB

Versions: 7

Compression:

Stored size: 1.13 KB

Contents

require_relative 'models/model_base'
require_relative 'utils/requestor'

module CorePro
  class Transfer < Models::ModelBase

    attr_accessor :customerId
    attr_accessor :fromId
    attr_accessor :toId
    attr_accessor :amount
    attr_accessor :tag
    attr_accessor :transactionId

    def self.create(customerId, fromId, toId, amount, tag, connection = nil, loggingObject = nil)
      t = Transfer.new
      t.customerId = customerId
      t.fromId = fromId
      t.toId = toId
      t.amount = amount
      t.tag = tag
      t.create connection, loggingObject
    end

    def create(connection = nil, loggingObject = nil)
      CorePro::Utils::Requestor.post('/transfer/create', Transfer, self, connection, loggingObject)
    end

    def self.void(customerId, transactionId, tag, connection = nil, loggingObject = nil)
      t = Transfer.new
      t.customerId = customerId
      t.transactionId = transactionId
      t.tag = tag
      t.void connection, loggingObject
    end

    def void(connection = nil, loggingObject = nil)
      CorePro::Utils::Requestor.post('/transfer/void', Transfer, self, connection, loggingObject)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
corepro_eg-1.0.8 lib/corepro/transfer.rb
corepro_eg-1.0.7 lib/corepro/transfer.rb
corepro_eg-1.0.6 lib/corepro/transfer.rb
corepro_eg-1.0.5 lib/corepro/transfer.rb
corepro_eg-1.0.4 lib/corepro/transfer.rb
corepro_eg-1.0.3 lib/corepro/transfer.rb
corepro_eg-1.0.2 lib/corepro/transfer.rb