blinkbid / chargify_wrapper

Wrapper for Chargify API
0 stars 0 forks source link

feat(payment-profile): creates payment_profile class #14

Closed waitoair closed 3 months ago

waitoair commented 3 months ago

BB-1198

Feature

This pr adds Payment Profile to the ChargifyWrapper gem

Setup

Install the gem on your local env

gem uninstall --force chargify_wrapper
gem build chargify_wrapper.gemspec --output=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

Create a new PaymentProfile associated with the customer of the selected subscription and assign it to a payment_profile variable. Call the method that sends the request to chargify

ChargifyWrapper::Subscription.find(<SUBSCRIPTION_ID>).change_default_payment_profile(payment_profile)