chargify/chargify_api_ares

Attribute "prices" is not return for on/off components

Opened this issue · 0 comments

I tried to query prices point from Chargify API doc and it worked but when I use the gem, I only get prices from quantity components.

Chargify::ProductFamily::Component.find(XXXX, params: { product_family_id: XXXX }).attributes
returns

{
                       "id" => XXXXX,
                     "name" => "Additional user",
                   "handle" => nil,
           "pricing_scheme" => "per_unit",
                "unit_name" => "user",
               "unit_price" => 50.0,
  "price_per_unit_in_cents" => nil,
                     "kind" => "quantity_based_component",
                 "archived" => false,
                  "taxable" => false,
              "description" => nil,
   "default_price_point_id" => XXX49,
                   "prices" => [
    [0] #<Chargify::ProductFamily::Component::Price:0x007f8cc94edfb0 @attributes={"id"=>XXXX77, "component_id"=>475251, "starting_quantity"=>1, "ending_quantity"=>nil, "unit_price"=>#<BigDecimal:7f8cc94eda88,'0.5E2',9(18)>, "price_point_id"=>XXXX49, "formatted_unit_price"=>"$50.00"}, @prefix_options={}, @persisted=true>
  ],
        "price_point_count" => 3,
         "price_points_url" => "https://kimoby-clone.chargify.com/components/XXXX51/price_points",
                 "tax_code" => nil
}

Chargify::ProductFamily::Component.find(XXXX09, params: { product_family_id: XXXX61 }).attributes
returns

{
                       "id" => XXXX09,
                     "name" => "Targeted campaigns",
                   "handle" => nil,
           "pricing_scheme" => nil,
                "unit_name" => "on/off",
               "unit_price" => 200.0,
  "price_per_unit_in_cents" => nil,
                     "kind" => "on_off_component",
                 "archived" => false,
                  "taxable" => false,
              "description" => nil,
   "default_price_point_id" => 213484,
        "price_point_count" => 3,
         "price_points_url" => "https://kimoby-clone.chargify.com/components/XXXX09/price_points",
                 "tax_code" => nil
}