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}'
CREATE_PAYMENT_ORDER_RELATION =
'/payment/{paymentId}/order/{orderId}'
DELETE_ORDERS_PAYMENT =
'/payment/{paymentId}/order'

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

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


18
19
20
# File 'lib/plenty_client/payment/order.rb', line 18

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


22
23
24
# File 'lib/plenty_client/payment/order.rb', line 22

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

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


14
15
16
# File 'lib/plenty_client/payment/order.rb', line 14

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