Sha256: c3b95a97bb59d4645a28c01ef6320bd768c115b43faab5b2d16f5ec69f646817

Contents?: true

Size: 653 Bytes

Versions: 4

Compression:

Stored size: 653 Bytes

Contents

module Ebanx
  module Command
    class Refund < Command
      def initialize(params)
        @params         = params
        @request_method = :post
        @request_action = 'refund'
        @response_type  = :json
      end

      def validate
        validate_presence :operation

        # Validation for a new refund request
        if @params[:operation] == 'request'
          validate_presence :hash
          validate_presence :amount
          validate_presence :description
        #Validation for a refund cancel request
        else
          validate_presence_or :merchant_refund_code, :refund_id
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ebanx-1.3.5 lib/ebanx/command/refund.rb
ebanx-1.3.4 lib/ebanx/command/refund.rb
ebanx-1.3.3 lib/ebanx/command/refund.rb
ebanx-1.3.2 lib/ebanx/command/refund.rb