Class: PlentyClient::Payment::Order

Inherits:
Object
  • Object
show all
Includes:
Endpoint, Request
Defined in:
lib/plenty_client/payment/order.rb

Constant Summary collapse

LIST_ORDERS_PAYMENTS =
'/payments/orders/{orderId}'.freeze
CREATE_PAYMENT_ORDER_RELATION =
'/payment/{paymentId}/order/{orderId}'.freeze
DELETE_ORDERS_PAYMENT =
'/payment/{paymentId}/order'.freeze

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(payment_id, order_id, body = {}) ⇒ Object



16
17
18
# File 'lib/plenty_client/payment/order.rb', line 16

def create(payment_id, order_id, body = {})
  post(build_endpoint(CREATE_PAYMENT_ORDER_RELATION, payment: payment_id, order: order_id), body)
end

.destroy(payment_id, body = {}) ⇒ Object



20
21
22
# File 'lib/plenty_client/payment/order.rb', line 20

def destroy(payment_id, body = {})
  delete(build_endpoint(DELETE_ORDERS_PAYMENT, payment: payment_id), body)
end

.list(order_id, headers = {}, &block) ⇒ Object



12
13
14
# File 'lib/plenty_client/payment/order.rb', line 12

def list(order_id, headers = {}, &block)
  get(build_endpoint(LIST_ORDERS_PAYMENTS, order: order_id), headers, &block)
end