Sha256: 212b62b2b65b2ff38fb34737db4430a7648edbfb7f939bd4f84f7a1fad9d68fa

Contents?: true

Size: 865 Bytes

Versions: 1

Compression:

Stored size: 865 Bytes

Contents

module DpdApi
  class Nl < Base
    # TODO: Implement namespace
    class << self
      def get_nl_amount(params = {})
        method = :get_nl_amount
        namespace = :arg0
        response(method, params, namespace: namespace)
      end

      def get_nl_invoice(params = {})
        method = :get_nl_invoice
        namespace = :arg0
        response(method, params, namespace: namespace)
      end

      def response(method, params = {}, namespace: nil)
        params    = @auth_params.clone.deep_merge!(params)
        request   = namespace ? { namespace => params } : params
        response  = @client.call(method, message: request)
        namespace = "#{method}_response".to_sym
        response.body[namespace][:return]
      end

      protected

      def url
        "#{DpdApi.configuration.base_url}/services/nl?wsdl"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dpd_api-0.0.1 lib/dpd_api/nl.rb