Class: Levelup::Requests::RefundOrder

Inherits:
Base show all
Includes:
Templates::MerchantAuthenticated
Defined in:
lib/levelup/requests/refund_order.rb

Overview

Represents a request to refund a specified order. Merchant access token must have the manage_merchant_orders permission.

Constant Summary

Constants inherited from Base

Base::ALLOWED_REQUEST_METHODS

Instance Attribute Summary collapse

Attributes included from Templates::MerchantAuthenticated

#merchant_access_token

Instance Method Summary collapse

Methods included from Templates::MerchantAuthenticated

#auth_type

Methods inherited from Base

#auth_type, #headers, instance_variables_excluded_from_hash, #send_to_api

Methods inherited from Templates::DataParcel

excluded?, #initialize, instance_variables_excluded_from_hash

Constructor Details

This class inherits a constructor from Levelup::Templates::DataParcel

Instance Attribute Details

#manager_confirmationObject

If your merchant account is configured to require one, a confirmation code permitting this refund.


10
11
12
# File 'lib/levelup/requests/refund_order.rb', line 10

def manager_confirmation
  @manager_confirmation
end

Instance Method Details

#bodyObject


12
13
14
# File 'lib/levelup/requests/refund_order.rb', line 12

def body
  { refund: to_hash }
end

#response_from_hash(hash) ⇒ Object


16
17
18
# File 'lib/levelup/requests/refund_order.rb', line 16

def response_from_hash(hash)
  Responses::Success.new(hash['order'])
end