module BloomRemitClient

Constants

PRODUCTION
STAGING
TXN_UPDATES_CHANNEL
VERSION

Public Class Methods

configure_message_bus_client_worker!() click to toggle source
# File lib/bloom_remit_client.rb, line 38
def self.configure_message_bus_client_worker!
  if configuration.on_txn_update.blank?
    fail "`on_txn_update` must be defined"
  end

  token = [
    configuration.partner_id,
    configuration.api_secret,
  ].join(":")
  token = Base64.strict_encode64(token)

  MessageBusClientWorker.subscribe(configuration.host, {
    headers: {
      "Authorization" => "Basic #{token}"
    },
    channels: {
      TXN_UPDATES_CHANNEL => { 
        processor: configuration.on_txn_update,
        message_id: 0,
      },
    }
  })
end