Class: PagSeguro::SubscriptionPlan
- Inherits:
-
Object
- Object
- PagSeguro::SubscriptionPlan
- Defined in:
- lib/pagseguro/subscription_plan.rb,
lib/pagseguro/subscription_plan/response.rb,
lib/pagseguro/subscription_plan/request_serializer.rb,
lib/pagseguro/subscription_plan/response_serializer.rb
Defined Under Namespace
Classes: RequestSerializer, Response, ResponseSerializer
Constant Summary collapse
- API_VERSION =
'v2'
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#charge ⇒ Object
Returns the value of attribute charge.
-
#code ⇒ Object
Returns the value of attribute code.
-
#details ⇒ Object
Returns the value of attribute details.
-
#final_date ⇒ Object
Returns the value of attribute final_date.
-
#initial_date ⇒ Object
Returns the value of attribute initial_date.
-
#max_amount_per_payment ⇒ Object
Returns the value of attribute max_amount_per_payment.
-
#max_amount_per_period ⇒ Object
Returns the value of attribute max_amount_per_period.
-
#max_payments_per_period ⇒ Object
Returns the value of attribute max_payments_per_period.
-
#max_total_amount ⇒ Object
Returns the value of attribute max_total_amount.
-
#max_users ⇒ Object
Returns the value of attribute max_users.
-
#membership_fee ⇒ Object
Returns the value of attribute membership_fee.
-
#name ⇒ Object
Returns the value of attribute name.
-
#period ⇒ Object
Returns the value of attribute period.
-
#redirect_url ⇒ Object
Returns the value of attribute redirect_url.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#review_url ⇒ Object
Returns the value of attribute review_url.
-
#sender ⇒ Object
Returns the value of attribute sender.
-
#trial_duration ⇒ Object
Returns the value of attribute trial_duration.
Attributes included from Extensions::Credentiable
Instance Method Summary collapse
- #create ⇒ Object
-
#errors ⇒ Object
Set errors.
-
#update_attributes(attrs) ⇒ Object
Update all attributes.
- #url ⇒ Object
Methods included from Extensions::EnsureType
Methods included from Extensions::MassAssignment
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
13 14 15 |
# File 'lib/pagseguro/subscription_plan.rb', line 13 def amount @amount end |
#charge ⇒ Object
Returns the value of attribute charge.
11 12 13 |
# File 'lib/pagseguro/subscription_plan.rb', line 11 def charge @charge end |
#code ⇒ Object
Returns the value of attribute code.
22 23 24 |
# File 'lib/pagseguro/subscription_plan.rb', line 22 def code @code end |
#details ⇒ Object
Returns the value of attribute details.
26 27 28 |
# File 'lib/pagseguro/subscription_plan.rb', line 26 def details @details end |
#final_date ⇒ Object
Returns the value of attribute final_date.
18 19 20 |
# File 'lib/pagseguro/subscription_plan.rb', line 18 def final_date @final_date end |
#initial_date ⇒ Object
Returns the value of attribute initial_date.
19 20 21 |
# File 'lib/pagseguro/subscription_plan.rb', line 19 def initial_date @initial_date end |
#max_amount_per_payment ⇒ Object
Returns the value of attribute max_amount_per_payment.
17 18 19 |
# File 'lib/pagseguro/subscription_plan.rb', line 17 def max_amount_per_payment @max_amount_per_payment end |
#max_amount_per_period ⇒ Object
Returns the value of attribute max_amount_per_period.
15 16 17 |
# File 'lib/pagseguro/subscription_plan.rb', line 15 def max_amount_per_period @max_amount_per_period end |
#max_payments_per_period ⇒ Object
Returns the value of attribute max_payments_per_period.
16 17 18 |
# File 'lib/pagseguro/subscription_plan.rb', line 16 def max_payments_per_period @max_payments_per_period end |
#max_total_amount ⇒ Object
Returns the value of attribute max_total_amount.
14 15 16 |
# File 'lib/pagseguro/subscription_plan.rb', line 14 def max_total_amount @max_total_amount end |
#max_users ⇒ Object
Returns the value of attribute max_users.
9 10 11 |
# File 'lib/pagseguro/subscription_plan.rb', line 9 def max_users @max_users end |
#membership_fee ⇒ Object
Returns the value of attribute membership_fee.
20 21 22 |
# File 'lib/pagseguro/subscription_plan.rb', line 20 def membership_fee @membership_fee end |
#name ⇒ Object
Returns the value of attribute name.
10 11 12 |
# File 'lib/pagseguro/subscription_plan.rb', line 10 def name @name end |
#period ⇒ Object
Returns the value of attribute period.
12 13 14 |
# File 'lib/pagseguro/subscription_plan.rb', line 12 def period @period end |
#redirect_url ⇒ Object
Returns the value of attribute redirect_url.
24 25 26 |
# File 'lib/pagseguro/subscription_plan.rb', line 24 def redirect_url @redirect_url end |
#reference ⇒ Object
Returns the value of attribute reference.
23 24 25 |
# File 'lib/pagseguro/subscription_plan.rb', line 23 def reference @reference end |
#review_url ⇒ Object
Returns the value of attribute review_url.
25 26 27 |
# File 'lib/pagseguro/subscription_plan.rb', line 25 def review_url @review_url end |
#sender ⇒ Object
Returns the value of attribute sender.
28 29 30 |
# File 'lib/pagseguro/subscription_plan.rb', line 28 def sender @sender end |
#trial_duration ⇒ Object
Returns the value of attribute trial_duration.
21 22 23 |
# File 'lib/pagseguro/subscription_plan.rb', line 21 def trial_duration @trial_duration end |
Instance Method Details
#create ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/pagseguro/subscription_plan.rb', line 45 def create request = Request.post_xml('pre-approvals/request', API_VERSION, credentials, xml_params) Response.new(request, self).serialize self end |
#errors ⇒ Object
Set errors
31 32 33 |
# File 'lib/pagseguro/subscription_plan.rb', line 31 def errors @errors ||= Errors.new end |
#update_attributes(attrs) ⇒ Object
Update all attributes
36 37 38 |
# File 'lib/pagseguro/subscription_plan.rb', line 36 def update_attributes(attrs) attrs.each { |name, value| send("#{name}=", value) } end |