Class: TophatterMerchant::Order
Instance Attribute Summary collapse
Class Method Summary
collapse
-
.acknowledge(id) ⇒ Object
-
.all(filter: nil, page: 1, per_page: 50) ⇒ Object
-
.annotate(id, annotation) ⇒ Object
-
.fulfill(id, carrier:, tracking_number:) ⇒ Object
-
.refund(id, type:, reason:, fees: []) ⇒ Object
merchant-api.tophatter.com/docs/order-refund TophatterMerchant::Order.refund(417953232, type: ‘full’, reason: ‘delay_in_shipping’) TophatterMerchant::Order.refund(417953232, type: ‘partial’, reason: ‘other’, fees: [‘shipping_fee’]).
-
.retrieve(id) ⇒ Object
Methods inherited from Resource
#initialize, #to_hash
Instance Attribute Details
#address1 ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def address1
@address1
end
|
#address2 ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def address2
@address2
end
|
#annotation ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def annotation
@annotation
end
|
#available_refunds ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def available_refunds
@available_refunds
end
|
#carrier ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def carrier
@carrier
end
|
#city ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def city
@city
end
|
#country ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def country
@country
end
|
#created_at ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def created_at
@created_at
end
|
#customer_id ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def customer_id
@customer_id
end
|
#customer_name ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def customer_name
@customer_name
end
|
#disbursement_amount ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def disbursement_amount
@disbursement_amount
end
|
#order_id ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def order_id
@order_id
end
|
#paid_at ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def paid_at
@paid_at
end
|
#postal_code ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def postal_code
@postal_code
end
|
#product_identifier ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def product_identifier
@product_identifier
end
|
#product_name ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def product_name
@product_name
end
|
#refund_amount ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def refund_amount
@refund_amount
end
|
#seller_fees ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def seller_fees
@seller_fees
end
|
#seller_fees_amount ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def seller_fees_amount
@seller_fees_amount
end
|
#state ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def state
@state
end
|
#status ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def status
@status
end
|
#tracking_number ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def tracking_number
@tracking_number
end
|
#variation_identifier ⇒ Object
4
5
6
|
# File 'lib/tophatter_merchant/order.rb', line 4
def variation_identifier
@variation_identifier
end
|
Class Method Details
.acknowledge(id) ⇒ Object
45
46
47
|
# File 'lib/tophatter_merchant/order.rb', line 45
def acknowledge(id)
Order.new get(url: "#{path}/acknowledge.json", params: { order_id: id })
end
|
.all(filter: nil, page: 1, per_page: 50) ⇒ Object
31
32
33
34
35
|
# File 'lib/tophatter_merchant/order.rb', line 31
def all(filter: nil, page: 1, per_page: 50)
get(url: "#{path}.json", params: { filter: filter, page: page, per_page: per_page }).map do |hash|
Order.new(hash)
end
end
|
.annotate(id, annotation) ⇒ Object
64
65
66
|
# File 'lib/tophatter_merchant/order.rb', line 64
def annotate(id, annotation)
Order.new post(url: "#{path}/annotate.json", params: { order_id: id, annotation: annotation })
end
|
.fulfill(id, carrier:, tracking_number:) ⇒ Object
51
52
53
|
# File 'lib/tophatter_merchant/order.rb', line 51
def fulfill(id, carrier:, tracking_number:)
Order.new post(url: "#{path}/fulfill.json", params: { order_id: id, carrier: carrier, tracking_number: tracking_number })
end
|
.refund(id, type:, reason:, fees: []) ⇒ Object
merchant-api.tophatter.com/docs/order-refund TophatterMerchant::Order.refund(417953232, type: ‘full’, reason: ‘delay_in_shipping’) TophatterMerchant::Order.refund(417953232, type: ‘partial’, reason: ‘other’, fees: [‘shipping_fee’])
58
59
60
|
# File 'lib/tophatter_merchant/order.rb', line 58
def refund(id, type:, reason:, fees: [])
Order.new post(url: "#{path}/refund.json", params: { order_id: id, type: type, reason: reason, fees: fees })
end
|
.retrieve(id) ⇒ Object
39
40
41
|
# File 'lib/tophatter_merchant/order.rb', line 39
def retrieve(id)
Order.new get(url: "#{path}/retrieve.json", params: { order_id: id })
end
|