Sha256: 1312e8ccb946468eae9e9868995866c86ba6523556665e0209b9d98282fedcaf

Contents?: true

Size: 559 Bytes

Versions: 2

Compression:

Stored size: 559 Bytes

Contents

require 'uri'

module Voucherify
  module Service
    class Orders
      attr_reader :client

      def initialize(client)
        @client = client
      end

      def create(order)
        @client.post('/orders', order.to_json)
      end

      def get(order_id)
        @client.get("/orders/#{ERB::Util.url_encode(order_id)}")
      end

      def update(order_id, order)
        @client.put("/orders/#{ERB::Util.url_encode(order_id)}", order.to_json)
      end

      def list(query = {})
        @client.get("/orders", query)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
voucherify-4.1.0 lib/voucherify/service/orders.rb
voucherify-4.0.0 lib/voucherify/service/orders.rb