{"action":"closed","issue":{"url":"https://api.github.com/repos/skyverge/wc-plugin-framework/issues/307","repository_url":"https://api.github.com/repos/skyverge/wc-plugin-framework","labels_url":"https://api.github.com/repos/skyverge/wc-plugin-framework/issues/307/labels{/name}","comments_url":"https://api.github.com/repos/skyverge/wc-plugin-framework/issues/307/comments","events_url":"https://api.github.com/repos/skyverge/wc-plugin-framework/issues/307/events","html_url":"https://github.com/skyverge/wc-plugin-framework/issues/307","id":344903927,"node_id":"MDU6SXNzdWUzNDQ5MDM5Mjc=","number":307,"title":"Add a process to update tokenized payment methods","user":{"login":"ChaseWiseman","id":999301,"node_id":"MDQ6VXNlcjk5OTMwMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/999301?v=4","gravatar_id":"","url":"https://api.github.com/users/ChaseWiseman","html_url":"https://github.com/ChaseWiseman","followers_url":"https://api.github.com/users/ChaseWiseman/followers","following_url":"https://api.github.com/users/ChaseWiseman/following{/other_user}","gists_url":"https://api.github.com/users/ChaseWiseman/gists{/gist_id}","starred_url":"https://api.github.com/users/ChaseWiseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChaseWiseman/subscriptions","organizations_url":"https://api.github.com/users/ChaseWiseman/orgs","repos_url":"https://api.github.com/users/ChaseWiseman/repos","events_url":"https://api.github.com/users/ChaseWiseman/events{/privacy}","received_events_url":"https://api.github.com/users/ChaseWiseman/received_events","type":"User","site_admin":false},"labels":[{"id":603119282,"node_id":"MDU6TGFiZWw2MDMxMTkyODI=","url":"https://api.github.com/repos/skyverge/wc-plugin-framework/labels/Integration:%20Subscriptions","name":"Integration: Subscriptions","color":"bfd4f2","default":false},{"id":57561722,"node_id":"MDU6TGFiZWw1NzU2MTcyMg==","url":"https://api.github.com/repos/skyverge/wc-plugin-framework/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":195245061,"node_id":"MDU6TGFiZWwxOTUyNDUwNjE=","url":"https://api.github.com/repos/skyverge/wc-plugin-framework/labels/payment-gateway","name":"payment-gateway","color":"009800","default":false}],"state":"closed","locked":false,"assignee":{"login":"ChaseWiseman","id":999301,"node_id":"MDQ6VXNlcjk5OTMwMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/999301?v=4","gravatar_id":"","url":"https://api.github.com/users/ChaseWiseman","html_url":"https://github.com/ChaseWiseman","followers_url":"https://api.github.com/users/ChaseWiseman/followers","following_url":"https://api.github.com/users/ChaseWiseman/following{/other_user}","gists_url":"https://api.github.com/users/ChaseWiseman/gists{/gist_id}","starred_url":"https://api.github.com/users/ChaseWiseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChaseWiseman/subscriptions","organizations_url":"https://api.github.com/users/ChaseWiseman/orgs","repos_url":"https://api.github.com/users/ChaseWiseman/repos","events_url":"https://api.github.com/users/ChaseWiseman/events{/privacy}","received_events_url":"https://api.github.com/users/ChaseWiseman/received_events","type":"User","site_admin":false},"assignees":[{"login":"ChaseWiseman","id":999301,"node_id":"MDQ6VXNlcjk5OTMwMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/999301?v=4","gravatar_id":"","url":"https://api.github.com/users/ChaseWiseman","html_url":"https://github.com/ChaseWiseman","followers_url":"https://api.github.com/users/ChaseWiseman/followers","following_url":"https://api.github.com/users/ChaseWiseman/following{/other_user}","gists_url":"https://api.github.com/users/ChaseWiseman/gists{/gist_id}","starred_url":"https://api.github.com/users/ChaseWiseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChaseWiseman/subscriptions","organizations_url":"https://api.github.com/users/ChaseWiseman/orgs","repos_url":"https://api.github.com/users/ChaseWiseman/repos","events_url":"https://api.github.com/users/ChaseWiseman/events{/privacy}","received_events_url":"https://api.github.com/users/ChaseWiseman/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/skyverge/wc-plugin-framework/milestones/26","html_url":"https://github.com/skyverge/wc-plugin-framework/milestone/26","labels_url":"https://api.github.com/repos/skyverge/wc-plugin-framework/milestones/26/labels","id":3561966,"node_id":"MDk6TWlsZXN0b25lMzU2MTk2Ng==","number":26,"title":"v5.3.0","description":"","creator":{"login":"ChaseWiseman","id":999301,"node_id":"MDQ6VXNlcjk5OTMwMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/999301?v=4","gravatar_id":"","url":"https://api.github.com/users/ChaseWiseman","html_url":"https://github.com/ChaseWiseman","followers_url":"https://api.github.com/users/ChaseWiseman/followers","following_url":"https://api.github.com/users/ChaseWiseman/following{/other_user}","gists_url":"https://api.github.com/users/ChaseWiseman/gists{/gist_id}","starred_url":"https://api.github.com/users/ChaseWiseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChaseWiseman/subscriptions","organizations_url":"https://api.github.com/users/ChaseWiseman/orgs","repos_url":"https://api.github.com/users/ChaseWiseman/repos","events_url":"https://api.github.com/users/ChaseWiseman/events{/privacy}","received_events_url":"https://api.github.com/users/ChaseWiseman/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":8,"state":"open","created_at":"2018-08-10T21:20:39Z","updated_at":"2018-09-25T20:20:09Z","due_on":"2018-09-07T07:00:00Z","closed_at":null},"comments":0,"created_at":"2018-07-26T15:54:05Z","updated_at":"2018-09-25T20:20:09Z","closed_at":"2018-09-25T20:20:09Z","author_association":"CONTRIBUTOR","body":"Currently the payment gateway token handling has three points of interaction with remote tokens:\r\n\r\n* Get tokens\r\n* Create a token\r\n* Remove a token\r\n\r\nIt's time to add Update to that list! While historically most gateways haven't offered API routes to update stored payment method data, it's becoming increasingly common for newer APIs.\r\n\r\n## Implementation\r\nWhenever a customer places an order using a saved payment method, we should:\r\n\r\n1. Check the billing address data entered at checkout against what's stored for the token\r\n1. If they don't match, we should perform an update request with the new information\r\n1. If they do match, do nothing extra\r\n1. Proceed with payment processing as expected\r\n\r\nWe currently have this implemented in a few of the more modern gateways like CIM and Elavon. In those cases, a hash is generated from the address to use for comparison.\r\n\r\nNew methods:\r\n* `SV_WC_Payment_Gateway_API::update_tokenized_payment_method()`\r\n* `SV_WC_Payment_Gateway_API::supports_update_tokenized_payment_method()`\r\n\r\nWhile it may be easiest to rely on a `\\WC_Order` object for the param, I wonder if it'd be more flexible to simply accept a data array so that it could be used elsewhere, like from the payment methods screen where there is no order.\r\n\r\nWe should also ensure that tokens are updated when processing Subscription renewals if the address has changed."}}
{"actor":{"display_login":"ChaseWiseman"}}