Class: Epaybg::Recurring::Payment
- Inherits:
-
Object
- Object
- Epaybg::Recurring::Payment
- Defined in:
- lib/epaybg/recurring/payment.rb
Constant Summary collapse
- RESPONSE_STATUS_CODES =
{ ok: '00', err: '96', duplicate: '94' }
Instance Attribute Summary collapse
-
#aid ⇒ Object
Returns the value of attribute aid.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#clientid ⇒ Object
Returns the value of attribute clientid.
-
#idn ⇒ Object
Returns the value of attribute idn.
-
#ref ⇒ Object
Returns the value of attribute ref.
-
#secondid ⇒ Object
Returns the value of attribute secondid.
-
#tdate ⇒ Object
Returns the value of attribute tdate.
-
#tid ⇒ Object
Returns the value of attribute tid.
-
#xtype ⇒ Object
Returns the value of attribute xtype.
Instance Method Summary collapse
-
#initialize(params = {}) {|_self| ... } ⇒ Payment
constructor
A new instance of Payment.
- #respond_with(symbol) ⇒ Object
- #response_array ⇒ Object
Constructor Details
#initialize(params = {}) {|_self| ... } ⇒ Payment
Returns a new instance of Payment.
13 14 15 16 17 18 19 |
# File 'lib/epaybg/recurring/payment.rb', line 13 def initialize(params = {}) params.each do |k, v| instance_variable_set("@#{k}", v) end yield self if block_given? end |
Instance Attribute Details
#aid ⇒ Object
Returns the value of attribute aid.
11 12 13 |
# File 'lib/epaybg/recurring/payment.rb', line 11 def aid @aid end |
#amount ⇒ Object
Returns the value of attribute amount.
11 12 13 |
# File 'lib/epaybg/recurring/payment.rb', line 11 def amount @amount end |
#clientid ⇒ Object
Returns the value of attribute clientid.
11 12 13 |
# File 'lib/epaybg/recurring/payment.rb', line 11 def clientid @clientid end |
#idn ⇒ Object
Returns the value of attribute idn.
11 12 13 |
# File 'lib/epaybg/recurring/payment.rb', line 11 def idn @idn end |
#ref ⇒ Object
Returns the value of attribute ref.
11 12 13 |
# File 'lib/epaybg/recurring/payment.rb', line 11 def ref @ref end |
#secondid ⇒ Object
Returns the value of attribute secondid.
11 12 13 |
# File 'lib/epaybg/recurring/payment.rb', line 11 def secondid @secondid end |
#tdate ⇒ Object
Returns the value of attribute tdate.
11 12 13 |
# File 'lib/epaybg/recurring/payment.rb', line 11 def tdate @tdate end |
#tid ⇒ Object
Returns the value of attribute tid.
11 12 13 |
# File 'lib/epaybg/recurring/payment.rb', line 11 def tid @tid end |
#xtype ⇒ Object
Returns the value of attribute xtype.
11 12 13 |
# File 'lib/epaybg/recurring/payment.rb', line 11 def xtype @xtype end |
Instance Method Details
#respond_with(symbol) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/epaybg/recurring/payment.rb', line 21 def respond_with(symbol) raise 'Invalid symbol' unless RESPONSE_STATUS_CODES.keys.include?(symbol) code = RESPONSE_STATUS_CODES[symbol] @response = "XTYPE=RBC\nSTATUS=#{code}\n" end |
#response_array ⇒ Object
28 29 30 |
# File 'lib/epaybg/recurring/payment.rb', line 28 def response_array @response.split("\n") end |