Class: Levelup::Endpoints::SpecificOrder

Inherits:
Base
  • Object
show all
Defined in:
lib/levelup/endpoints/specific_order.rb

Overview

Endpoint holding all functions relating to a specified order.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order_uuid) ⇒ SpecificOrder

Returns a new instance of SpecificOrder.



6
7
8
# File 'lib/levelup/endpoints/specific_order.rb', line 6

def initialize(order_uuid)
  @uuid = order_uuid
end

Instance Attribute Details

#uuidObject (readonly)

Returns the value of attribute uuid.



5
6
7
# File 'lib/levelup/endpoints/specific_order.rb', line 5

def uuid
  @uuid
end

Instance Method Details

#refund(merchant_auth_token) ⇒ Object

Refunds the order specified by this endpoint.

merchant_auth_token

A merchant access token with permissions to refund orders made at the location where this order was placed.



15
16
17
18
19
# File 'lib/levelup/endpoints/specific_order.rb', line 15

def refund(merchant_auth_token)
  request = Requests::RefundOrder.new(
    merchant_access_token: merchant_auth_token)
  request.send_to_api(:post, endpoint_path + '/refund')
end