Class: SepayPgRuby::Order

Inherits:
Object
  • Object
show all
Defined in:
lib/sepay_pg_ruby/order.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Order

Returns a new instance of Order.



3
4
5
# File 'lib/sepay_pg_ruby/order.rb', line 3

def initialize(client)
  @client = client
end

Instance Method Details

#all(query_params = {}) ⇒ Object



7
8
9
# File 'lib/sepay_pg_ruby/order.rb', line 7

def all(query_params = {})
  @client.request(method: 'GET', endpoint: 'order', params: query_params)
end

#cancel(order_invoice_number) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/sepay_pg_ruby/order.rb', line 23

def cancel(order_invoice_number)
  @client.request(
    method: 'POST',
    endpoint: 'order/cancel',
    body: { order_invoice_number: order_invoice_number }
  )
end

#retrieve(order_invoice_number) ⇒ Object



11
12
13
# File 'lib/sepay_pg_ruby/order.rb', line 11

def retrieve(order_invoice_number)
  @client.request(method: 'GET', endpoint: "order/detail/#{order_invoice_number}")
end

#void_transaction(order_invoice_number) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/sepay_pg_ruby/order.rb', line 15

def void_transaction(order_invoice_number)
  @client.request(
    method: 'POST',
    endpoint: 'order/voidTransaction',
    body: { order_invoice_number: order_invoice_number }
  )
end