Class: Payment::Gateways::PurchaseOrder
- Inherits:
-
BasePaymentGateway
- Object
- BasePaymentGateway
- Payment::Gateways::PurchaseOrder
- Defined in:
- app/services/payment/gateways/purchase_order.rb
Defined Under Namespace
Classes: Result
Instance Method Summary collapse
- #authorize ⇒ Object
-
#initialize(payment, _delivery = nil) ⇒ PurchaseOrder
constructor
A new instance of PurchaseOrder.
- #void(report_fraud = false) ⇒ Object
Constructor Details
#initialize(payment, _delivery = nil) ⇒ PurchaseOrder
Returns a new instance of PurchaseOrder.
6 7 8 9 10 |
# File 'app/services/payment/gateways/purchase_order.rb', line 6 def initialize(payment, _delivery = nil) @payment = payment success = nil = nil end |
Instance Method Details
#authorize ⇒ Object
12 13 14 15 16 |
# File 'app/services/payment/gateways/purchase_order.rb', line 12 def @payment. @payment.order.billing_entity.sync_credit_limit Result.new(success: true) end |
#void(report_fraud = false) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'app/services/payment/gateways/purchase_order.rb', line 18 def void(report_fraud = false) return Result.new(success: false) unless @payment. @payment.payment_voided! # Replenish Credit line @payment.order.billing_entity.sync_credit_limit if @payment.order.billing_entity Result.new(success: true) end |