blinkbid / chargify_wrapper

Wrapper for Chargify API
0 stars 0 forks source link

feat(price-points): Get all product price points created on Chargify site #12

Closed rscardinho closed 1 month ago

rscardinho commented 1 month ago

BB-1154 New paywall

Feature

Add the ability to make get requests to the endpoint /products_price_points.json on chargify, as described by the docs

This endpoint will be used inside the app to get only the default price points of products, without having to get the entire product.

Also, this PR includes more info on README and the ability to log requests made to chargify to improve debugging

Setup

Install the gem on your local env

gem uninstall --force chargify_wrapper
gem build chargify_wrapper.gemspec --ouput=chargify_wrapper.gem
gem install chargify_wrapper --local chargify_wrapper.gem

Q & A

Open an irb console Require the gem and configure it

require 'chargify_wrapper'

ChargifyWrapper.configure do |config|
  config.subdomain = SUBDOMAIN
  config.api_key = API_KEY
  config.log_requests = true
end

With the gem configured, call the products price point class to get all price points

ChargifyWrapper::ProductsPricePoint.all

It should return all price points created in your chargify subdomain

You should also be able to filter the results as the docs say, using .where(filter: { ... })

rscardinho commented 1 month ago

readme stuff was moved to #12 and product price point stuff is irrelavant for now