Class: RealEx::Transaction
- Inherits:
-
Object
- Object
- RealEx::Transaction
show all
- Includes:
- Initializer
- Defined in:
- lib/real_ex/transaction.rb
Constant Summary
collapse
- REQUEST_TYPES =
['auth', 'manual', 'offline', 'tss', 'payer-new', 'payer-edit', 'card-new', 'card-update-card', 'card-cancel-card']
Instance Attribute Summary collapse
Instance Method Summary
collapse
included
Constructor Details
#initialize(hash = {}) ⇒ Transaction
Returns a new instance of Transaction.
10
11
12
13
14
15
16
17
|
# File 'lib/real_ex/transaction.rb', line 10
def initialize(hash = {})
super(hash)
self. ||= []
self.autosettle ||= true
self.currency ||= RealEx::Config.currency || 'EUR'
self.remote_uri ||= RealEx::Config.remote_uri || '/epage-remote.cgi'
self.real_vault_uri ||= RealEx::Config.real_vault_uri || '/epage-remote-plugins.cgi'
end
|
Instance Attribute Details
#authcode ⇒ Object
Returns the value of attribute authcode.
6
7
8
|
# File 'lib/real_ex/transaction.rb', line 6
def authcode
@authcode
end
|
Returns the value of attribute comments.
5
6
7
|
# File 'lib/real_ex/transaction.rb', line 5
def
@comments
end
|
#pasref ⇒ Object
Returns the value of attribute pasref.
6
7
8
|
# File 'lib/real_ex/transaction.rb', line 6
def pasref
@pasref
end
|
Instance Method Details
#autosettle? ⇒ Boolean
23
24
25
|
# File 'lib/real_ex/transaction.rb', line 23
def autosettle?
autosettle
end
|
#request_type ⇒ Object
19
20
21
|
# File 'lib/real_ex/transaction.rb', line 19
def request_type
self.class.name.split('::').last.downcase
end
|
#to_xml(&block) ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/real_ex/transaction.rb', line 27
def to_xml(&block)
xml = RealEx::Client.build_xml(request_type) do |r|
r.merchantid RealEx::Config.merchant_id
r.orderid order_id
r.authcode authcode if authcode
r.pasref pasref if pasref
r.account RealEx::Config.account
if block_given?
block.call(r)
end
if !.empty?
r. do |c|
.each_with_index do |index,|
c.(, :id => index)
end
end
end
r.sha1hash hash
end
end
|