{"action":"created","comment":{"url":"https://api.github.com/repos/kivanio/brcobranca/pulls/comments/192949731","pull_request_review_id":125823146,"id":192949731,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Mjk0OTczMQ==","diff_hunk":"@@ -0,0 +1,124 @@\n+# -*- encoding: utf-8 -*-\n+#\n+module Brcobranca\n+  module Boleto\n+    class Banpara < Base # Banco BANPARA\n+      validates_length_of :agencia, maximum: 4, message: 'deve ser menor ou igual a 4 dígitos.'\n+      validates_length_of :numero_documento, maximum: 11, message: 'deve ser menor ou igual a 11 dígitos.'\n+      validates_length_of :conta_corrente, maximum: 8, message: 'deve ser menor ou igual a 8 dígitos.'\n+      validates_length_of :carteira, maximum: 4, message: 'deve ser menor ou igual a 4 dígitos.'\n+\n+      # Nova instancia do Banpara\n+      # @param (see Brcobranca::Boleto::Base#initialize)\n+      def initialize(campos = {})\n+        campos = { carteira: '06' }.merge!(campos)\n+\n+        campos[:local_pagamento] = 'Pagável em qualquer Banco até o vencimento'\n+\n+        super(campos)\n+      end\n+\n+      # Codigo do banco emissor (3 dígitos sempre)\n+      #\n+      # @return [String] 3 caracteres numéricos.\n+      def banco\n+        '037'\n+      end\n+\n+      # Dígito verificador do banco\n+      # @return [Integer] 1 caracteres numéricos.\n+      def banco_dv\n+        '1'\n+      end\n+\n+      # Aceite - Nao tem no manual, foi baseado em boleto modelo enviado pela prefeitura\n+      # @return [String] 1 caracteres.\n+      def aceite\n+        'N'\n+      end\n+\n+      # Espécie do documento - Nao tem no manual, foi baseado em boleto modelo enviado pela prefeitura\n+      # @return [String] 3 caracteres.\n+      def especie_documento\n+        'DAM'\n+      end\n+\n+      # Carteira\n+      #\n+      # @return [String] 4 caracteres numéricos.\n+      def carteira=(valor)\n+        @carteira = valor.to_s.rjust(4, '0') if valor\n+      end\n+\n+      # Conta corrente.\n+      # @return [String] 8 caracteres numéricos.\n+      def conta_corrente=(valor)\n+        @conta_corrente = valor.to_s.rjust(8, '0') if valor\n+      end\n+\n+      # Número seqüencial utilizado para identificar o boleto.\n+      # @return [String] 11 caracteres numéricos.\n+      def numero_documento=(valor)\n+        @numero_documento = valor.to_s.rjust(8, '0') if valor\n+      end\n+\n+      # Nosso número para exibir no boleto.\n+      # @return [String]\n+      # @example\n+      #  boleto.nosso_numero_boleto #=> \"06040428\"\n+      def nosso_numero_boleto\n+        numero_documento\n+      end\n+\n+      # Dígito verificador da agência\n+      # @return [Integer] 1 caracteres numéricos.\n+      def agencia_dv\n+        agencia.modulo11(\n+          multiplicador: [2, 3, 4, 5],\n+          mapeamento: { 10 => 'P', 11 => 0 }\n+        ) { |total| 11 - (total % 11) }\n+      end\n+\n+      # Dígito verificador do nosso número\n+      # @return [Integer] 1 caracteres numéricos.\n+      def nosso_numero_dv\n+        \"#{carteira}#{numero_documento}\".modulo11(\n+          multiplicador: [2, 3, 4, 5, 6, 7],\n+          mapeamento: { 10 => 'P', 11 => 0 }\n+        ) { |total| 11 - (total % 11) }\n+      end\n+\n+      # Dígito verificador da conta corrente\n+      # @return [Integer] 1 caracteres numéricos.\n+      def conta_corrente_dv\n+        conta_corrente.modulo11(\n+          multiplicador: [2, 3, 4, 5, 6, 7],\n+          mapeamento: { 10 => 'P', 11 => 0 }\n+        ) { |total| 11 - (total % 11) }\n+      end\n+\n+      # Agência + conta corrente do cliente para exibir no boleto.\n+      # @return [String]\n+      # @example\n+      #  boleto.agencia_conta_boleto #=> \"0548 / 00001448-6\"\n+      def agencia_conta_boleto\n+        \"#{agencia} / #{conta_corrente}-#{conta_corrente_dv}\"\n+      end\n+\n+      # Segunda parte do código de barras.\n+      #\n+      # Posição | Tamanho | Conteúdo<br/>\n+      # 20 a 23 | 4       |  Agência Cedente (Sem o digito verificador, completar com zeros a esquerda quando  necessário)<br/>\n+      # 24 a 27 | 4       |  Carteira<br/>\n+      # 28 a 35 | 8       |  Número do Nosso Número(Sem o digito verificador)<br/>\n+      # 36 a 43 | 8       |  Conta do Cedente (Sem o digito verificador, completar com zeros a esquerda quando necessário)<br/>","path":"lib/brcobranca/boleto/banpara.rb","position":114,"original_position":114,"commit_id":"3d152294dbbcfb5355f82bcde2d287769fb266e9","original_commit_id":"3d152294dbbcfb5355f82bcde2d287769fb266e9","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Metrics/LineLength: Line is too long. [127/80]<br>Style/AsciiComments: Use only ascii symbols in comments.","created_at":"2018-06-05T05:30:49Z","updated_at":"2018-06-05T05:30:50Z","html_url":"https://github.com/kivanio/brcobranca/pull/194#discussion_r192949731","pull_request_url":"https://api.github.com/repos/kivanio/brcobranca/pulls/194","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/kivanio/brcobranca/pulls/comments/192949731"},"html":{"href":"https://github.com/kivanio/brcobranca/pull/194#discussion_r192949731"},"pull_request":{"href":"https://api.github.com/repos/kivanio/brcobranca/pulls/194"}}},"pull_request":{"url":"https://api.github.com/repos/kivanio/brcobranca/pulls/194","id":192578756,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNTc4NzU2","html_url":"https://github.com/kivanio/brcobranca/pull/194","diff_url":"https://github.com/kivanio/brcobranca/pull/194.diff","patch_url":"https://github.com/kivanio/brcobranca/pull/194.patch","issue_url":"https://api.github.com/repos/kivanio/brcobranca/issues/194","number":194,"state":"open","locked":false,"title":"Ps banpara","user":{"login":"lorenadgb","id":5891407,"node_id":"MDQ6VXNlcjU4OTE0MDc=","avatar_url":"https://avatars3.githubusercontent.com/u/5891407?v=4","gravatar_id":"","url":"https://api.github.com/users/lorenadgb","html_url":"https://github.com/lorenadgb","followers_url":"https://api.github.com/users/lorenadgb/followers","following_url":"https://api.github.com/users/lorenadgb/following{/other_user}","gists_url":"https://api.github.com/users/lorenadgb/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenadgb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenadgb/subscriptions","organizations_url":"https://api.github.com/users/lorenadgb/orgs","repos_url":"https://api.github.com/users/lorenadgb/repos","events_url":"https://api.github.com/users/lorenadgb/events{/privacy}","received_events_url":"https://api.github.com/users/lorenadgb/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-05T03:00:56Z","updated_at":"2018-06-05T05:30:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kivanio/brcobranca/pulls/194/commits","review_comments_url":"https://api.github.com/repos/kivanio/brcobranca/pulls/194/comments","review_comment_url":"https://api.github.com/repos/kivanio/brcobranca/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kivanio/brcobranca/issues/194/comments","statuses_url":"https://api.github.com/repos/kivanio/brcobranca/statuses/3d152294dbbcfb5355f82bcde2d287769fb266e9","head":{"label":"ISSIntel:ps_banpara","ref":"ps_banpara","sha":"3d152294dbbcfb5355f82bcde2d287769fb266e9","user":{"login":"ISSIntel","id":1993460,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5OTM0NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/1993460?v=4","gravatar_id":"","url":"https://api.github.com/users/ISSIntel","html_url":"https://github.com/ISSIntel","followers_url":"https://api.github.com/users/ISSIntel/followers","following_url":"https://api.github.com/users/ISSIntel/following{/other_user}","gists_url":"https://api.github.com/users/ISSIntel/gists{/gist_id}","starred_url":"https://api.github.com/users/ISSIntel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ISSIntel/subscriptions","organizations_url":"https://api.github.com/users/ISSIntel/orgs","repos_url":"https://api.github.com/users/ISSIntel/repos","events_url":"https://api.github.com/users/ISSIntel/events{/privacy}","received_events_url":"https://api.github.com/users/ISSIntel/received_events","type":"Organization","site_admin":false},"repo":{"id":72540102,"node_id":"MDEwOlJlcG9zaXRvcnk3MjU0MDEwMg==","name":"brcobranca","full_name":"ISSIntel/brcobranca","owner":{"login":"ISSIntel","id":1993460,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5OTM0NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/1993460?v=4","gravatar_id":"","url":"https://api.github.com/users/ISSIntel","html_url":"https://github.com/ISSIntel","followers_url":"https://api.github.com/users/ISSIntel/followers","following_url":"https://api.github.com/users/ISSIntel/following{/other_user}","gists_url":"https://api.github.com/users/ISSIntel/gists{/gist_id}","starred_url":"https://api.github.com/users/ISSIntel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ISSIntel/subscriptions","organizations_url":"https://api.github.com/users/ISSIntel/orgs","repos_url":"https://api.github.com/users/ISSIntel/repos","events_url":"https://api.github.com/users/ISSIntel/events{/privacy}","received_events_url":"https://api.github.com/users/ISSIntel/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ISSIntel/brcobranca","description":"Emissão de bloquetos de cobrança para bancos brasileiros","fork":true,"url":"https://api.github.com/repos/ISSIntel/brcobranca","forks_url":"https://api.github.com/repos/ISSIntel/brcobranca/forks","keys_url":"https://api.github.com/repos/ISSIntel/brcobranca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ISSIntel/brcobranca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ISSIntel/brcobranca/teams","hooks_url":"https://api.github.com/repos/ISSIntel/brcobranca/hooks","issue_events_url":"https://api.github.com/repos/ISSIntel/brcobranca/issues/events{/number}","events_url":"https://api.github.com/repos/ISSIntel/brcobranca/events","assignees_url":"https://api.github.com/repos/ISSIntel/brcobranca/assignees{/user}","branches_url":"https://api.github.com/repos/ISSIntel/brcobranca/branches{/branch}","tags_url":"https://api.github.com/repos/ISSIntel/brcobranca/tags","blobs_url":"https://api.github.com/repos/ISSIntel/brcobranca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ISSIntel/brcobranca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ISSIntel/brcobranca/git/refs{/sha}","trees_url":"https://api.github.com/repos/ISSIntel/brcobranca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ISSIntel/brcobranca/statuses/{sha}","languages_url":"https://api.github.com/repos/ISSIntel/brcobranca/languages","stargazers_url":"https://api.github.com/repos/ISSIntel/brcobranca/stargazers","contributors_url":"https://api.github.com/repos/ISSIntel/brcobranca/contributors","subscribers_url":"https://api.github.com/repos/ISSIntel/brcobranca/subscribers","subscription_url":"https://api.github.com/repos/ISSIntel/brcobranca/subscription","commits_url":"https://api.github.com/repos/ISSIntel/brcobranca/commits{/sha}","git_commits_url":"https://api.github.com/repos/ISSIntel/brcobranca/git/commits{/sha}","comments_url":"https://api.github.com/repos/ISSIntel/brcobranca/comments{/number}","issue_comment_url":"https://api.github.com/repos/ISSIntel/brcobranca/issues/comments{/number}","contents_url":"https://api.github.com/repos/ISSIntel/brcobranca/contents/{+path}","compare_url":"https://api.github.com/repos/ISSIntel/brcobranca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ISSIntel/brcobranca/merges","archive_url":"https://api.github.com/repos/ISSIntel/brcobranca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ISSIntel/brcobranca/downloads","issues_url":"https://api.github.com/repos/ISSIntel/brcobranca/issues{/number}","pulls_url":"https://api.github.com/repos/ISSIntel/brcobranca/pulls{/number}","milestones_url":"https://api.github.com/repos/ISSIntel/brcobranca/milestones{/number}","notifications_url":"https://api.github.com/repos/ISSIntel/brcobranca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ISSIntel/brcobranca/labels{/name}","releases_url":"https://api.github.com/repos/ISSIntel/brcobranca/releases{/id}","deployments_url":"https://api.github.com/repos/ISSIntel/brcobranca/deployments","created_at":"2016-11-01T13:43:58Z","updated_at":"2018-05-26T19:16:09Z","pushed_at":"2018-06-05T02:57:21Z","git_url":"git://github.com/ISSIntel/brcobranca.git","ssh_url":"git@github.com:ISSIntel/brcobranca.git","clone_url":"https://github.com/ISSIntel/brcobranca.git","svn_url":"https://github.com/ISSIntel/brcobranca","homepage":"https://brcobranca.herokuapp.com/","size":3872,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kivanio:master","ref":"master","sha":"0cae588fd5dc2cee8136d027e3b31e195175c901","user":{"login":"kivanio","id":5107,"node_id":"MDQ6VXNlcjUxMDc=","avatar_url":"https://avatars1.githubusercontent.com/u/5107?v=4","gravatar_id":"","url":"https://api.github.com/users/kivanio","html_url":"https://github.com/kivanio","followers_url":"https://api.github.com/users/kivanio/followers","following_url":"https://api.github.com/users/kivanio/following{/other_user}","gists_url":"https://api.github.com/users/kivanio/gists{/gist_id}","starred_url":"https://api.github.com/users/kivanio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kivanio/subscriptions","organizations_url":"https://api.github.com/users/kivanio/orgs","repos_url":"https://api.github.com/users/kivanio/repos","events_url":"https://api.github.com/users/kivanio/events{/privacy}","received_events_url":"https://api.github.com/users/kivanio/received_events","type":"User","site_admin":false},"repo":{"id":165755,"node_id":"MDEwOlJlcG9zaXRvcnkxNjU3NTU=","name":"brcobranca","full_name":"kivanio/brcobranca","owner":{"login":"kivanio","id":5107,"node_id":"MDQ6VXNlcjUxMDc=","avatar_url":"https://avatars1.githubusercontent.com/u/5107?v=4","gravatar_id":"","url":"https://api.github.com/users/kivanio","html_url":"https://github.com/kivanio","followers_url":"https://api.github.com/users/kivanio/followers","following_url":"https://api.github.com/users/kivanio/following{/other_user}","gists_url":"https://api.github.com/users/kivanio/gists{/gist_id}","starred_url":"https://api.github.com/users/kivanio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kivanio/subscriptions","organizations_url":"https://api.github.com/users/kivanio/orgs","repos_url":"https://api.github.com/users/kivanio/repos","events_url":"https://api.github.com/users/kivanio/events{/privacy}","received_events_url":"https://api.github.com/users/kivanio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kivanio/brcobranca","description":"Emissão de bloquetos de cobrança para bancos brasileiros","fork":false,"url":"https://api.github.com/repos/kivanio/brcobranca","forks_url":"https://api.github.com/repos/kivanio/brcobranca/forks","keys_url":"https://api.github.com/repos/kivanio/brcobranca/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kivanio/brcobranca/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kivanio/brcobranca/teams","hooks_url":"https://api.github.com/repos/kivanio/brcobranca/hooks","issue_events_url":"https://api.github.com/repos/kivanio/brcobranca/issues/events{/number}","events_url":"https://api.github.com/repos/kivanio/brcobranca/events","assignees_url":"https://api.github.com/repos/kivanio/brcobranca/assignees{/user}","branches_url":"https://api.github.com/repos/kivanio/brcobranca/branches{/branch}","tags_url":"https://api.github.com/repos/kivanio/brcobranca/tags","blobs_url":"https://api.github.com/repos/kivanio/brcobranca/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kivanio/brcobranca/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kivanio/brcobranca/git/refs{/sha}","trees_url":"https://api.github.com/repos/kivanio/brcobranca/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kivanio/brcobranca/statuses/{sha}","languages_url":"https://api.github.com/repos/kivanio/brcobranca/languages","stargazers_url":"https://api.github.com/repos/kivanio/brcobranca/stargazers","contributors_url":"https://api.github.com/repos/kivanio/brcobranca/contributors","subscribers_url":"https://api.github.com/repos/kivanio/brcobranca/subscribers","subscription_url":"https://api.github.com/repos/kivanio/brcobranca/subscription","commits_url":"https://api.github.com/repos/kivanio/brcobranca/commits{/sha}","git_commits_url":"https://api.github.com/repos/kivanio/brcobranca/git/commits{/sha}","comments_url":"https://api.github.com/repos/kivanio/brcobranca/comments{/number}","issue_comment_url":"https://api.github.com/repos/kivanio/brcobranca/issues/comments{/number}","contents_url":"https://api.github.com/repos/kivanio/brcobranca/contents/{+path}","compare_url":"https://api.github.com/repos/kivanio/brcobranca/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kivanio/brcobranca/merges","archive_url":"https://api.github.com/repos/kivanio/brcobranca/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kivanio/brcobranca/downloads","issues_url":"https://api.github.com/repos/kivanio/brcobranca/issues{/number}","pulls_url":"https://api.github.com/repos/kivanio/brcobranca/pulls{/number}","milestones_url":"https://api.github.com/repos/kivanio/brcobranca/milestones{/number}","notifications_url":"https://api.github.com/repos/kivanio/brcobranca/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kivanio/brcobranca/labels{/name}","releases_url":"https://api.github.com/repos/kivanio/brcobranca/releases{/id}","deployments_url":"https://api.github.com/repos/kivanio/brcobranca/deployments","created_at":"2009-04-02T02:03:17Z","updated_at":"2018-05-30T11:34:15Z","pushed_at":"2018-06-05T03:00:57Z","git_url":"git://github.com/kivanio/brcobranca.git","ssh_url":"git@github.com:kivanio/brcobranca.git","clone_url":"https://github.com/kivanio/brcobranca.git","svn_url":"https://github.com/kivanio/brcobranca","homepage":"https://brcobranca.herokuapp.com/","size":40934,"stargazers_count":292,"watchers_count":292,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":171,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":171,"open_issues":11,"watchers":292,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kivanio/brcobranca/pulls/194"},"html":{"href":"https://github.com/kivanio/brcobranca/pull/194"},"issue":{"href":"https://api.github.com/repos/kivanio/brcobranca/issues/194"},"comments":{"href":"https://api.github.com/repos/kivanio/brcobranca/issues/194/comments"},"review_comments":{"href":"https://api.github.com/repos/kivanio/brcobranca/pulls/194/comments"},"review_comment":{"href":"https://api.github.com/repos/kivanio/brcobranca/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kivanio/brcobranca/pulls/194/commits"},"statuses":{"href":"https://api.github.com/repos/kivanio/brcobranca/statuses/3d152294dbbcfb5355f82bcde2d287769fb266e9"}},"author_association":"NONE"}}
{"actor":{"display_login":"houndci-bot"}}