Class: PaymentOxxoPolicy
- Inherits:
-
Object
- Object
- PaymentOxxoPolicy
- Defined in:
- app/policies/payment_oxxo_policy.rb
Instance Attribute Summary collapse
-
#payment ⇒ Object
readonly
Returns the value of attribute payment.
Instance Method Summary collapse
-
#initialize(payment) ⇒ PaymentOxxoPolicy
constructor
A new instance of PaymentOxxoPolicy.
- #process(options) ⇒ Object
Constructor Details
#initialize(payment) ⇒ PaymentOxxoPolicy
Returns a new instance of PaymentOxxoPolicy.
6 7 8 |
# File 'app/policies/payment_oxxo_policy.rb', line 6 def initialize(payment) @payment = payment end |
Instance Attribute Details
#payment ⇒ Object (readonly)
Returns the value of attribute payment.
4 5 6 |
# File 'app/policies/payment_oxxo_policy.rb', line 4 def payment @payment end |
Instance Method Details
#process(options) ⇒ Object
10 11 12 13 14 15 |
# File 'app/policies/payment_oxxo_policy.rb', line 10 def process() return unless [:status].eql?('paid') payment.complete if ([:amount].to_i / 100 - payment.amount).abs < 0.01 payment.order.updater.update end |