Class: Payfast::Payment
- Inherits:
-
Object
- Object
- Payfast::Payment
- Defined in:
- lib/payfast/payment.rb
Constant Summary collapse
- ATTRIBUTES =
Payfast::Attributes.all_fields.map(&:to_sym)
Class Method Summary collapse
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(args = {}) ⇒ Payment
constructor
A new instance of Payment.
- #success? ⇒ Boolean
Constructor Details
#initialize(args = {}) ⇒ Payment
Returns a new instance of Payment.
7 8 9 10 11 12 13 |
# File 'lib/payfast/payment.rb', line 7 def initialize(args = {}) args.each do |k,v| run_validations(args) variable_name = "@#{k}" instance_variable_set(variable_name,v) unless v.nil? end end |
Class Method Details
Instance Method Details
#failed? ⇒ Boolean
23 24 25 |
# File 'lib/payfast/payment.rb', line 23 def failed? !success? end |
#success? ⇒ Boolean
19 20 21 |
# File 'lib/payfast/payment.rb', line 19 def success? status == '200' && == 'OK' end |