public
Created

Chargify migrate preview

  • Download Gist
gistfile1.rb
Ruby
1 2 3 4 5 6 7
def plan_change_preview(new_plan_id)
api_url = "https://#{Chargify.subdomain}.chargify.com/subscriptions/#{subscription_id}/migrations/preview.json"
data = {:migration => {:product_handle => p_handle} }
response = HTTParty.post(api_url, :body => data.as_json, :basic_auth => {:username => Chargify.api_key, :password => 'X'})
response.parsed_response.first[1]
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.