Class: PagSeguro::SubscriptionCanceller

Inherits:
Object
  • Object
show all
Includes:
Extensions::Credentiable, Extensions::MassAssignment
Defined in:
lib/pagseguro/subscription_canceller.rb,
lib/pagseguro/subscription_canceller/response.rb

Defined Under Namespace

Classes: Response

Constant Summary collapse

API_VERSION =
:v2

Instance Attribute Summary collapse

Attributes included from Extensions::Credentiable

#credentials

Instance Method Summary collapse

Methods included from Extensions::MassAssignment

#initialize

Instance Attribute Details

#subscription_codeObject

The code of subscription, not the plan



9
10
11
# File 'lib/pagseguro/subscription_canceller.rb', line 9

def subscription_code
  @subscription_code
end

Instance Method Details

#errorsObject

Set errors



12
13
14
# File 'lib/pagseguro/subscription_canceller.rb', line 12

def errors
  @errors ||= Errors.new
end

#saveObject



16
17
18
19
20
21
22
# File 'lib/pagseguro/subscription_canceller.rb', line 16

def save
  request = Request.get_with_auth_on_url("pre-approvals/cancel/#{subscription_code}", API_VERSION, credentials)

  Response.new(request, self).serialize

  self
end