{"action":"created","issue":{"url":"https://api.github.com/repos/bonobos/spree/issues/430","labels_url":"https://api.github.com/repos/bonobos/spree/issues/430/labels{/name}","comments_url":"https://api.github.com/repos/bonobos/spree/issues/430/comments","events_url":"https://api.github.com/repos/bonobos/spree/issues/430/events","html_url":"https://github.com/bonobos/spree/pull/430","id":96424783,"number":430,"title":"Add addresses to credit cards","user":{"login":"jordan-brough","id":23050,"avatar_url":"https://avatars.githubusercontent.com/u/23050?v=3","gravatar_id":"","url":"https://api.github.com/users/jordan-brough","html_url":"https://github.com/jordan-brough","followers_url":"https://api.github.com/users/jordan-brough/followers","following_url":"https://api.github.com/users/jordan-brough/following{/other_user}","gists_url":"https://api.github.com/users/jordan-brough/gists{/gist_id}","starred_url":"https://api.github.com/users/jordan-brough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordan-brough/subscriptions","organizations_url":"https://api.github.com/users/jordan-brough/orgs","repos_url":"https://api.github.com/users/jordan-brough/repos","events_url":"https://api.github.com/users/jordan-brough/events{/privacy}","received_events_url":"https://api.github.com/users/jordan-brough/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-21T21:55:02Z","updated_at":"2015-07-23T06:07:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bonobos/spree/pulls/430","html_url":"https://github.com/bonobos/spree/pull/430","diff_url":"https://github.com/bonobos/spree/pull/430.diff","patch_url":"https://github.com/bonobos/spree/pull/430.patch"},"body":"Replaces #427.\r\n\r\nThis PR adds a spree_credit_cards.address_id field and updates Frontend and Admin to populate credit card addresses with the order's bill_address by default.\r\n\r\nI need to add some more specs but want to make sure everyone is good w/ this approach first.\r\n\r\nFor stores that would like to go even further and stop using the order.bill_address_id field entirely, the `Spree::Config[:order_bill_address_used]` preference can be set to false which will allow proceeding past the \"Customer Details\" step in the admin and also hide the order.bill_address fields in that step.\r\n\r\nThis includes a migration and a rake task to make a best effort at backfilling credit card address data.\r\n\r\nSee individual commits for details.\r\n\r\ncc @jhawthorn @gvaughn "},"comment":{"url":"https://api.github.com/repos/bonobos/spree/issues/comments/123987440","html_url":"https://github.com/bonobos/spree/pull/430#issuecomment-123987440","issue_url":"https://api.github.com/repos/bonobos/spree/issues/430","id":123987440,"user":{"login":"jordan-brough","id":23050,"avatar_url":"https://avatars.githubusercontent.com/u/23050?v=3","gravatar_id":"","url":"https://api.github.com/users/jordan-brough","html_url":"https://github.com/jordan-brough","followers_url":"https://api.github.com/users/jordan-brough/followers","following_url":"https://api.github.com/users/jordan-brough/following{/other_user}","gists_url":"https://api.github.com/users/jordan-brough/gists{/gist_id}","starred_url":"https://api.github.com/users/jordan-brough/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordan-brough/subscriptions","organizations_url":"https://api.github.com/users/jordan-brough/orgs","repos_url":"https://api.github.com/users/jordan-brough/repos","events_url":"https://api.github.com/users/jordan-brough/events{/privacy}","received_events_url":"https://api.github.com/users/jordan-brough/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T06:07:58Z","updated_at":"2015-07-23T06:07:58Z","body":"> are you planning to provide a way to update the address on a card?\r\n\r\nYes in an upcoming PR. For this PR you can potentially update via the API but in Admin you'd need to create a new credit card if you need a new address.  Hopefully that's a decent intermediate state which is slightly better than the previous state where you could update the order bill address but it wouldn't actually change anything on the 3rd party stored credit card (i.e. the only way to really change the address was still to create a new credit card but that fact was less obvious).\r\n\r\n> I want to be careful with the rollout communication if we are swapping the ship and bill address forms\r\n\r\nAbsolutely, thanks for checking on that. Greg and I did discuss that and we'll be making sure everyone is OK with the change before making it live.\r\n\r\nI imagine we'll roll it out approximately like this:\r\n\r\n- Update our frontend to start passing credit card address in addition to order bill address (whic will be silently ignored at first)\r\n- Update SpreeBackend with this code and migrations but keep `Spree::Config[:order_bill_address_used]` set to true.  That means the API will start accepting the CC address from our frontend, in addition to the order bill address, and in the Admin the order.bill_address is still entered as before -- the address form on new credit cards will be pre-populated with the order bill address when creating a card.\r\n- Make sure everything is working and tweak any other components where we'd like to start drawing from CC addresses (e.g. Simparel).\r\n- Turn off `Spree::Config[:order_bill_address_used]` and probably stop passing order.bill_address from our frontend.\r\n\r\nBut we'll make sure that rollout works for the ninjas & etc and tweak as needed. Seem reasonable?"}}