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

Function fillBillingForm

static/js/payment.js:618–644  ·  view source on GitHub ↗
(parsed)

Source from the content-addressed store, hash-verified

616}
617
618function fillBillingForm(parsed) {
619 if (!parsed || typeof parsed !== "object") return;
620
621 if (parsed.card_number) setInputValue("card-number-input", parsed.card_number);
622 if (parsed.exp_month || parsed.exp_year) {
623 setInputValue("card-expiry-input", formatExpiryInput(parsed.exp_month, parsed.exp_year));
624 }
625 if (parsed.cvc || parsed.cvv) setInputValue("card-cvc-input", String(parsed.cvc || parsed.cvv || ""));
626 if (parsed.billing_name) setInputValue("billing-name-input", parsed.billing_name);
627 if (parsed.address_line1) setInputValue("billing-line1-input", parsed.address_line1);
628 if (parsed.address_city) setInputValue("billing-city-input", parsed.address_city);
629 if (parsed.address_state) setInputValue("billing-state-input", parsed.address_state);
630 if (parsed.postal_code) setInputValue("billing-postal-input", parsed.postal_code);
631
632 if (parsed.country_code) {
633 const countryEl = document.getElementById("billing-country-input");
634 if (countryEl) countryEl.value = parsed.country_code;
635 }
636
637 if (parsed.currency) {
638 setInputValue("billing-currency-input", parsed.currency);
639 } else {
640 onBillingCountryChanged();
641 }
642
643 persistBillingProfileNonSensitive();
644}
645
646function onBillingCountryChanged() {
647 const country = (document.getElementById("billing-country-input")?.value || "US").toUpperCase();

Callers 4

randomBillingByCountryFunction · 0.85
applySelectedTemplateFunction · 0.85
parseSingleBillingTextFunction · 0.85
fillFromBatchProfileFunction · 0.85

Calls 4

setInputValueFunction · 0.85
formatExpiryInputFunction · 0.85
onBillingCountryChangedFunction · 0.85

Tested by

no test coverage detected