Class: Multisafepay::OrdersResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/multisafepay/resources/orders.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Multisafepay::Resource

Instance Method Details

#cancel(id, payload = {}) ⇒ Object



15
16
17
# File 'lib/multisafepay/resources/orders.rb', line 15

def cancel(id, payload = {})
  Order.new patch_request("orders/#{id}", body: payload)
end

#capture(id, payload = {}) ⇒ Object



19
20
21
# File 'lib/multisafepay/resources/orders.rb', line 19

def capture(id, payload = {})
  Order.new post_request("orders/#{id}/capture", body: payload)
end

#create(**payload) ⇒ Object



7
8
9
# File 'lib/multisafepay/resources/orders.rb', line 7

def create(**payload)
  Order.new post_request("orders", body: payload)
end

#refund(id, payload = {}) ⇒ Object



23
24
25
# File 'lib/multisafepay/resources/orders.rb', line 23

def refund(id, payload = {})
  Order.new post_request("orders/#{id}/refunds", body: payload)
end

#retrieve(id) ⇒ Object



3
4
5
# File 'lib/multisafepay/resources/orders.rb', line 3

def retrieve(id)
  Order.new get_request("orders/#{id}")
end

#update(id, payload = {}) ⇒ Object



11
12
13
# File 'lib/multisafepay/resources/orders.rb', line 11

def update(id, payload = {})
  Order.new patch_request("orders/#{id}", body: payload)
end