美国
19801
预加载加拿大真实城市邮编映射与 CNA / NANPA & Canada Post 合规号段(+1 <NPA> 555-0100 .. 555-0199),支持在下方分屏控制台一键切换边界压测并导出 Playwright / Stripe / SQL / CSV。
{
"meta": {
"service": "AddressQA",
"seed": "qa-ca-01",
"country": "CA",
"countrySlug": "ca",
"state": "ALL",
"taxFree": false,
"phoneMode": "safe",
"boundary": "normal",
"count": 1
},
"fixtures": [
{
"id": "qa-ca-01-1-CA-AB",
"index": 1,
"seed": "qa-ca-01",
"boundary": "normal",
"recipient": {
"fullName": "Marcus Mitchell",
"nativeName": "Marcus Mitchell",
"displayName": "Marcus Mitchell",
"firstName": "Marcus",
"lastName": "Mitchell",
"email": "[email protected]"
},
"address": {
"line1": "4788 Stephen Ave SW",
"line1Native": "4788 Stephen Ave SW",
"line2": "Suite 492",
"city": "Calgary",
"cityNative": "Calgary",
"state": "AB",
"stateName": "Alberta",
"postalCode": "T2P 1J9",
"zipPlus4": "T2P 1J9",
"country": "CA",
"countryName": "Canada",
"formatted": "4788 Stephen Ave SW, Suite 492, Calgary, AB T2P 1J9, CA"
},
"phone": {
"countryCode": "CA",
"dialCode": "+1",
"areaCode": "403",
"regionCode": "AB",
"regionName": "Alberta",
"city": "Calgary",
"mode": "safe",
"regulatorSafe": true,
"regulatorAuthority": "CNA / NANPA & Canada Post",
"e164": "+14035550116",
"international": "+1 403-555-0116",
"national": "(403) 555-0116",
"rfc3966": "tel:+1-403-555-0116",
"digitsOnly": "4035550116"
},
"qaFlags": {
"taxFreeUsState": false,
"leadingZeroPostal": false,
"streetLength": 19,
"hasUnicode": false,
"hasLine2": true,
"regulatorSafePhone": true,
"postalRequired": true
}
}
]
} // Generated by AddressQA (seed: qa-ca-01, country: CA, boundary: normal)
import { test, expect, type Page } from '@playwright/test';
const checkoutFixture = {
"fullName": "Marcus Mitchell",
"email": "[email protected]",
"phoneE164": "+14035550116",
"line1": "4788 Stephen Ave SW",
"line2": "Suite 492",
"city": "Calgary",
"state": "AB",
"postalCode": "T2P 1J9",
"country": "CA"
};
async function fillCheckoutForm(page: Page, data: typeof checkoutFixture) {
await page.getByLabel(/full name/i).fill(data.fullName);
await page.getByLabel(/email/i).fill(data.email);
await page.getByLabel(/phone/i).fill(data.phoneE164);
await page.getByLabel(/address line 1|street/i).fill(data.line1);
if (data.line2) await page.getByLabel(/address line 2|apt|suite/i).fill(data.line2);
await page.getByLabel(/city/i).fill(data.city);
await page.getByLabel(/state|region|province/i).fill(data.state);
if (data.postalCode) await page.getByLabel(/zip|postal/i).fill(data.postalCode);
}
test('checkout validation (CA / normal)', async ({ page }) => {
const target = checkoutFixture;
await page.goto('/checkout');
await fillCheckoutForm(page, target);
await page.getByRole('button', { name: /continue|pay/i }).click();
await expect(page.getByTestId('order-summary-postal')).toHaveText(target.postalCode || 'N/A');
}); {
"shipping": {
"name": "Marcus Mitchell",
"phone": "+14035550116",
"address": {
"line1": "4788 Stephen Ave SW",
"line2": "Suite 492",
"city": "Calgary",
"state": "AB",
"postal_code": "T2P 1J9",
"country": "CA"
}
},
"billing_details": {
"name": "Marcus Mitchell",
"email": "[email protected]",
"phone": "+14035550116",
"address": {
"line1": "4788 Stephen Ave SW",
"line2": "Suite 492",
"city": "Calgary",
"state": "AB",
"postal_code": "T2P 1J9",
"country": "CA"
}
},
"metadata": {
"qa_seed": "qa-ca-01",
"qa_boundary": "normal",
"us_tax_free_state": "false",
"regulator_safe_phone": "true"
}
} -- AddressQA deterministic SQL seed (qa-ca-01)
INSERT INTO qa_address_fixtures (fixture_id, seed, full_name, email, phone_e164, phone_national, street_line1, street_line2, city, region_code, postal_code, country_code, tax_free_us_state) VALUES ('qa-ca-01-1-CA-AB', 'qa-ca-01', 'Marcus Mitchell', '[email protected]', '+14035550116', '(403) 555-0116', '4788 Stephen Ave SW', 'Suite 492', 'Calgary', 'AB', 'T2P 1J9', 'CA', FALSE); # Deterministic AddressQA Edge API request
curl -sS "https://addressqa.com/api/v1/fixtures?country=CA&seed=qa-ca-01" | jq .
# Export directly as Excel-safe CSV or Stripe Checkout JSON:
curl -sS "https://addressqa.com/api/v1/fixtures?country=CA&seed=qa-ca-01&format=stripe"
curl -sS "https://addressqa.com/api/v1/fixtures?country=CA&seed=qa-ca-01&format=csv" -o fixtures-qa-ca-01.csv fixture_id,seed,full_name,email,phone_e164,phone_national,street_line1,street_line2,city,state,postal_code,country,tax_free_us_state,boundary
qa-ca-01-1-CA-AB,qa-ca-01,Marcus Mitchell,[email protected],+14035550116,(403) 555-0116,4788 Stephen Ave SW,Suite 492,Calgary,AB,T2P 1J9,CA,false,normal | 校验维度 | 规范与边界说明 |
|---|---|
| 邮编正则与长度 | 示例 M5V 3L9(最大长度 7,正则 /^[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z] \d[ABCEGHJ-NPRSTV-Z]\d$/) |
| 前导零截断风险 | 标准非零或字母开头格式,仍建议使用 VARCHAR 存储 |
| E.164 电话与区号同步 | 国家码 +1,标准有效长度 10 位,安全段 +1 <NPA> 555-0100 .. 555-0199 |
| 典型测试城市样本 | Toronto (ON) · 邮编 M5V 3L9 · 区号 416 |
| 权威标准来源 | 采用北美 NANP 加拿大虚构号段(+1 省区号 555-01xx),邮编遵循加拿大邮政排除字母规则(禁用 D/F/I/O/Q/U)。 (CNA / NANPA & Canada Post) |
| 行政区 | 代码 | 城市 | 邮编 | 区号 |
|---|---|---|---|---|
| Ontario | ON | Toronto | M5V 3L9 | +1 (416) |
| Ontario | ON | Ottawa | K1A 0B1 | +1 (613) |
| British Columbia | BC | Vancouver | V6B 2W9 | +1 (604) |
| Québec (Quebec) | QC | Montréal (Montreal) | H3B 2Y5 | +1 (514) |
| Alberta | AB | Calgary | T2P 1J9 | +1 (403) |
19801
06500