MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / parseBatchBillingText

Function parseBatchBillingText

static/js/payment.js:1033–1067  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1031}
1032
1033function parseBatchBillingText() {
1034 const text = getInputValue("billing-paste-text");
1035 if (!text) {
1036 setParseResult("请先粘贴文本", "error");
1037 return;
1038 }
1039
1040 const blocks = splitBatchBlocks(text);
1041 if (!blocks.length) {
1042 setParseResult("未检测到可解析的文本块", "error");
1043 return;
1044 }
1045
1046 billingBatchProfiles = blocks
1047 .map((blockText) => ({ raw: blockText, parsed: parseCardText(blockText) }))
1048 .filter((item) => {
1049 const parsed = item.parsed || {};
1050 return Boolean(
1051 parsed.card_number ||
1052 parsed.exp_month ||
1053 parsed.exp_year ||
1054 parsed.cvv ||
1055 parsed.address_line1 ||
1056 parsed.raw_address
1057 );
1058 });
1059
1060 renderBatchProfiles();
1061 if (!billingBatchProfiles.length) {
1062 setParseResult("批量识别完成,但没有可用记录", "error");
1063 return;
1064 }
1065
1066 setParseResult(`批量识别成功:共 ${billingBatchProfiles.length} 条`, "success");
1067}
1068
1069function fillFromBatchProfile(index) {
1070 const item = billingBatchProfiles[index];

Callers

nothing calls this directly

Calls 6

getInputValueFunction · 0.85
setParseResultFunction · 0.85
splitBatchBlocksFunction · 0.85
parseCardTextFunction · 0.85
renderBatchProfilesFunction · 0.85
filterMethod · 0.45

Tested by

no test coverage detected