Class: Braspag::RecurrentPayment
- Inherits:
-
Object
- Object
- Braspag::RecurrentPayment
- Defined in:
- lib/braspag/api/recurrent_payment.rb
Constant Summary collapse
- INTERVAL_MONTHLY =
"Monthly"
- INTERVAL_BIMONTHLY =
"Bimonthly"
- INTERVAL_QUARTERLY =
"Quarterly"
- INTERVAL_SEMIANNUAL =
"SemiAnnual"
- INTERVAL_ANNUAL =
"Annual"
Instance Attribute Summary collapse
-
#authorize_now ⇒ Object
Returns the value of attribute authorize_now.
-
#end_date ⇒ Object
Returns the value of attribute end_date.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(authorize_now = true) ⇒ RecurrentPayment
constructor
A new instance of RecurrentPayment.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(authorize_now = true) ⇒ RecurrentPayment
Returns a new instance of RecurrentPayment.
14 15 16 |
# File 'lib/braspag/api/recurrent_payment.rb', line 14 def initialize(=true) @authorize_now = end |
Instance Attribute Details
#authorize_now ⇒ Object
Returns the value of attribute authorize_now.
9 10 11 |
# File 'lib/braspag/api/recurrent_payment.rb', line 9 def @authorize_now end |
#end_date ⇒ Object
Returns the value of attribute end_date.
9 10 11 |
# File 'lib/braspag/api/recurrent_payment.rb', line 9 def end_date @end_date end |
#interval ⇒ Object
Returns the value of attribute interval.
9 10 11 |
# File 'lib/braspag/api/recurrent_payment.rb', line 9 def interval @interval end |
#start_date ⇒ Object
Returns the value of attribute start_date.
9 10 11 |
# File 'lib/braspag/api/recurrent_payment.rb', line 9 def start_date @start_date end |
Class Method Details
.from_json(data) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/braspag/api/recurrent_payment.rb', line 24 def self.from_json(data) if (data != nil) recurrent_payment = RecurrentPayment.new(data["AuthorizeNow"] || false) recurrent_payment.start_date =data["StartDate"] || nil recurrent_payment.end_date =data["EndDate"] || nil recurrent_payment.interval =data["Interval"] || nil return recurrent_payment end end |
Instance Method Details
#to_json(*options) ⇒ Object
18 19 20 21 22 |
# File 'lib/braspag/api/recurrent_payment.rb', line 18 def to_json(*) hash = as_json(*) hash.reject! {|k,v| v.nil?} hash.to_json(*) end |