Class: Cielo::API30::RecurrentPayment
- Inherits:
-
Object
- Object
- Cielo::API30::RecurrentPayment
- Defined in:
- lib/cielo/api30/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.
-
#link ⇒ Object
Returns the value of attribute link.
-
#next_recurrency ⇒ Object
Returns the value of attribute next_recurrency.
-
#recurrent_payment_id ⇒ Object
Returns the value of attribute recurrent_payment_id.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#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.
18 19 20 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 18 def initialize(=true) @authorize_now = end |
Instance Attribute Details
#authorize_now ⇒ Object
Returns the value of attribute authorize_now.
10 11 12 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 10 def @authorize_now end |
#end_date ⇒ Object
Returns the value of attribute end_date.
10 11 12 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 10 def end_date @end_date end |
#interval ⇒ Object
Returns the value of attribute interval.
10 11 12 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 10 def interval @interval end |
#link ⇒ Object
Returns the value of attribute link.
10 11 12 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 10 def link @link end |
#next_recurrency ⇒ Object
Returns the value of attribute next_recurrency.
10 11 12 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 10 def next_recurrency @next_recurrency end |
#recurrent_payment_id ⇒ Object
Returns the value of attribute recurrent_payment_id.
10 11 12 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 10 def recurrent_payment_id @recurrent_payment_id end |
#start_date ⇒ Object
Returns the value of attribute start_date.
10 11 12 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 10 def start_date @start_date end |
Class Method Details
.from_json(data) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 28 def self.from_json(data) return if data.nil? recurrent_payment = new(data["AuthorizeNow"]) recurrent_payment.start_date =data["StartDate"] recurrent_payment.end_date =data["EndDate"] recurrent_payment.interval =data["Interval"] recurrent_payment.recurrent_payment_id =data["RecurrentPaymentId"] recurrent_payment.next_recurrency =data["NextRecurrency"] recurrent_payment.link =data["Link"] recurrent_payment end |
Instance Method Details
#as_json(options = {}) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 41 def as_json(={}) { AuthorizeNow: @authorize_now, StartDate: @start_date, EndDate: @end_date, Interval: @interval } end |
#to_json(*options) ⇒ Object
22 23 24 25 26 |
# File 'lib/cielo/api30/recurrent_payment.rb', line 22 def to_json(*) hash = as_json(*) hash.reject! {|k,v| v.nil?} hash.to_json(*) end |