Skip to content

Commit faafb03

Browse files
Add tax as a valid payment request option
1 parent cd0aeac commit faafb03

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sdk/paymentRequest/paymentRequest.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { Transaction } = require('../transaction/transaction.js');
33
const { Transfer } = require('../transfer/transfer.js');
44
const { UtilityPayment } = require('../utilityPayment/utilityPayment.js');
55
const { BrcodePayment } = require('../brcodePayment/brcodePayment.js');
6+
const { TaxPayment } = require('../taxPayment/taxPayment.js');
67
const rest = require('../utils/rest.js');
78
const check = require('starkcore').check;
89
const Resource = require('starkcore').Resource;
@@ -68,7 +69,8 @@ const parsePayment = function (payment, type) {
6869
', transaction' +
6970
', boleto-payment' +
7071
', brcode-payment' +
71-
'or utility-payment';
72+
', tax-payment' +
73+
' or utility-payment';
7274
}
7375

7476
if (payment instanceof Transfer)
@@ -81,6 +83,8 @@ const parsePayment = function (payment, type) {
8183
type = 'brcode-payment';
8284
if (payment instanceof UtilityPayment)
8385
type = 'utility-payment';
86+
if (payment instanceof TaxPayment)
87+
type = 'tax-payment';
8488

8589
if (type)
8690
return { 'payment': payment, 'type': type };
@@ -91,6 +95,7 @@ const parsePayment = function (payment, type) {
9195
', a starkbank.Transaction' +
9296
', a starkbank.BoletoPayment' +
9397
', a starkbank.BrcodePayment' +
98+
', a starkbank.TaxPayment' +
9499
' or a starkbank.UtilityPayment' +
95100
', but not a ' + typeof (payment)
96101
);

0 commit comments

Comments
 (0)