Sha256: 812e187fb9891bc4dc9b6308a01c18597c949c7dd2bd98a632914b2d9bab37a8

Contents?: true

Size: 652 Bytes

Versions: 7

Compression:

Stored size: 652 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

7 entries across 7 versions & 1 rubygems

Version Path
ebanx-1.3.1 lib/ebanx/command/refund.rb
ebanx-1.3.0 lib/ebanx/command/refund.rb
ebanx-1.2.0 lib/ebanx/command/refund.rb
ebanx-1.1.0 lib/ebanx/command/refund.rb
ebanx-1.0.2 lib/ebanx/command/refund.rb
ebanx-1.0.0 lib/ebanx/command/refund.rb
ebanx-0.1.0 lib/ebanx/command/refund.rb