Class: Payment::Gateways::VerbalPurchaseOrder
- Inherits:
-
BasePaymentGateway
- Object
- BasePaymentGateway
- Payment::Gateways::VerbalPurchaseOrder
- Defined in:
- app/services/payment/gateways/verbal_purchase_order.rb
Overview
Verbal purchase-order gateway. Behaves like PurchaseOrder
but the originating contact is captured via vpo_contact_id instead of an
uploaded PO document.
Defined Under Namespace
Classes: Result
Instance Method Summary collapse
-
#authorize ⇒ Payment::Gateways::VerbalPurchaseOrder::Result
Mark the VPO authorized and resync the billing customer's available credit.
-
#initialize(payment, delivery = nil) ⇒ VerbalPurchaseOrder
constructor
A new instance of VerbalPurchaseOrder.
-
#void(report_fraud = false) ⇒ Payment::Gateways::VerbalPurchaseOrder::Result
Void an authorized VPO and replenish the customer credit line.
Constructor Details
#initialize(payment, delivery = nil) ⇒ VerbalPurchaseOrder
Returns a new instance of VerbalPurchaseOrder.
11 12 13 14 15 |
# File 'app/services/payment/gateways/verbal_purchase_order.rb', line 11 def initialize(payment, delivery=nil) @payment = payment success = nil = nil end |
Instance Method Details
#authorize ⇒ Payment::Gateways::VerbalPurchaseOrder::Result
Mark the VPO authorized and resync the billing customer's
available credit.
21 22 23 24 25 |
# File 'app/services/payment/gateways/verbal_purchase_order.rb', line 21 def @payment. @payment.order.billing_entity.sync_credit_limit Result.new(success: true) end |
#void(report_fraud = false) ⇒ Payment::Gateways::VerbalPurchaseOrder::Result
Void an authorized VPO and replenish the customer credit line.
31 32 33 34 35 36 37 38 39 40 |
# File 'app/services/payment/gateways/verbal_purchase_order.rb', line 31 def void(report_fraud = false) return Result.new(success: false) unless @payment. @payment.payment_voided! # Replenish Credit line if @payment.order.billing_entity @payment.order.billing_entity.sync_credit_limit end Result.new(success: true) end |