Class: PagSeguro::SubscriptionDiscount
- Inherits:
-
Object
- Object
- PagSeguro::SubscriptionDiscount
- Defined in:
- lib/pagseguro/subscription_discount.rb,
lib/pagseguro/subscription_discount/response.rb,
lib/pagseguro/subscription_discount/request_serializer.rb
Defined Under Namespace
Classes: RequestSerializer, Response
Constant Summary collapse
- API_VERSION =
:v2
Instance Attribute Summary collapse
-
#code ⇒ Object
The code of subscription, not the plan.
-
#type ⇒ Object
Type of discount, it can be DISCOUNT_PERCENT or DISCOUNT_AMOUNT.
-
#value ⇒ Object
Value of discount.
Attributes included from Extensions::Credentiable
Instance Method Summary collapse
-
#create ⇒ Object
The server returns only with a 200 response in case of success.
-
#errors ⇒ Object
Set errors.
Methods included from Extensions::MassAssignment
Instance Attribute Details
#code ⇒ Object
The code of subscription, not the plan
15 16 17 |
# File 'lib/pagseguro/subscription_discount.rb', line 15 def code @code end |
#type ⇒ Object
Type of discount, it can be DISCOUNT_PERCENT or DISCOUNT_AMOUNT.
9 10 11 |
# File 'lib/pagseguro/subscription_discount.rb', line 9 def type @type end |
#value ⇒ Object
Value of discount
12 13 14 |
# File 'lib/pagseguro/subscription_discount.rb', line 12 def value @value end |
Instance Method Details
#create ⇒ Object
The server returns only with a 200 response in case of success.
23 24 25 26 27 28 29 |
# File 'lib/pagseguro/subscription_discount.rb', line 23 def create request = Request.put_xml("pre-approvals/#{code}/discount", credentials, xml_params) Response.new(request, self).serialize self end |