Class: BraspagRest::Payment

Inherits:
Hashie::IUTrash show all
Includes:
Hashie::Extensions::Coercion
Defined in:
lib/braspag-rest/payment.rb

Constant Summary collapse

STATUS_AUTHORIZED =
1
STATUS_CONFIRMED =
2
STATUS_VOIDED =
10
STATUS_REFUNDED =
11

Instance Method Summary collapse

Methods inherited from Hashie::IUTrash

#inverse_attributes

Instance Method Details

#authorized?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/braspag-rest/payment.rb', line 55

def authorized?
  status.to_i.eql?(STATUS_AUTHORIZED)
end

#cancelled?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/braspag-rest/payment.rb', line 63

def cancelled?
  status.to_i.eql?(STATUS_VOIDED)
end

#captured?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/braspag-rest/payment.rb', line 59

def captured?
  status.to_i.eql?(STATUS_CONFIRMED)
end

#refunded?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/braspag-rest/payment.rb', line 67

def refunded?
  status.to_i.eql?(STATUS_REFUNDED)
end