Sha256: 79287ecf414e7aabf0939d8b49e41d0f77081f68edb923ef8bf873a76614e0ac

Contents?: true

Size: 764 Bytes

Versions: 11

Compression:

Stored size: 764 Bytes

Contents

module RockRMS
  class Client
    module RefundReason
      def list_refund_reasons(options = {})
        options['$filter'] = 'DefinedTypeId eq 37' unless options.keys.include?('$filter')

        Response::DefinedValue.format(
          get(defined_values_path, options)
        )
      end

      def create_refund_reason(value:, description:, order: nil)
        order ||= Random.rand(100..1000)

        options = {
          'Value'         => value,
          'Description'   => description,
          'Order'         => order,
          'IsSystem'      => false,
          'DefinedTypeId' => 37
        }
        post(defined_values_path, options)
      end

      private

      def defined_values_path
        'DefinedValues'
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rock_rms-4.3.0 lib/rock_rms/resources/refund_reason.rb
rock_rms-4.2.3 lib/rock_rms/resources/refund_reason.rb
rock_rms-4.2.2 lib/rock_rms/resources/refund_reason.rb
rock_rms-4.2.1 lib/rock_rms/resources/refund_reason.rb
rock_rms-4.2.0 lib/rock_rms/resources/refund_reason.rb
rock_rms-4.1.1 lib/rock_rms/resources/refund_reason.rb
rock_rms-4.1.0 lib/rock_rms/resources/refund_reason.rb
rock_rms-4.0.0 lib/rock_rms/resources/refund_reason.rb
rock_rms-3.9.0 lib/rock_rms/resources/refund_reason.rb
rock_rms-3.8.0 lib/rock_rms/resources/refund_reason.rb
rock_rms-3.7.0 lib/rock_rms/resources/refund_reason.rb