{"action":"closed","number":3675,"pull_request":{"url":"https://api.github.com/repos/gratipay/gratipay.com/pulls/3675","id":41977797,"html_url":"https://github.com/gratipay/gratipay.com/pull/3675","diff_url":"https://github.com/gratipay/gratipay.com/pull/3675.diff","patch_url":"https://github.com/gratipay/gratipay.com/pull/3675.patch","issue_url":"https://api.github.com/repos/gratipay/gratipay.com/issues/3675","number":3675,"state":"closed","locked":false,"title":"Charge in arrears","user":{"login":"rorepo","id":7984085,"avatar_url":"https://avatars.githubusercontent.com/u/7984085?v=3","gravatar_id":"","url":"https://api.github.com/users/rorepo","html_url":"https://github.com/rorepo","followers_url":"https://api.github.com/users/rorepo/followers","following_url":"https://api.github.com/users/rorepo/following{/other_user}","gists_url":"https://api.github.com/users/rorepo/gists{/gist_id}","starred_url":"https://api.github.com/users/rorepo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rorepo/subscriptions","organizations_url":"https://api.github.com/users/rorepo/orgs","repos_url":"https://api.github.com/users/rorepo/repos","events_url":"https://api.github.com/users/rorepo/events{/privacy}","received_events_url":"https://api.github.com/users/rorepo/received_events","type":"User","site_admin":false},"body":"Implemented the core part of the solution for issue \"charge minimum in arrears, not in advance #3378\" \r\nOverview of the solution:\r\ni) Added a new column giving_due in payment_instructions. To be populated/incremented with the corresponding amount, each time the amount is not charged due to being under the minimum charge threshold\r\nii) After creation of payday_payment_instructions, the giving_due value for each participant-team combination is updated with the sum of giving_due values for that combination, from payment_instructions. \r\niii) The 'giving_today' value for each participant is calculated as sum(amount + giving_due) from all records for that participant in payday_payment_instructions\r\niv) The 'giving_today' value is checked against the MINIMUM_CHARGE threshold before creating card holds if at/above the threshold. Have a doubt here - whether it's the basic amount or the upcharged amount that is to be used in the check\r\nv) In the case of participants who have been charged, all giving_due values in payment_instructions for those participants are reset to 0\r\nvi) In the case of participants who have not been charged, the giving_due value in the current record in payment_instructions is updated to amount + giving_due\r\n\r\nWill await comments/suggestions before proceeding further. \r\n\r\nFurther changes planned:\r\ni) Add a new column giving_due in participants, to cache the total giving_due value for participants\r\nii) Update the UI to include the above\r\n","created_at":"2015-08-09T21:53:39Z","updated_at":"2015-09-07T14:21:39Z","closed_at":"2015-09-07T14:21:39Z","merged_at":"2015-09-07T14:21:39Z","merge_commit_sha":"97d4a8fd902ce7ac75fbae0f115edfbf0130a551","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gratipay/gratipay.com/pulls/3675/commits","review_comments_url":"https://api.github.com/repos/gratipay/gratipay.com/pulls/3675/comments","review_comment_url":"https://api.github.com/repos/gratipay/gratipay.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gratipay/gratipay.com/issues/3675/comments","statuses_url":"https://api.github.com/repos/gratipay/gratipay.com/statuses/3d6e9861f07232916acb434ffd4087f1097caa44","head":{"label":"gratipay:charge-in-arrears","ref":"charge-in-arrears","sha":"3d6e9861f07232916acb434ffd4087f1097caa44","user":{"login":"gratipay","id":1744073,"avatar_url":"https://avatars.githubusercontent.com/u/1744073?v=3","gravatar_id":"","url":"https://api.github.com/users/gratipay","html_url":"https://github.com/gratipay","followers_url":"https://api.github.com/users/gratipay/followers","following_url":"https://api.github.com/users/gratipay/following{/other_user}","gists_url":"https://api.github.com/users/gratipay/gists{/gist_id}","starred_url":"https://api.github.com/users/gratipay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gratipay/subscriptions","organizations_url":"https://api.github.com/users/gratipay/orgs","repos_url":"https://api.github.com/users/gratipay/repos","events_url":"https://api.github.com/users/gratipay/events{/privacy}","received_events_url":"https://api.github.com/users/gratipay/received_events","type":"Organization","site_admin":false},"repo":{"id":4521463,"name":"gratipay.com","full_name":"gratipay/gratipay.com","owner":{"login":"gratipay","id":1744073,"avatar_url":"https://avatars.githubusercontent.com/u/1744073?v=3","gravatar_id":"","url":"https://api.github.com/users/gratipay","html_url":"https://github.com/gratipay","followers_url":"https://api.github.com/users/gratipay/followers","following_url":"https://api.github.com/users/gratipay/following{/other_user}","gists_url":"https://api.github.com/users/gratipay/gists{/gist_id}","starred_url":"https://api.github.com/users/gratipay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gratipay/subscriptions","organizations_url":"https://api.github.com/users/gratipay/orgs","repos_url":"https://api.github.com/users/gratipay/repos","events_url":"https://api.github.com/users/gratipay/events{/privacy}","received_events_url":"https://api.github.com/users/gratipay/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gratipay/gratipay.com","description":"Voluntary Payments and Payroll for Open Work","fork":false,"url":"https://api.github.com/repos/gratipay/gratipay.com","forks_url":"https://api.github.com/repos/gratipay/gratipay.com/forks","keys_url":"https://api.github.com/repos/gratipay/gratipay.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gratipay/gratipay.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gratipay/gratipay.com/teams","hooks_url":"https://api.github.com/repos/gratipay/gratipay.com/hooks","issue_events_url":"https://api.github.com/repos/gratipay/gratipay.com/issues/events{/number}","events_url":"https://api.github.com/repos/gratipay/gratipay.com/events","assignees_url":"https://api.github.com/repos/gratipay/gratipay.com/assignees{/user}","branches_url":"https://api.github.com/repos/gratipay/gratipay.com/branches{/branch}","tags_url":"https://api.github.com/repos/gratipay/gratipay.com/tags","blobs_url":"https://api.github.com/repos/gratipay/gratipay.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gratipay/gratipay.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gratipay/gratipay.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/gratipay/gratipay.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gratipay/gratipay.com/statuses/{sha}","languages_url":"https://api.github.com/repos/gratipay/gratipay.com/languages","stargazers_url":"https://api.github.com/repos/gratipay/gratipay.com/stargazers","contributors_url":"https://api.github.com/repos/gratipay/gratipay.com/contributors","subscribers_url":"https://api.github.com/repos/gratipay/gratipay.com/subscribers","subscription_url":"https://api.github.com/repos/gratipay/gratipay.com/subscription","commits_url":"https://api.github.com/repos/gratipay/gratipay.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/gratipay/gratipay.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/gratipay/gratipay.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/gratipay/gratipay.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/gratipay/gratipay.com/contents/{+path}","compare_url":"https://api.github.com/repos/gratipay/gratipay.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gratipay/gratipay.com/merges","archive_url":"https://api.github.com/repos/gratipay/gratipay.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gratipay/gratipay.com/downloads","issues_url":"https://api.github.com/repos/gratipay/gratipay.com/issues{/number}","pulls_url":"https://api.github.com/repos/gratipay/gratipay.com/pulls{/number}","milestones_url":"https://api.github.com/repos/gratipay/gratipay.com/milestones{/number}","notifications_url":"https://api.github.com/repos/gratipay/gratipay.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gratipay/gratipay.com/labels{/name}","releases_url":"https://api.github.com/repos/gratipay/gratipay.com/releases{/id}","created_at":"2012-06-01T16:01:02Z","updated_at":"2015-09-01T03:31:26Z","pushed_at":"2015-09-07T14:21:39Z","git_url":"git://github.com/gratipay/gratipay.com.git","ssh_url":"git@github.com:gratipay/gratipay.com.git","clone_url":"https://github.com/gratipay/gratipay.com.git","svn_url":"https://github.com/gratipay/gratipay.com","homepage":"https://gratipay.com/","size":84593,"stargazers_count":878,"watchers_count":878,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":266,"mirror_url":null,"open_issues_count":473,"forks":266,"open_issues":473,"watchers":878,"default_branch":"master"}},"base":{"label":"gratipay:master","ref":"master","sha":"6320865a86eae1dbba59e0ea1ef59ebe70350565","user":{"login":"gratipay","id":1744073,"avatar_url":"https://avatars.githubusercontent.com/u/1744073?v=3","gravatar_id":"","url":"https://api.github.com/users/gratipay","html_url":"https://github.com/gratipay","followers_url":"https://api.github.com/users/gratipay/followers","following_url":"https://api.github.com/users/gratipay/following{/other_user}","gists_url":"https://api.github.com/users/gratipay/gists{/gist_id}","starred_url":"https://api.github.com/users/gratipay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gratipay/subscriptions","organizations_url":"https://api.github.com/users/gratipay/orgs","repos_url":"https://api.github.com/users/gratipay/repos","events_url":"https://api.github.com/users/gratipay/events{/privacy}","received_events_url":"https://api.github.com/users/gratipay/received_events","type":"Organization","site_admin":false},"repo":{"id":4521463,"name":"gratipay.com","full_name":"gratipay/gratipay.com","owner":{"login":"gratipay","id":1744073,"avatar_url":"https://avatars.githubusercontent.com/u/1744073?v=3","gravatar_id":"","url":"https://api.github.com/users/gratipay","html_url":"https://github.com/gratipay","followers_url":"https://api.github.com/users/gratipay/followers","following_url":"https://api.github.com/users/gratipay/following{/other_user}","gists_url":"https://api.github.com/users/gratipay/gists{/gist_id}","starred_url":"https://api.github.com/users/gratipay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gratipay/subscriptions","organizations_url":"https://api.github.com/users/gratipay/orgs","repos_url":"https://api.github.com/users/gratipay/repos","events_url":"https://api.github.com/users/gratipay/events{/privacy}","received_events_url":"https://api.github.com/users/gratipay/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gratipay/gratipay.com","description":"Voluntary Payments and Payroll for Open Work","fork":false,"url":"https://api.github.com/repos/gratipay/gratipay.com","forks_url":"https://api.github.com/repos/gratipay/gratipay.com/forks","keys_url":"https://api.github.com/repos/gratipay/gratipay.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gratipay/gratipay.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gratipay/gratipay.com/teams","hooks_url":"https://api.github.com/repos/gratipay/gratipay.com/hooks","issue_events_url":"https://api.github.com/repos/gratipay/gratipay.com/issues/events{/number}","events_url":"https://api.github.com/repos/gratipay/gratipay.com/events","assignees_url":"https://api.github.com/repos/gratipay/gratipay.com/assignees{/user}","branches_url":"https://api.github.com/repos/gratipay/gratipay.com/branches{/branch}","tags_url":"https://api.github.com/repos/gratipay/gratipay.com/tags","blobs_url":"https://api.github.com/repos/gratipay/gratipay.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gratipay/gratipay.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gratipay/gratipay.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/gratipay/gratipay.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gratipay/gratipay.com/statuses/{sha}","languages_url":"https://api.github.com/repos/gratipay/gratipay.com/languages","stargazers_url":"https://api.github.com/repos/gratipay/gratipay.com/stargazers","contributors_url":"https://api.github.com/repos/gratipay/gratipay.com/contributors","subscribers_url":"https://api.github.com/repos/gratipay/gratipay.com/subscribers","subscription_url":"https://api.github.com/repos/gratipay/gratipay.com/subscription","commits_url":"https://api.github.com/repos/gratipay/gratipay.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/gratipay/gratipay.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/gratipay/gratipay.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/gratipay/gratipay.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/gratipay/gratipay.com/contents/{+path}","compare_url":"https://api.github.com/repos/gratipay/gratipay.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gratipay/gratipay.com/merges","archive_url":"https://api.github.com/repos/gratipay/gratipay.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gratipay/gratipay.com/downloads","issues_url":"https://api.github.com/repos/gratipay/gratipay.com/issues{/number}","pulls_url":"https://api.github.com/repos/gratipay/gratipay.com/pulls{/number}","milestones_url":"https://api.github.com/repos/gratipay/gratipay.com/milestones{/number}","notifications_url":"https://api.github.com/repos/gratipay/gratipay.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gratipay/gratipay.com/labels{/name}","releases_url":"https://api.github.com/repos/gratipay/gratipay.com/releases{/id}","created_at":"2012-06-01T16:01:02Z","updated_at":"2015-09-01T03:31:26Z","pushed_at":"2015-09-07T14:21:39Z","git_url":"git://github.com/gratipay/gratipay.com.git","ssh_url":"git@github.com:gratipay/gratipay.com.git","clone_url":"https://github.com/gratipay/gratipay.com.git","svn_url":"https://github.com/gratipay/gratipay.com","homepage":"https://gratipay.com/","size":84593,"stargazers_count":878,"watchers_count":878,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":266,"mirror_url":null,"open_issues_count":473,"forks":266,"open_issues":473,"watchers":878,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gratipay/gratipay.com/pulls/3675"},"html":{"href":"https://github.com/gratipay/gratipay.com/pull/3675"},"issue":{"href":"https://api.github.com/repos/gratipay/gratipay.com/issues/3675"},"comments":{"href":"https://api.github.com/repos/gratipay/gratipay.com/issues/3675/comments"},"review_comments":{"href":"https://api.github.com/repos/gratipay/gratipay.com/pulls/3675/comments"},"review_comment":{"href":"https://api.github.com/repos/gratipay/gratipay.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gratipay/gratipay.com/pulls/3675/commits"},"statuses":{"href":"https://api.github.com/repos/gratipay/gratipay.com/statuses/3d6e9861f07232916acb434ffd4087f1097caa44"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"whit537","id":134455,"avatar_url":"https://avatars.githubusercontent.com/u/134455?v=3","gravatar_id":"","url":"https://api.github.com/users/whit537","html_url":"https://github.com/whit537","followers_url":"https://api.github.com/users/whit537/followers","following_url":"https://api.github.com/users/whit537/following{/other_user}","gists_url":"https://api.github.com/users/whit537/gists{/gist_id}","starred_url":"https://api.github.com/users/whit537/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whit537/subscriptions","organizations_url":"https://api.github.com/users/whit537/orgs","repos_url":"https://api.github.com/users/whit537/repos","events_url":"https://api.github.com/users/whit537/events{/privacy}","received_events_url":"https://api.github.com/users/whit537/received_events","type":"User","site_admin":false},"comments":105,"review_comments":17,"commits":17,"additions":529,"deletions":98,"changed_files":7}}