Sha256: 79669f2bebbd9079f626c31e4a3c9df6283f2adcaf0a35c3e234f561f7d7642c

Contents?: true

Size: 522 Bytes

Versions: 3

Compression:

Stored size: 522 Bytes

Contents

module Stripe
  class UsageRecord < APIResource
    def self.create(params = {}, opts = {})
      raise(ArgumentError, "Params must have a subscription_item key") unless params.key?(:subscription_item)
      req_params = params.clone.delete_if { |key, _value| key == :subscription_item }
      resp, opts = request(:post, "/v1/subscription_items/#{params[:subscription_item]}/usage_records", req_params, opts)
      Util.convert_to_stripe_object(resp.data, opts)
    end

    OBJECT_NAME = "usage_record".freeze
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stripe-3.14.0 lib/stripe/usage_record.rb
stripe-3.13.1 lib/stripe/usage_record.rb
stripe-3.13.0 lib/stripe/usage_record.rb