Class: Dotpay::CancelRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/dotpay/cancel_request.rb

Constant Summary collapse

TYPE_FULL =
1
TYPE_PARTIAL =
2

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(t_id, amount, control, options = {}) ⇒ CancelRequest

Returns a new instance of CancelRequest.



10
11
12
13
14
15
16
17
18
19
# File 'lib/dotpay/cancel_request.rb', line 10

def initialize(t_id, amount, control, options = {})
  options = {
    type: TYPE_FULL
  }.merge(options)

  @t_id = t_id
  @amount = "%0.2f" % amount
  @control = control
  @type = options[:type]
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



5
6
7
# File 'lib/dotpay/cancel_request.rb', line 5

def amount
  @amount
end

#controlObject (readonly)

Returns the value of attribute control.



5
6
7
# File 'lib/dotpay/cancel_request.rb', line 5

def control
  @control
end

#t_idObject (readonly)

Returns the value of attribute t_id.



5
6
7
# File 'lib/dotpay/cancel_request.rb', line 5

def t_id
  @t_id
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/dotpay/cancel_request.rb', line 5

def type
  @type
end

Instance Method Details

#checksumObject



21
22
23
# File 'lib/dotpay/cancel_request.rb', line 21

def checksum
  calculate_checksum
end