Class: PagSeguro::ManualSubscriptionCharger

Inherits:
Object
  • Object
show all
Includes:
Extensions::Credentiable, Extensions::EnsureType, Extensions::MassAssignment
Defined in:
lib/pagseguro/manual_subscription_charger.rb,
lib/pagseguro/manual_subscription_charger/response.rb,
lib/pagseguro/manual_subscription_charger/request_serializer.rb,
lib/pagseguro/manual_subscription_charger/response_serializer.rb

Defined Under Namespace

Classes: RequestSerializer, Response, ResponseSerializer

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

Methods included from Extensions::EnsureType

#ensure_type

Instance Attribute Details

#itemsObject

Set items



19
20
21
# File 'lib/pagseguro/manual_subscription_charger.rb', line 19

def items
  @items
end

#referenceObject

Set reference



10
11
12
# File 'lib/pagseguro/manual_subscription_charger.rb', line 10

def reference
  @reference
end

#subscription_codeObject

Set subscription code of a manual subscription



13
14
15
# File 'lib/pagseguro/manual_subscription_charger.rb', line 13

def subscription_code
  @subscription_code
end

#transaction_codeObject

Set transaction code, it is within the response



16
17
18
# File 'lib/pagseguro/manual_subscription_charger.rb', line 16

def transaction_code
  @transaction_code
end

Instance Method Details

#createObject



37
38
39
40
41
42
43
# File 'lib/pagseguro/manual_subscription_charger.rb', line 37

def create
  request = Request.post_xml('pre-approvals/payment', API_VERSION, credentials, xml_params)

  Response.new(request, self).serialize

  self
end

#errorsObject

Set errors



22
23
24
# File 'lib/pagseguro/manual_subscription_charger.rb', line 22

def errors
  @errors ||= Errors.new
end

#update_attributes(attrs) ⇒ Object

Update all attributes



33
34
35
# File 'lib/pagseguro/manual_subscription_charger.rb', line 33

def update_attributes(attrs)
  attrs.each { |name, value| send("#{name}=", value) }
end