Skip to content

Commit

Permalink
Add tax as a valid payment request option
Browse files Browse the repository at this point in the history
  • Loading branch information
leoKagohara-Stark committed Jun 14, 2024
1 parent cd0aeac commit faafb03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sdk/paymentRequest/paymentRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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 };
Expand All @@ -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)
);
Expand Down

0 comments on commit faafb03

Please sign in to comment.