Module: Monetra::Transaction::Token

Defined in:
lib/monetra/transaction/token.rb

Defined Under Namespace

Classes: Request, Response

Class Method Summary collapse

Class Method Details

.destroy(attributes = {}) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/monetra/transaction/token.rb', line 80

def destroy(attributes={})
  request = Request.new(attributes.merge(:action => "Admin", :type => "store", :admin => "recurringdel", :username => Monetra::Configuration.user_name, :password => Monetra::Configuration.password))
  body = Connection.post(Monetra::Parse.request(request))
  body = Hash.from_xml(body)
  transfer_status = body["MonetraResp"]["DataTransferStatus"]
  responses = case body["MonetraResp"]["Resp"].class.to_s
  when "Hash"
    hash_response(body["MonetraResp"]["Resp"])
  when "Array"
    array_response(body["MonetraResp"]["Resp"])
  end
  responses
end

.edit(attributes = {}) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/monetra/transaction/token.rb', line 66

def edit(attributes={})
  request = Request.new(attributes.merge(:action => "Admin", :type => "store", :admin => "recurringedit", :username => Monetra::Configuration.user_name, :password => Monetra::Configuration.password))
  body = Connection.post(Monetra::Parse.request(request))
  body = Hash.from_xml(body)
  transfer_status = body["MonetraResp"]["DataTransferStatus"]
  responses = case body["MonetraResp"]["Resp"].class.to_s
  when "Hash"
    hash_response(body["MonetraResp"]["Resp"])
  when "Array"
    array_response(body["MonetraResp"]["Resp"])
  end
  responses
end

.find(attributes = {}) ⇒ Object



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/monetra/transaction/token.rb', line 52

def find(attributes={})
  request = Request.new(attributes.merge(:action => "Admin", :type => "store", :admin => "recurringlist", :username => Monetra::Configuration.user_name, :password => Monetra::Configuration.password))
  body = Connection.post(Monetra::Parse.request(request))
  body = Hash.from_xml(body)
  transfer_status = body["MonetraResp"]["DataTransferStatus"]
  responses = case body["MonetraResp"]["Resp"].class.to_s
  when "Hash"
    hash_response(body["MonetraResp"]["Resp"])
  when "Array"
    array_response(body["MonetraResp"]["Resp"])
  end
  responses
end

.new(attributes = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/monetra/transaction/token.rb', line 38

def new(attributes={})
  request = Request.new(attributes.merge(:action => "Admin", :type => "store", :admin => "recurringadd", :username => Monetra::Configuration.user_name, :password => Monetra::Configuration.password))
  body = Connection.post(Monetra::Parse.request(request))
  body = Hash.from_xml(body)
  transfer_status = body["MonetraResp"]["DataTransferStatus"]
  responses = case body["MonetraResp"]["Resp"].class.to_s
  when "Hash"
    hash_response(body["MonetraResp"]["Resp"])
  when "Array"
    array_response(body["MonetraResp"]["Resp"])
  end
  responses
end