Class: Ebanx::Command::Refund
- Inherits:
-
Ebanx::Command
- Object
- Ebanx::Command
- Ebanx::Command::Refund
- Defined in:
- lib/ebanx/command/refund.rb
Instance Method Summary collapse
-
#initialize(params) ⇒ Refund
constructor
A new instance of Refund.
- #validate ⇒ Object
Constructor Details
#initialize(params) ⇒ Refund
Returns a new instance of Refund.
4 5 6 7 8 9 |
# File 'lib/ebanx/command/refund.rb', line 4 def initialize(params) @params = params @request_method = :post @request_action = 'refund' @response_type = :json end |
Instance Method Details
#validate ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ebanx/command/refund.rb', line 11 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 |