Sha256: cca3fdc04a0ec5e7b08e19792d41f7f9bc56508ee3f65c430ac6f144283aceb7

Contents?: true

Size: 840 Bytes

Versions: 10

Compression:

Stored size: 840 Bytes

Contents

module Paddle
  class Price < Object

    class << self

      def list(**params)
        response = Client.get_request("prices", params: params)
        Collection.from_response(response, type: Price)
      end

      def create(product_id:, description:, amount:, currency:, **params)
        attrs = {product_id: product_id, description: description, unit_price: {amount: amount, currency_code: currency}}
        response = Client.post_request("prices", body: attrs.merge(params))
        Price.new(response.body["data"])
      end

      def retrieve(id:)
        response = Client.get_request("prices/#{id}")
        Price.new(response.body["data"])
      end

      def update(id:, **params)
        response = Client.patch_request("prices/#{id}", body: params)
        Price.new(response.body["data"])
      end

    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
paddle-2.2.0 lib/paddle/models/price.rb
paddle-2.1.4 lib/paddle/models/price.rb
paddle-2.1.3 lib/paddle/models/price.rb
paddle-2.1.2 lib/paddle/models/price.rb
paddle-2.1.1 lib/paddle/models/price.rb
paddle-2.1.0 lib/paddle/models/price.rb
paddle-2.0.0 lib/paddle/models/price.rb
paddle-1.1.2 lib/paddle/models/price.rb
paddle-1.1.1 lib/paddle/models/price.rb
paddle-1.1.0 lib/paddle/models/price.rb