Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- params = {
- "new_address1" => "123 vavavoom",
- "new_address2" => "",
- "new_city" => "New York City",
- "new_province" => "NY",
- "new_zip" => "12101",
- "new_country" => "US"
- }
- sub = Chargify::Subscription.find(7044248)
- old_pp = sub.payment_profile
- update_attributes = {}
- update_attributes["id"] = old_pp.id
- update_attributes["billing_address"] = params["new_address1"]
- update_attributes["billing_address_2"] = params["new_address2"]
- update_attributes["billing_city"] = params["new_city"]
- update_attributes["billing_state"] = params["new_province"]
- update_attributes["billing_zip"] = params["new_zip"]
- update_attributes["billing_country"] = params["new_country"]
- updated_chargify_payment_profile = Chargify::PaymentProfile.new(update_attributes)
- result_of_save_of_billing_address = updated_chargify_payment_profile.save
- got this:
- ActiveResource::ResourceNotFound: Failed. Response code = 404. Response message = Not Found.
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/activeresource-3.2.11/lib/active_resource/connection.rb:136:in `handle_response'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/shopify_api-3.2.1/lib/active_resource/connection_ext.rb:9:in `handle_response_with_response_capture'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/activeresource-3.2.11/lib/active_resource/connection.rb:115:in `request'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/shopify_api-3.2.1/lib/active_resource/connection_ext.rb:13:in `request_with_detailed_log_subscriber'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/activeresource-3.2.11/lib/active_resource/connection.rb:98:in `block in post'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/activeresource-3.2.11/lib/active_resource/connection.rb:218:in `with_auth'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/activeresource-3.2.11/lib/active_resource/connection.rb:98:in `post'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/activeresource-3.2.11/lib/active_resource/base.rb:1360:in `create'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/activeresource-3.2.11/lib/active_resource/observing.rb:19:in `create_with_notifications'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/activeresource-3.2.11/lib/active_resource/base.rb:1155:in `save'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/activeresource-3.2.11/lib/active_resource/validations.rb:79:in `save_with_validation'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/activeresource-3.2.11/lib/active_resource/observing.rb:19:in `save_with_notifications'
- from (irb):47
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
- from /mnt/chargify_accounts-production/shared/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
- from script/rails:6:in `require'
- from script/rails:6:in `<main>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement