- fix when response is PLN Quota with user name using space

This commit is contained in:
Fadli 2022-11-16 00:17:53 +07:00
parent 0e61523dab
commit cb23ec16ae

View File

@ -1488,7 +1488,17 @@ export class TransactionService {
responseBaru[10].length > 1 ? responseBaru[10] : responseBaru[9];
if (dataTransaction.seri_number == 'SN:') {
dataTransaction.seri_number = responseBaru[11];
const s = 'SN: '
const index = response.indexOf(s);
const subIndex = index + s.length;
const newRes = response.substring(subIndex);
if (newRes.includes(' .')) {
const splitRes = newRes.split(' .')
const serialNumber = splitRes[0];
dataTransaction.seri_number = serialNumber
} else {
dataTransaction.seri_number = responseBaru[11];
}
}
}