Module: SolidusNexio::NexioPaymentCommons
- Included in:
- AlternativePaymentMethod, PaymentMethod
- Defined in:
- app/models/solidus_nexio/nexio_payment_commons.rb
Instance Method Summary collapse
- #authorize(money, source, options = {}) ⇒ Object
- #cancel(id) ⇒ Object
- #purchase(money, source, options = {}) ⇒ Object
Instance Method Details
#authorize(money, source, options = {}) ⇒ Object
9 10 11 |
# File 'app/models/solidus_nexio/nexio_payment_commons.rb', line 9 def (money, source, = {}) super(money, source, (source, )) end |
#cancel(id) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'app/models/solidus_nexio/nexio_payment_commons.rb', line 13 def cancel(id) transaction = gateway.get_transaction(id) return error_response(id, 'not found') unless transaction if Mappings.settled?(transaction.status) credit(transaction.amount.to_money.cents, id) else void(id) end end |
#purchase(money, source, options = {}) ⇒ Object
5 6 7 |
# File 'app/models/solidus_nexio/nexio_payment_commons.rb', line 5 def purchase(money, source, = {}) super(money, source, (source, )) end |