Sha256: 4134af08f209e6232afc92f101f19bb2e0dd379b420046085d83c36c9a521342
Contents?: true
Size: 688 Bytes
Versions: 24
Compression:
Stored size: 688 Bytes
Contents
module Moneta module Api class Service DEMO = 'https://demo.moneta.ru/services.wsdl' PRODUCTION = 'https://www.moneta.ru/services.wsdl' include ServiceMethods attr_reader :client def initialize(username, password, params = {}) @client = Savon.client(prepare_params(username, password, params)) end private def prepare_params(username, password, params) demo_mode = params.delete(:demo_mode) { wsse_auth: [ username, password ] } .merge(params) .merge(wsdl: wsdl_url(demo_mode)) end def wsdl_url(demo_mode) demo_mode ? DEMO : PRODUCTION end end end end
Version data entries
24 entries across 24 versions & 1 rubygems