Class: CardsMkbAcquirer
- Inherits:
-
Object
- Object
- CardsMkbAcquirer
- Defined in:
- app/acquirers/cards_mkb_acquirer.rb
Defined Under Namespace
Classes: Transaction
Class Attribute Summary collapse
-
.gateway ⇒ Object
readonly
Returns the value of attribute gateway.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config) ⇒ CardsMkbAcquirer
constructor
A new instance of CardsMkbAcquirer.
- #transaction(payment, &block) ⇒ Object
Constructor Details
#initialize(config) ⇒ CardsMkbAcquirer
Returns a new instance of CardsMkbAcquirer.
105 106 107 108 |
# File 'app/acquirers/cards_mkb_acquirer.rb', line 105 def initialize(config) @config = config.with_indifferent_access CardsMkbAcquirer.ensure_running @config end |
Class Attribute Details
.gateway ⇒ Object (readonly)
Returns the value of attribute gateway.
3 4 5 |
# File 'app/acquirers/cards_mkb_acquirer.rb', line 3 def gateway @gateway end |
Class Method Details
.ensure_running(config) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/acquirers/cards_mkb_acquirer.rb', line 5 def ensure_running(config) if @gateway.nil? if !ISO8583::MKB::Logging.started? ISO8583::MKB::Logging.start Rails.root.join('log/iso8583_mkb.log') end @gateway = ISO8583::MKB::SynchronousGateway.new(config) end end |
.stop ⇒ Object
15 16 17 18 19 |
# File 'app/acquirers/cards_mkb_acquirer.rb', line 15 def stop @gateway.stop unless @gateway.nil? @gateway = nil ISO8583::MKB::Logging.stop end |
Instance Method Details
#transaction(payment, &block) ⇒ Object
110 111 112 113 |
# File 'app/acquirers/cards_mkb_acquirer.rb', line 110 def transaction(payment, &block) transaction = Transaction.new(payment, @config) transaction.transact(&block) end |