Class: RealEx::Recurring::Card
Constant Summary
Constants inherited
from Transaction
Transaction::REQUEST_TYPES
Instance Attribute Summary
Attributes inherited from Transaction
#authcode, #comments, #pasref
Instance Method Summary
collapse
Methods inherited from Transaction
#authorize!
Methods inherited from Transaction
#authorize!, #autosettle?, #initialize
included, #initialize
Instance Method Details
#destroy! ⇒ Object
119
120
121
122
|
# File 'lib/real_ex/recurring.rb', line 119
def destroy!
self.cancel = true
authorize!
end
|
#hash ⇒ Object
20030516181127.yourmerchantid.uniqueid…smithj01.John Smith.498843******9991
100
101
102
103
104
105
106
107
108
|
# File 'lib/real_ex/recurring.rb', line 100
def hash
if cancel
RealEx::Client.build_hash([RealEx::Client.timestamp, RealEx::Config.merchant_id, payer.reference, reference])
elsif update
RealEx::Client.build_hash([RealEx::Client.timestamp, RealEx::Config.merchant_id, payer.reference, reference, card.expiry_date, card.number])
else
RealEx::Client.build_hash([RealEx::Client.timestamp, RealEx::Config.merchant_id, order_id, '', '', payer.reference,card.cardholder_name,card.number])
end
end
|
#request_type ⇒ Object
73
74
75
76
77
78
79
80
81
|
# File 'lib/real_ex/recurring.rb', line 73
def request_type
if cancel
@request_type = 'card-cancel-card'
elsif update
@request_type = 'card-update-card'
else
@request_type = 'card-new'
end
end
|
#save! ⇒ Object
110
111
112
|
# File 'lib/real_ex/recurring.rb', line 110
def save!
authorize!
end
|
#to_xml ⇒ Object
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/real_ex/recurring.rb', line 83
def to_xml
super do |per|
per.card do |c|
c.ref reference
c.payerref payer.reference
if !self.cancel
c.number card.number
c.expdate card.expiry_date
c.chname card.cardholder_name
c.type card.type
end
end
end
end
|
#update! ⇒ Object
114
115
116
117
|
# File 'lib/real_ex/recurring.rb', line 114
def update!
self.update = true
authorize!
end
|