From b76e03a59661d2c784e77d3536273484072f0a52 Mon Sep 17 00:00:00 2001 From: Leonardo Kagohara Date: Fri, 14 Jun 2024 17:36:55 -0300 Subject: [PATCH] Add tax as a valid payment request option --- CHANGELOG.md | 2 ++ sdk/paymentRequest/paymentRequest.js | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8272b775..437f4272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ Given a version number MAJOR.MINOR.PATCH, increment: ## [Unreleased] +### Added +- Tax as a valid payment request ## [2.24.1] - 2024-05-09 ### Changed diff --git a/sdk/paymentRequest/paymentRequest.js b/sdk/paymentRequest/paymentRequest.js index a21f39c2..bda905db 100644 --- a/sdk/paymentRequest/paymentRequest.js +++ b/sdk/paymentRequest/paymentRequest.js @@ -3,6 +3,7 @@ const { Transaction } = require('../transaction/transaction.js'); const { Transfer } = require('../transfer/transfer.js'); const { UtilityPayment } = require('../utilityPayment/utilityPayment.js'); const { BrcodePayment } = require('../brcodePayment/brcodePayment.js'); +const { TaxPayment } = require('../taxPayment/taxPayment.js'); const rest = require('../utils/rest.js'); const check = require('starkcore').check; const Resource = require('starkcore').Resource; @@ -68,7 +69,8 @@ const parsePayment = function (payment, type) { ', transaction' + ', boleto-payment' + ', brcode-payment' + - 'or utility-payment'; + ', tax-payment' + + ' or utility-payment'; } if (payment instanceof Transfer) @@ -81,6 +83,8 @@ const parsePayment = function (payment, type) { type = 'brcode-payment'; if (payment instanceof UtilityPayment) type = 'utility-payment'; + if (payment instanceof TaxPayment) + type = 'tax-payment'; if (type) return { 'payment': payment, 'type': type }; @@ -91,6 +95,7 @@ const parsePayment = function (payment, type) { ', a starkbank.Transaction' + ', a starkbank.BoletoPayment' + ', a starkbank.BrcodePayment' + + ', a starkbank.TaxPayment' + ' or a starkbank.UtilityPayment' + ', but not a ' + typeof (payment) );