Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ALESCUN opened this issue Apr 17, 2018 · 0 comments
Open

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

ALESCUN opened this issue Apr 17, 2018 · 0 comments

Comments

@ALESCUN
Copy link

ALESCUN commented Apr 17, 2018

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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant