Skip to content

Commit

Permalink
boleto-api-caixa: add the correct agency to payload
Browse files Browse the repository at this point in the history
  • Loading branch information
alinemarjorie committed Mar 18, 2021
1 parent dda4072 commit c90990a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/providers/boleto-api-caixa/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ const buildPayload = (boleto, operationId) => {
const formattedBuyerStateCode = formatStateCode(boleto, 'payer_address')

const agreementNumber = 1103388
const agency = 3337

const payload = {
bankNumber: caixaBankCode,
agreement: {
agreementNumber,
agency: path(['issuer_agency'], boleto),
agency,
},
title: {
expireDate: formattedExpirationDate,
Expand Down
4 changes: 2 additions & 2 deletions test/unit/providers/boleto-api-caixa/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test('buildPayload with full payer_address', async (t) => {
bankNumber: 104,
agreement: {
agreementNumber: 1103388,
agency: boleto.issuer_agency,
agency: 3337,
},
title: {
expireDate: moment(boleto.expiration_date).tz('America/Sao_Paulo').format('YYYY-MM-DD'),
Expand Down Expand Up @@ -88,7 +88,7 @@ test('buildPayload with payer_address incomplete', async (t) => {
bankNumber: 104,
agreement: {
agreementNumber: 1103388,
agency: boleto.issuer_agency,
agency: 3337,
},
title: {
expireDate: moment(boleto.expiration_date).tz('America/Sao_Paulo').format('YYYY-MM-DD'),
Expand Down

0 comments on commit c90990a

Please sign in to comment.