Class: Workarea::Payment::Purchase::Afterpay
- Inherits:
-
Object
- Object
- Workarea::Payment::Purchase::Afterpay
- Includes:
- CreditCardOperation, OperationImplementation, AfterpayPaymentGateway
- Defined in:
- app/models/workarea/payment/purchase/afterpay.rb
Instance Method Summary collapse
Methods included from AfterpayPaymentGateway
Instance Method Details
#cancel! ⇒ Object
29 30 31 |
# File 'app/models/workarea/payment/purchase/afterpay.rb', line 29 def cancel! # No op - no cancel functionality available. end |
#complete! ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/models/workarea/payment/purchase/afterpay.rb', line 9 def complete! response = purchase if response.success? && response.body['status'] == 'APPROVED' transaction.response = ActiveMerchant::Billing::Response.new( true, I18n.t( 'workarea.afterpay.purchase', amount: transaction.amount ), response.body ) else transaction.response = ActiveMerchant::Billing::Response.new( false, I18n.t('workarea.afterpay.purchase_failure'), response.body ) end end |