@1aboveio/skills 0.14.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/package.json +1 -1
- package/runtime/skills/distribution/generated/recipes.json +178 -34
- package/runtime/skills/distribution/scripts/bundles.mjs +11 -3
- package/runtime/skills/engineering/engineering-runtime/scripts/workflow-policy.mjs +1 -1
- package/skills/{backend → data-science}/pyspark/SKILL.md +42 -40
- package/skills/{backend → data-science}/pyspark/references/diagnosis-and-profiling.md +28 -13
- package/skills/data-science/pyspark/references/production-validation.md +130 -0
- package/skills/data-science/pyspark/references/reconciliation.md +38 -0
- package/skills/{backend → data-science}/pyspark/references/transformation-design.md +30 -2
- package/skills/engineering/engineering-runtime/coherence/workflow.json +14 -14
- package/skills/engineering/engineering-runtime/scripts/workflow-policy.mjs +1 -1
- package/skills/engineering/resolve-issues/generated/workflow-repair-policy.json +11 -11
- package/skills/engineering/resolve-issues/scripts/run-state.mjs +1 -1
- package/skills/payment/fraud-analysis/LICENSE +3 -0
- package/skills/payment/fraud-analysis/SKILL.md +113 -0
- package/skills/payment/fraud-analysis/evals/evals.json +40 -0
- package/skills/payment/fraud-analysis/references/archetypes/authorized-payment-scam.md +41 -0
- package/skills/payment/fraud-analysis/references/archetypes/first-party-fraud.md +44 -0
- package/skills/payment/fraud-analysis/references/archetypes/third-party-fraud.md +27 -0
- package/skills/payment/fraud-analysis/references/contexts/bank-transfer.md +24 -0
- package/skills/payment/fraud-analysis/references/contexts/card-payment.md +30 -0
- package/skills/payment/fraud-analysis/references/contexts/payment-collection.md +20 -0
- package/skills/payment/fraud-analysis/references/contexts/payout.md +20 -0
- package/skills/payment/fraud-analysis/references/feature-engineering.md +158 -0
- package/skills/payment/fraud-analysis/references/mechanisms/account-takeover.md +36 -0
- package/skills/payment/fraud-analysis/references/report-rationale.md +45 -0
- package/skills/payment/fraud-analysis/references/report-template.md +190 -0
- package/skills/payment/fraud-analysis/references/review-checklist.md +175 -0
- package/skills/payment/fraud-analysis/references/taxonomy.md +79 -0
- package/skills/payment/fraud-analysis/references/terminology.md +108 -0
- package/skills/payment/fraud-analysis/references/workflow.md +175 -0
- package/skills/payment/payment-analysis/LICENSE +3 -0
- package/skills/payment/payment-analysis/SKILL.md +127 -0
- package/skills/payment/payment-analysis/references/auth-rate-actions.md +30 -0
- package/skills/payment/payment-analysis/references/chargebacks.md +88 -0
- package/skills/payment/payment-analysis/references/event-layers.md +79 -0
- package/skills/payment/payment-analysis/references/fx.md +59 -0
- package/skills/payment/payment-analysis/references/journey.md +78 -0
- package/skills/payment/payment-analysis/references/metrics.md +62 -0
- package/skills/payment/payment-analysis/references/report-template.md +98 -0
- package/skills/payment/payment-analysis/references/terminology.md +85 -0
- package/skills/payment/payment-analysis/references/visualization.md +47 -0
- package/skills/backend/pyspark/references/parity-testing.md +0 -83
- package/skills/backend/pyspark/references/production-validation.md +0 -166
- /package/skills/{backend → data-science}/airflow-dag-develop/LICENSE +0 -0
- /package/skills/{backend → data-science}/airflow-dag-develop/SKILL.md +0 -0
- /package/skills/{backend → data-science}/pyspark/LICENSE +0 -0
- /package/skills/{backend → data-science}/pyspark/assets/templates/etl.py +0 -0
- /package/skills/{backend → data-science}/pyspark/assets/templates/utils/__init__.py +0 -0
- /package/skills/{backend → data-science}/pyspark/assets/templates/utils/hudi_metadata.py +0 -0
- /package/skills/{backend → data-science}/pyspark/references/etl-contract.md +0 -0
- /package/skills/{backend → data-science}/pyspark/references/velocity-feature-calculation.md +0 -0
- /package/skills/{backend → data-science}/pyspark/scripts/spark_eventlog_summary.py +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Actions that often lift auth rate
|
|
2
|
+
|
|
3
|
+
Use this list when writing **运营影响**. Pick only items the extract
|
|
4
|
+
supports. Do not dump the whole list. These are routing / retry operations,
|
|
5
|
+
not a `fraud-analysis` rule package (no precision/recall, no “loss saved”).
|
|
6
|
+
|
|
7
|
+
Auth rate = 授权成功 / 授权尝试. BIN country = 发卡行国家.
|
|
8
|
+
|
|
9
|
+
| # | When the data shows | Action | Do not write |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| 1 | BIN countries under SCA (e.g. UK, Spain, Italy) and Authentication method is empty / None | Route **3DS** for those 发卡行国家 | 强客户认证 as the standing term (use SCA); claiming 3DS will raise conversion |
|
|
12
|
+
| 2 | A country (or book) where 疑似欺诈 is a large share of 授权拒绝 | **风控拦截** and/or **3DS** on that 发卡行国家 | Calling 疑似欺诈 “confirmed fraud”; putting this in the 3DS 与风控 exec slot as a decline mix |
|
|
13
|
+
| 3 | Material **软性拒绝** (issuer soft: 余额不足, Do not honor, 超限, …) | **Retry** the authorization (same or later attempt, per acquirer retry rules) | Treating 无效卡 / 账户关闭 as retry-eligible |
|
|
14
|
+
| 4 | 余额不足, 安全码无效, 有效期无效, Do not honor 等可解释的拒绝 | On the **payment page**, show the matching reason (余额不足 / 安全码错误 / 有效期错误), not a generic “支付失败” | Inventing copy the issuer did not return; hiding the reason |
|
|
15
|
+
|
|
16
|
+
## How to cite in the report
|
|
17
|
+
|
|
18
|
+
One short 运营影响 bullet per action, with the evidence already in the
|
|
19
|
+
report (country, share, 软性拒绝 count). Example shapes:
|
|
20
|
+
|
|
21
|
+
- SCA:英国、西班牙、意大利受 SCA 约束,当前分析时段内无 3DS,建议对这些发卡行国家路由 3DS。
|
|
22
|
+
- 疑似欺诈:某国疑似欺诈占授权拒绝 X%,建议风控拦截或 3DS。
|
|
23
|
+
- 软性拒绝:软性拒绝 N 笔(余额不足 / Do not honor / …),可按收单行规则重试。
|
|
24
|
+
- 支付页提示:余额不足、安全码无效、有效期无效应在支付页给出对应提示,便于用户换卡或改卡号、有效期、安全码。
|
|
25
|
+
|
|
26
|
+
## Out of scope
|
|
27
|
+
|
|
28
|
+
- Supervised thresholds, holdout, 3DS/block “packages” → `fraud-analysis`
|
|
29
|
+
- Inventing retry counts or expected auth-rate lift
|
|
30
|
+
- Mixing portfolio and merchant grains in one file
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Chargeback / dispute rate (Visa vs Mastercard)
|
|
2
|
+
|
|
3
|
+
Topic **4.8 拒付 / 争议**. Put the Visa / Mastercard formulas as a **note
|
|
4
|
+
under the monthly rate chart**. Count rates follow card-network monitoring
|
|
5
|
+
programmes, **not** origination-month vintage and **not** a blended
|
|
6
|
+
Visa+Mastercard ratio.
|
|
7
|
+
|
|
8
|
+
Official Visa and Mastercard rulebooks are acquirer-gated. The formulas
|
|
9
|
+
below are the processor restatements used in production monitoring
|
|
10
|
+
(Stripe, Braintree). Caption the report as **network-style estimates
|
|
11
|
+
from this extract**, not as a Visa/Mastercard identification notice.
|
|
12
|
+
|
|
13
|
+
## When a point is drawn
|
|
14
|
+
|
|
15
|
+
A monthly point for a card brand is drawn **only if**
|
|
16
|
+
|
|
17
|
+
- numerator (chargebacks **received** that calendar month for that brand) > 0, and
|
|
18
|
+
- denominator (sales count for that brand, month as defined below) > 0.
|
|
19
|
+
|
|
20
|
+
Otherwise **omit the point**. Do not plot `0`. Do not invent a prior-month
|
|
21
|
+
sale count. If a brand has no drawable points, omit the series. If no
|
|
22
|
+
series remain, omit the rate chart (keep the reason-category bars if CBs
|
|
23
|
+
exist).
|
|
24
|
+
|
|
25
|
+
## Formulas (count)
|
|
26
|
+
|
|
27
|
+
Numerator for both brands: chargebacks **received** in calendar month `M`
|
|
28
|
+
(`Chargeback date`), `Payment method` = that brand. Not original
|
|
29
|
+
transaction month. Inquiries / RDR-cleared cases are not in this extract;
|
|
30
|
+
count every CB row.
|
|
31
|
+
|
|
32
|
+
| Brand | Programme (current) | Rate |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| Visa | VAMP dispute/sales count (same month) | `CB_Visa(M) / Sales_Visa(M)` |
|
|
35
|
+
| Mastercard | ECP / ECM chargeback rate (lagged sales) | `CB_MC(M) / Sales_MC(M−1)` |
|
|
36
|
+
|
|
37
|
+
`Sales_*` = settlement type Sale, that brand, **transaction/capture month**.
|
|
38
|
+
Do not mix refunds into the denominator.
|
|
39
|
+
|
|
40
|
+
Mastercard **must** use the previous calendar month’s sales. If `M−1`
|
|
41
|
+
sales are missing from the extract, skip Mastercard for month `M`.
|
|
42
|
+
|
|
43
|
+
## Visa notes (do not over-claim VAMP)
|
|
44
|
+
|
|
45
|
+
Since 2025-04 Visa folded VDMP/VFMP into **VAMP**. Full VAMP Count is
|
|
46
|
+
`opened Visa chargebacks (TC15) + reported fraud (TC40 EFW)`, same-month
|
|
47
|
+
sales in the denominator. This skill’s extract usually has chargebacks
|
|
48
|
+
only → report **Visa 拒付率 = Visa CB count / Visa same-month sales**.
|
|
49
|
+
Do not label it “VAMP ratio” unless TC40/EFW is in the file.
|
|
50
|
+
|
|
51
|
+
VAMP also has volume and enumeration legs; those are out of scope here.
|
|
52
|
+
|
|
53
|
+
## Mastercard notes
|
|
54
|
+
|
|
55
|
+
ECP (ECM / HECM) uses **both** a count threshold and the lagged rate.
|
|
56
|
+
This report draws the **rate** series only. Do not say the merchant is
|
|
57
|
+
“in ECM” from the extract.
|
|
58
|
+
|
|
59
|
+
EFM is a different (fraud-reason + 3DS mix) programme; do not substitute
|
|
60
|
+
it for ECP.
|
|
61
|
+
|
|
62
|
+
## Amount rate (optional footnote)
|
|
63
|
+
|
|
64
|
+
`abs(dispute amount) / sale amount` with the **same month alignment as
|
|
65
|
+
the count rate** for that brand. Secondary; the line chart is count %.
|
|
66
|
+
|
|
67
|
+
## Window caveat
|
|
68
|
+
|
|
69
|
+
A short extract (e.g. 22 days of August plus a handful of July sales)
|
|
70
|
+
cannot produce a Mastercard lagged rate for August unless July Mastercard
|
|
71
|
+
sales exist, and cannot produce Visa July if July CBs are absent. Follow
|
|
72
|
+
the skip rules; do not pad.
|
|
73
|
+
|
|
74
|
+
## Sources
|
|
75
|
+
|
|
76
|
+
- Stripe, *Dispute and fraud card monitoring programs*: Visa uses
|
|
77
|
+
disputes/fraud vs **same-month** payments; Mastercard uses
|
|
78
|
+
disputes/fraud vs **previous-month** payments; both assign the CB to
|
|
79
|
+
the month it was **received**.
|
|
80
|
+
https://docs.stripe.com/disputes/monitoring-programs
|
|
81
|
+
- Braintree, *Visa Acquirer Monitoring Program (VAMP)*: VAMP ratio =
|
|
82
|
+
VAMP Count / **same-month** Visa sales count
|
|
83
|
+
(example: August count / August sales).
|
|
84
|
+
https://developer.paypal.com/braintree/articles/risk-and-security/card-brand-monitoring-programs/visa-programs/visa-dispute-monitoring-program
|
|
85
|
+
- Chargebacks911 primer on Mastercard ECM rate: chargebacks in the
|
|
86
|
+
**current** month / Mastercard transactions in the **previous** month
|
|
87
|
+
(April 10,000 sales and May 90 CBs → May rate 1%).
|
|
88
|
+
https://chargebacks911.com/mastercard-chargebacks/mastercard-excessive-fraud-chargeback-monitoring-programs/mastercard-ecm-program-how-to-calculate-your-mastercard-chargeback-rate/
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Event layers, grains, and joins
|
|
2
|
+
|
|
3
|
+
## Layers
|
|
4
|
+
|
|
5
|
+
| Layer | Example filename pattern | Default grain | Usual time field |
|
|
6
|
+
|---|---|---|---|
|
|
7
|
+
| Authorizations | `Authorizations_*authorizations.csv` | one auth attempt | `Timestamp` |
|
|
8
|
+
| Settlements | `Sales-and-refunds_*settlements.csv` | one sale or refund | `Timestamp` or `Settlement date` |
|
|
9
|
+
| Chargebacks | `Chargebacks_*chargebacks.csv` | one dispute | `Chargeback date`; origination via `Original transaction timestamp` |
|
|
10
|
+
|
|
11
|
+
A run may use one, two, or all three layers. Name every layer used and every layer
|
|
12
|
+
missing.
|
|
13
|
+
|
|
14
|
+
## Portfolio constants to record
|
|
15
|
+
|
|
16
|
+
When columns exist and are near-constant, state them once (do not treat as
|
|
17
|
+
drivers):
|
|
18
|
+
|
|
19
|
+
- MID / Gateway MID
|
|
20
|
+
- MCC
|
|
21
|
+
- Provider / acquirer path
|
|
22
|
+
- Transaction source / entry method
|
|
23
|
+
- Billing descriptor / sub merchant
|
|
24
|
+
|
|
25
|
+
## Keys and joins
|
|
26
|
+
|
|
27
|
+
| Join | Left | Right | Notes |
|
|
28
|
+
|---|---|---|---|
|
|
29
|
+
| Auth ↔ Chargeback | `Order ID` | `Original transaction order ID` | Primary for this Pazien-style extract |
|
|
30
|
+
| Auth ↔ Settlement | `Order ID` | `Order ID` | May be 1:n if capture/refund splits |
|
|
31
|
+
| Weak identity | masked `Account`, `IIN` | same | Collisions possible; fine for contribution tables, not unique-customer claims |
|
|
32
|
+
|
|
33
|
+
Report match rates whenever a join supports a claim (“N of M chargebacks match an
|
|
34
|
+
auth in file”).
|
|
35
|
+
|
|
36
|
+
## Currency
|
|
37
|
+
|
|
38
|
+
Reporting amounts are USD. Conversion rules: [fx.md](fx.md).
|
|
39
|
+
|
|
40
|
+
1. Prefer native USD rows; convert every non-USD amount before summing.
|
|
41
|
+
2. Never add USD + EUR (etc.) into one total without FX and a disclosure.
|
|
42
|
+
3. Count KPIs never need FX.
|
|
43
|
+
|
|
44
|
+
## Window selection
|
|
45
|
+
|
|
46
|
+
| User ask | Default |
|
|
47
|
+
|---|---|
|
|
48
|
+
| Full extract | min→max of chosen time field |
|
|
49
|
+
| Most recent week / last 7 days | `(max_ts - 7d, max_ts]` |
|
|
50
|
+
| Calendar week | dates in that Mon–Sun (or local week rule; state it) |
|
|
51
|
+
| Compare recent vs prior | split at the same cut; show both |
|
|
52
|
+
|
|
53
|
+
Chargeback **programme 拒付率** uses received month (`Chargeback date`) per
|
|
54
|
+
[chargebacks.md](chargebacks.md). If you also show origination-month incidence,
|
|
55
|
+
label that separately so it is not mistaken for the Visa/Mastercard rate.
|
|
56
|
+
|
|
57
|
+
## Decline taxonomy (auth)
|
|
58
|
+
|
|
59
|
+
Map with both code and message when present (example Pazien-style):
|
|
60
|
+
|
|
61
|
+
| Code | Message (typical) | Class |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| A001 | Approval - generic | approval |
|
|
64
|
+
| D102 | Suspected fraud | hard / fraud-coded |
|
|
65
|
+
| D104 | Insufficient funds | soft / funds |
|
|
66
|
+
| D387 | Policy reasons | hard / policy |
|
|
67
|
+
| D202 | Security code invalid | hard / data |
|
|
68
|
+
| D204 | Invalid Expiration date | hard / data |
|
|
69
|
+
| D210 | Do not honor | soft / issuer |
|
|
70
|
+
| R014 | Invalid transaction | reject |
|
|
71
|
+
|
|
72
|
+
Always recompute from the file; do not assume codes are portable across gateways.
|
|
73
|
+
|
|
74
|
+
## What not to infer
|
|
75
|
+
|
|
76
|
+
- BIN country ≠ shipping or billing country
|
|
77
|
+
- Approval ≠ settled funds
|
|
78
|
+
- Suspected-fraud decline ≠ confirmed fraud loss
|
|
79
|
+
- Chargeback reason Fraud ≠ first-party vs third-party adjudication
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Amount currency → USD (Forex Service)
|
|
2
|
+
|
|
3
|
+
Reporting amounts are **USD**. Count KPIs never need FX.
|
|
4
|
+
|
|
5
|
+
Use the Forex Service (`~/projects/forex`), not a provider SDK, not a
|
|
6
|
+
spreadsheet rate, not realtime quotes for historical windows.
|
|
7
|
+
|
|
8
|
+
## Which amount
|
|
9
|
+
|
|
10
|
+
| Layer | Amount | Currency |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| Authorization | `Transaction amount` | `Transaction amount currency` |
|
|
13
|
+
| Settlement | `Settlement amount` (fallback `Transaction amount`) | `Settlement amount currency` |
|
|
14
|
+
| Chargeback | `Dispute amount` | `Dispute amount currency` |
|
|
15
|
+
|
|
16
|
+
Ignore empty `Pre-DCC amount` (often `0` with blank currency). Do not treat BIN
|
|
17
|
+
country as the transaction currency.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
|
|
21
|
+
1. If every used currency field is `USD`, keep native amounts. Write
|
|
22
|
+
`金额均为 USD`. Do **not** call Forex Service and do **not** write
|
|
23
|
+
`未做汇率折算`.
|
|
24
|
+
2. If any row is not USD, convert **that row** to USD before any amount sum,
|
|
25
|
+
share, ticket size, or dual-axis amount chart.
|
|
26
|
+
3. Historical / windowed reports use **daily** conversion, not realtime:
|
|
27
|
+
|
|
28
|
+
`POST {FOREX_BASE_URL}/api/v1/conversions/daily`
|
|
29
|
+
|
|
30
|
+
Body:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"quoteCurrency": "USD",
|
|
35
|
+
"date": "<UTC Rate Date = transaction date in the extract>",
|
|
36
|
+
"items": [{ "currency": "EUR", "amount": "100.00" }]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Prefer one request per Rate Date: either `conversions/daily` for the day's
|
|
41
|
+
distinct currencies, or `POST /api/v1/rates/daily` then multiply locally
|
|
42
|
+
(`converted = native × rate`, decimal strings).
|
|
43
|
+
4. Fail closed if a non-USD row has no daily rate. Do not drop it silently and
|
|
44
|
+
do not mix native EUR with USD in one total.
|
|
45
|
+
5. Auth: `forex:read` bearer token, audience `forex-service`. Base URL default
|
|
46
|
+
`https://forex.1above.io`. Contract: `GET /integration/agent.json`.
|
|
47
|
+
6. Footnote converted reports: Rate Date rule, quote USD, Forex Service daily
|
|
48
|
+
conversion (not realtime). Mark `realtimeFallback` if a current UTC day was
|
|
49
|
+
served as provisional.
|
|
50
|
+
|
|
51
|
+
## Env
|
|
52
|
+
|
|
53
|
+
| Variable | Role |
|
|
54
|
+
|---|---|
|
|
55
|
+
| `FOREX_BASE_URL` | Default `https://forex.1above.io` |
|
|
56
|
+
| `FOREX_TOKEN` | Bearer with scope `forex:read` |
|
|
57
|
+
|
|
58
|
+
Mint the token from Identity (`client_credentials`, audience `forex-service`,
|
|
59
|
+
scope `forex:read`) as in the Forex Service integration guide.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Payment journey (Sankey)
|
|
2
|
+
|
|
3
|
+
The journey is a **count** Sankey across checkpoints. Prefer ECharts (or
|
|
4
|
+
equivalent). Do not mix count and amount on one Sankey.
|
|
5
|
+
|
|
6
|
+
## Checkpoint order
|
|
7
|
+
|
|
8
|
+
```text
|
|
9
|
+
start → risk decision → 3DS → authorization → settlement
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Canonical state transitions
|
|
13
|
+
|
|
14
|
+
Use these edge names when the underlying fields exist:
|
|
15
|
+
|
|
16
|
+
| From | To |
|
|
17
|
+
|---|---|
|
|
18
|
+
| risk decision | accept |
|
|
19
|
+
| risk review | 3DS init |
|
|
20
|
+
| accept | non-3DS authorization |
|
|
21
|
+
| non-3DS authorization | non-3DS authorization approved |
|
|
22
|
+
| non-3DS authorization | non-3DS authorization declined |
|
|
23
|
+
| 3DS init | 3DS challenge |
|
|
24
|
+
| 3DS init | 3DS frictionless |
|
|
25
|
+
| 3DS init | 3DS reject |
|
|
26
|
+
| 3DS challenge | 3DS authenticated |
|
|
27
|
+
| 3DS challenge | 3DS authentication failed |
|
|
28
|
+
| 3DS authenticated | 3DS authorization |
|
|
29
|
+
| 3DS authorization | 3DS authorization approved |
|
|
30
|
+
| 3DS authorization | 3DS authorization declined |
|
|
31
|
+
|
|
32
|
+
Settlement edges (when settlement layer present), from approved authorization
|
|
33
|
+
nodes only:
|
|
34
|
+
|
|
35
|
+
| From | To |
|
|
36
|
+
|---|---|
|
|
37
|
+
| non-3DS / 3DS authorization approved | settled sale |
|
|
38
|
+
| non-3DS / 3DS authorization approved | approved not settled |
|
|
39
|
+
| settled sale | refund (only if Order ID joins cleanly) |
|
|
40
|
+
| settled sale | chargeback fraud / non-fraud (optional) |
|
|
41
|
+
|
|
42
|
+
## Skip unavailable checkpoints
|
|
43
|
+
|
|
44
|
+
If a checkpoint has no usable field in the extract, **omit its nodes and edges**.
|
|
45
|
+
Do not invent risk decisions or 3DS outcomes.
|
|
46
|
+
|
|
47
|
+
Examples:
|
|
48
|
+
|
|
49
|
+
- `Authentication method` / 3DS result all null → skip risk decision, risk
|
|
50
|
+
review, and every 3DS node. Collapse to:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
start → authorization → authorization approved / declined → settlement…
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- Settlement file absent → stop after authorization approved/declined.
|
|
57
|
+
- Refunds with Order IDs that do not join auth approvals → footnote only; do not
|
|
58
|
+
force a refund edge.
|
|
59
|
+
|
|
60
|
+
Caption must list skipped checkpoints.
|
|
61
|
+
|
|
62
|
+
## Mapping hints (when fields exist)
|
|
63
|
+
|
|
64
|
+
| Journey node | Typical source |
|
|
65
|
+
|---|---|
|
|
66
|
+
| risk decision / risk review | gateway risk action, review queue, step-up flag |
|
|
67
|
+
| accept | risk allow / no step-up |
|
|
68
|
+
| 3DS init / challenge / frictionless / reject | 3DS status / ECI / transStatus |
|
|
69
|
+
| 3DS authenticated / failed | challenge result |
|
|
70
|
+
| non-3DS / 3DS authorization approved | auth response = approval |
|
|
71
|
+
| non-3DS / 3DS authorization declined | auth response ≠ approval |
|
|
72
|
+
| settled sale | settlement type = Sale joined on Order ID |
|
|
73
|
+
|
|
74
|
+
## Anti-patterns
|
|
75
|
+
|
|
76
|
+
- Drawing 3DS branches when authentication fields are empty
|
|
77
|
+
- Using amount on the journey Sankey
|
|
78
|
+
- Putting decline-reason fan-out on the journey (keep that in Topics charts)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Metrics and denominators
|
|
2
|
+
|
|
3
|
+
Compute with explicit denominators. Prefer count and amount side by side.
|
|
4
|
+
Amounts are USD per [fx.md](fx.md) before any sum or share.
|
|
5
|
+
|
|
6
|
+
## Authorization
|
|
7
|
+
|
|
8
|
+
| KPI | Formula | Notes |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| Attempts | count of auth rows in window | |
|
|
11
|
+
| Approvals | count where response = approval | |
|
|
12
|
+
| Auth rate | approvals / attempts | Not capture rate |
|
|
13
|
+
| Approved amount | sum(amount \| approval) | USD after [fx.md](fx.md) |
|
|
14
|
+
| Declines | attempts − approvals | Or hard-only if stated |
|
|
15
|
+
| Decline rate | declines / attempts | |
|
|
16
|
+
| Reason share (of declines) | reason_count / declines | Default for mix tables |
|
|
17
|
+
| Reason incidence (of attempts) | reason_count / attempts | Label clearly if used |
|
|
18
|
+
| Country attempt share | country_attempts / attempts | |
|
|
19
|
+
| Country amount share | country_amount / total_amount | Often diverges from attempt share |
|
|
20
|
+
| Country auth rate | country_approvals / country_attempts | Require min-n (e.g. ≥30) for rankings |
|
|
21
|
+
|
|
22
|
+
Trend grains: daily (`Timestamp` date) and weekly (state week rule, e.g. W-SUN).
|
|
23
|
+
|
|
24
|
+
Card product: `Payment method` × `Card type` when both exist.
|
|
25
|
+
|
|
26
|
+
## Settlement
|
|
27
|
+
|
|
28
|
+
| KPI | Formula | Notes |
|
|
29
|
+
|---|---|---|
|
|
30
|
+
| Sale count / amount | Settlement type = Sale | |
|
|
31
|
+
| Refund count / amount | Settlement type = Refund | Show sign or absolute + label |
|
|
32
|
+
| Net settled amount | sales + refunds (refunds negative) | |
|
|
33
|
+
| Refund rate (count) | refunds / sales | |
|
|
34
|
+
| Refund rate (amount) | abs(refund amount) / sale amount | |
|
|
35
|
+
| Status mix | by Settlement status | |
|
|
36
|
+
|
|
37
|
+
Do not equalize settled sales to approved auth amount without a timing caveat.
|
|
38
|
+
|
|
39
|
+
## Chargebacks
|
|
40
|
+
|
|
41
|
+
Monthly **拒付率** by brand is [chargebacks.md](chargebacks.md): Visa
|
|
42
|
+
same-month sales, Mastercard previous-month sales, skip empty brand-months,
|
|
43
|
+
no blended Visa+Mastercard ratio. The table below is mix / match, not that
|
|
44
|
+
programme rate.
|
|
45
|
+
|
|
46
|
+
| KPI | Formula | Notes |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| CB count / dispute amount | as filed | Amounts USD after [fx.md](fx.md); use abs for magnitude if signed |
|
|
49
|
+
| Reason mix | by Reason category / code | Fraud ≠ all CBs |
|
|
50
|
+
| Match rate to auths | matched / CB rows | State join key |
|
|
51
|
+
| Visa monthly 拒付率 | CB_Visa(M) / Sales_Visa(M) | Received month; not VAMP unless TC40 in file |
|
|
52
|
+
| Mastercard monthly 拒付率 | CB_MC(M) / Sales_MC(M−1) | Skip M if M−1 sales missing |
|
|
53
|
+
|
|
54
|
+
Lag: chargeback date is later than original auth. Programme rates use
|
|
55
|
+
**received** month, not origination vintage.
|
|
56
|
+
|
|
57
|
+
## Ranking and “Other”
|
|
58
|
+
|
|
59
|
+
- Rank countries by attempts unless the user asks for amount.
|
|
60
|
+
- Roll the long tail into `Other` after top 10–15; show Other share.
|
|
61
|
+
- For decline-by-country matrices, use top countries by attempts and top reasons
|
|
62
|
+
globally; collapse remaining reasons to `Other declines`.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Report template
|
|
2
|
+
|
|
3
|
+
Save:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
reports/payment-analysis/<scope>_overview.md
|
|
7
|
+
reports/payment-analysis/<scope>_overview.zh.md
|
|
8
|
+
reports/payment-analysis/<scope>_overview.zh.html # preferred when charts
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Follow [visualization.md](visualization.md), [journey.md](journey.md),
|
|
12
|
+
[terminology.md](terminology.md), and [fx.md](fx.md) for amount currency. Omit
|
|
13
|
+
topic sections whose layer is missing.
|
|
14
|
+
No Markdown bold in report body. After writing, grep banned strings in
|
|
15
|
+
terminology.md.
|
|
16
|
+
|
|
17
|
+
## Required structure
|
|
18
|
+
|
|
19
|
+
English Markdown headings on the left; Chinese HTML / `.zh.md` on the right.
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
# Payment Overview — <window> # 支付业务概览 — <window>
|
|
23
|
+
|
|
24
|
+
## 1. Executive summary # 1. 执行摘要
|
|
25
|
+
## 2. Top statistics # 2. 核心指标
|
|
26
|
+
## 3. Payment journey (Sankey) # 3. 支付旅程(Sankey)
|
|
27
|
+
## 4. Topics # 4. 专题
|
|
28
|
+
### 4.1 Overall transaction volume # 4.1 整体交易量
|
|
29
|
+
### 4.2 Week-on-week trend # 4.2 周趋势
|
|
30
|
+
### 4.3 Authorization rate # 4.3 授权成功率
|
|
31
|
+
### 4.4 Contribution by BIN country # 4.4 BIN 国家贡献
|
|
32
|
+
### 4.5 Decline by reason code # 4.5 授权拒绝原因贡献
|
|
33
|
+
### 4.6 Decline by BIN country # 4.6 各国授权拒绝结构
|
|
34
|
+
### 4.7 Settlements (when present) # 4.7 清算
|
|
35
|
+
### 4.8 Chargebacks (optional) # 4.8 拒付
|
|
36
|
+
## 5. Operational impact # 5. 运营影响
|
|
37
|
+
## 6. Appendix # 6. 附录
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
HTML uses the Chinese headings. KPI labels, legends, and Sankey node names use
|
|
41
|
+
the glossary in terminology.md (`授权尝试`, `授权成功`, `授权拒绝`,
|
|
42
|
+
`发卡行国家`, `差错`, `产品服务质量`, `Do not honor`).
|
|
43
|
+
|
|
44
|
+
## Chapter requirements
|
|
45
|
+
|
|
46
|
+
### 1. Executive summary / 执行摘要
|
|
47
|
+
|
|
48
|
+
≤5 numbered findings: volume, trend, auth rate, country concentration, main
|
|
49
|
+
decline or settlement/CB driver.
|
|
50
|
+
|
|
51
|
+
### 2. Top statistics / 核心指标
|
|
52
|
+
|
|
53
|
+
KPI cards / table from auth + settlement: attempts, approvals, auth rate,
|
|
54
|
+
attempt amount, approved amount, sale count/amount, refund count/amount, net
|
|
55
|
+
settled, distinct PAN/BIN/countries, portfolio constants (MID, MCC, provider).
|
|
56
|
+
|
|
57
|
+
Chinese labels: 授权尝试, 授权成功, 授权成功率, 授权成功金额, 清算销售, 退款,
|
|
58
|
+
净清算, 发卡行国家.
|
|
59
|
+
|
|
60
|
+
### 3. Payment journey (Sankey) / 支付旅程
|
|
61
|
+
|
|
62
|
+
Count Sankey per [journey.md](journey.md). Caption lists skipped checkpoints
|
|
63
|
+
(e.g. risk decision / 3DS when authentication fields are empty).
|
|
64
|
+
|
|
65
|
+
Collapsed nodes when 3DS/risk are absent:
|
|
66
|
+
|
|
67
|
+
`开始 → 授权 → 授权成功 / 授权拒绝 → 已清算销售 / 授权成功未清算`
|
|
68
|
+
|
|
69
|
+
### 4. Topics / 专题
|
|
70
|
+
|
|
71
|
+
Each topic: short lede + chart(s) + supporting table.
|
|
72
|
+
|
|
73
|
+
| Topic | Minimum viz |
|
|
74
|
+
|---|---|
|
|
75
|
+
| 4.1 Volume | count + amount bars (dual axis) |
|
|
76
|
+
| 4.2 WoW trend | weekly count + amount bars; auth-rate line |
|
|
77
|
+
| 4.3 Auth rate | rate line by day and/or segment |
|
|
78
|
+
| 4.4 BIN country | count + amount bars dual axis; rate line |
|
|
79
|
+
| 4.5 Decline reason | count bars |
|
|
80
|
+
| 4.6 Decline by country | stacked count bars |
|
|
81
|
+
| 4.7 Settlements | sale/refund amount bars; country contribution dual axis |
|
|
82
|
+
| 4.8 Chargebacks | reason-category bars; Visa / Mastercard monthly 拒付率 line per [chargebacks.md](chargebacks.md) (note under the rate chart; skip empty brand-months) |
|
|
83
|
+
|
|
84
|
+
Use both authorization and settlement data when both files are present.
|
|
85
|
+
|
|
86
|
+
### 5. Operational impact / 运营影响
|
|
87
|
+
|
|
88
|
+
Numbered operational takeaways. Do not title this 运营含义. Do not invent
|
|
89
|
+
supervised fraud rules. Choose from
|
|
90
|
+
[auth-rate-actions.md](auth-rate-actions.md) only when the extract supports
|
|
91
|
+
the trigger (SCA → 3DS; high 疑似欺诈 country → 风控拦截 or 3DS; 软性拒绝 →
|
|
92
|
+
retry).
|
|
93
|
+
|
|
94
|
+
### 6. Appendix / 附录
|
|
95
|
+
|
|
96
|
+
Definitions (from terminology.md) and caveats (FX per [fx.md](fx.md),
|
|
97
|
+
issuer country ≠ ship-to, auth rate ≠ capture, journey skips,
|
|
98
|
+
chargeback rates are network-style estimates).
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Terminology
|
|
2
|
+
|
|
3
|
+
Use these terms consistently in payment-analysis reports. Read this file before
|
|
4
|
+
writing English or Chinese copy. After writing, run the proofread step in
|
|
5
|
+
`SKILL.md`.
|
|
6
|
+
|
|
7
|
+
## Canonical glossary
|
|
8
|
+
|
|
9
|
+
| English | Chinese | Do not write |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Attempt | 授权尝试 | 单独的「尝试」;交易;conversion |
|
|
12
|
+
| Approval | 授权成功 | 批准;成功(易与清算混淆) |
|
|
13
|
+
| Auth rate | 授权成功率 | 转化率;单独的「成功率」(首次出现时) |
|
|
14
|
+
| Decline | 授权拒绝 | 全部叫欺诈 |
|
|
15
|
+
| Hard / soft / reject | 硬性拒绝 / 软性拒绝 / 风控拦截 | hard 拦截(指拒绝类型时) |
|
|
16
|
+
| Reason / reason code | 拒绝原因 / 原因码 | |
|
|
17
|
+
| Insufficient funds | 余额不足 | 余额 |
|
|
18
|
+
| Suspected fraud | 疑似欺诈 | 已确认欺诈;正文里写 D102(表内 Pazien 代码可保留) |
|
|
19
|
+
| Invalid expiration date | 有效期无效 | |
|
|
20
|
+
| Security code invalid | 安全码无效 | |
|
|
21
|
+
| Policy reasons | 政策原因 | |
|
|
22
|
+
| Do not honor | Do not honor | 拒绝承兑 |
|
|
23
|
+
| BIN / IIN | BIN / IIN | |
|
|
24
|
+
| BIN country | 发卡行国家 / BIN 国家 | 客户国家;收货国;发卡国 |
|
|
25
|
+
| Settlement | 清算 | |
|
|
26
|
+
| Sale / Refund | 销售 / 退款 | 把销售金额写成清算金额 |
|
|
27
|
+
| Chargeback / dispute | 拒付 / 争议 | 与清算混用 |
|
|
28
|
+
| Clerical | 差错 | 文书;文书错误 |
|
|
29
|
+
| Quality | 产品服务质量 | 质量;质量争议 |
|
|
30
|
+
| Incidence | 发生率(必须写出分母) | |
|
|
31
|
+
| GMV (loose) | 销售金额合计(说明是否含退款) | |
|
|
32
|
+
| Week-on-week trend | 周趋势 | 周环比(除非单元格是环比百分比) |
|
|
33
|
+
| Operational impact | 运营影响 | 运营含义 |
|
|
34
|
+
| Ticket size | 客单价 | |
|
|
35
|
+
| Debit / credit | 借记卡 / 贷记卡 | 借记;贷记 |
|
|
36
|
+
| Payment journey | 支付旅程 | 支付旅程 Sankey;Sankey 旅程(标题/结构行) |
|
|
37
|
+
| This analysis window | 当前分析时段内 | 本窗口 |
|
|
38
|
+
| SCA | SCA | 强客户认证(可在首次括注后只用 SCA) |
|
|
39
|
+
| Authentication / 3DS | 鉴权 / 认证 / 3DS | 把 3DS 叫转化 |
|
|
40
|
+
| Visa / Mastercard 拒付率 | Visa / Mastercard 拒付率 | VAMP ratio(无 TC40 时);ECM(从本抽取断言商户在项目中) |
|
|
41
|
+
| Amounts in USD | 金额均为 USD | 未做汇率折算(当全部已是 USD) |
|
|
42
|
+
| Count-heavy / amount-light | 授权尝试笔数多但金额小 | 走廊;笔数负担型走廊 |
|
|
43
|
+
|
|
44
|
+
Keep proper nouns in source form when useful: Visa, MasterCard, BIN, 3DS,
|
|
45
|
+
Sankey (in chart captions only), Order ID, MCC, Worldpay, Pazien, MID.
|
|
46
|
+
Do not use Pazien codes (e.g. D102) in prose; use 疑似欺诈 / suspected fraud.
|
|
47
|
+
Tables may still show the code column.
|
|
48
|
+
|
|
49
|
+
## Axis and UI exceptions
|
|
50
|
+
|
|
51
|
+
- Rate axis may say `成功率 %` if the legend or lede already says 授权成功率.
|
|
52
|
+
Amount axes still use the full metric plus currency
|
|
53
|
+
([visualization.md](visualization.md)).
|
|
54
|
+
- Week-over-week *percentage* columns may say 笔数周环比 / 金额周环比.
|
|
55
|
+
- Product rankings that exclude tiny samples: write
|
|
56
|
+
`在授权尝试超过 50 笔的卡种里` (or the n actually used), never
|
|
57
|
+
`有规模的最弱卡种` or `弱卡种`.
|
|
58
|
+
- If every amount is USD, write `金额均为 USD`. Do not add `未做汇率折算`.
|
|
59
|
+
Only mention missing FX conversion when mixed currencies were actually summed
|
|
60
|
+
or dropped.
|
|
61
|
+
- Chart amount fields append the currency: `授权拒绝金额 USD`.
|
|
62
|
+
- HTML footer: data-source filenames only. No skill name, no Chart.js / ECharts.
|
|
63
|
+
- Do not call issuer country “customer country”.
|
|
64
|
+
- Do not call auth rate “conversion” unless contrasting checkout vs issuer
|
|
65
|
+
response, and then say so.
|
|
66
|
+
|
|
67
|
+
## Banned strings (grep after writing)
|
|
68
|
+
|
|
69
|
+
Chinese: `走廊`, `杠杆`, `弱转化`, `转化率`, `赋能`, `抓手`, `闭环`, `打法`,
|
|
70
|
+
`运营含义`, `本窗口`, `弱卡种`, `有规模的最弱`, `强客户认证`, `拒绝承兑`,
|
|
71
|
+
`文书错误`, `质量争议`, `发卡国`
|
|
72
|
+
|
|
73
|
+
English: `auth drag`, `conversion problem`, `count-heavy`, `amount-light`,
|
|
74
|
+
`Protect US amount`, `Unlike currencies`
|
|
75
|
+
|
|
76
|
+
If a hit is a legitimate exception (e.g. 周环比 as a table header for WoW %,
|
|
77
|
+
or D102 in a reason-code table), leave it and do not expand the ban.
|
|
78
|
+
|
|
79
|
+
## Proofread
|
|
80
|
+
|
|
81
|
+
1. Apply the glossary to headings, KPI labels, chart legends, Sankey skip
|
|
82
|
+
chips, and body copy.
|
|
83
|
+
2. Grep the report files for the banned strings.
|
|
84
|
+
3. Replace hits using this table. Do not change numbers, formulas, or file
|
|
85
|
+
paths.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Visualization rules
|
|
2
|
+
|
|
3
|
+
Preferred deliverable: self-contained HTML with Chart.js (KPI charts) and
|
|
4
|
+
ECharts (Sankey). Markdown tables remain required beside charts.
|
|
5
|
+
|
|
6
|
+
## Mark encoding
|
|
7
|
+
|
|
8
|
+
| Metric kind | Chart mark | Notes |
|
|
9
|
+
|---|---|---|
|
|
10
|
+
| Count | Bar | Vertical or horizontal |
|
|
11
|
+
| Amount | Bar | Never encode amount as a line |
|
|
12
|
+
| Rate | Line | Percent on its own axis |
|
|
13
|
+
|
|
14
|
+
## Multi-metric charts
|
|
15
|
+
|
|
16
|
+
1. Count and amount in the same chart → both are **bars** on **different axes**
|
|
17
|
+
(left = count, right = amount).
|
|
18
|
+
2. Rate with count and/or amount → rate is a **line** on a dedicated % axis.
|
|
19
|
+
3. Rate alone → line chart (points allowed). No bars for a lone rate series.
|
|
20
|
+
4. Composition of one total → doughnut or stacked bars; not for time trends.
|
|
21
|
+
|
|
22
|
+
## Axis hygiene
|
|
23
|
+
|
|
24
|
+
- Label every axis with the full metric name. Amount axes/legends include
|
|
25
|
+
currency (`授权尝试金额 USD`, `授权拒绝金额 USD`, `清算销售金额 USD`,
|
|
26
|
+
`拒付金额 USD`). Do not use bare `笔数` / `金额` / `%`.
|
|
27
|
+
- Only one axis draws the main grid on dual-axis charts.
|
|
28
|
+
- Stacked bars = mix within a group (e.g. decline reasons by country), never rate.
|
|
29
|
+
- Sort categories by a stated order (usually attempts desc).
|
|
30
|
+
|
|
31
|
+
## Required charts (HTML)
|
|
32
|
+
|
|
33
|
+
1. Payment journey Sankey — see [journey.md](journey.md)
|
|
34
|
+
2. Volume trend (WoW / daily): count bar + amount bar (dual axis) + auth-rate line
|
|
35
|
+
3. Authorization rate by segment (card product and/or country): rate as line
|
|
36
|
+
4. BIN-country contribution: count bar + amount bar (dual axis)
|
|
37
|
+
5. Decline by reason: count bars (+ amount bars/dual axis if shown)
|
|
38
|
+
6. Decline mix by BIN country: stacked count bars
|
|
39
|
+
|
|
40
|
+
## Anti-patterns
|
|
41
|
+
|
|
42
|
+
- Line for amount or count
|
|
43
|
+
- Bar for a standalone rate series
|
|
44
|
+
- Count and amount on one axis without dual-axis scaling
|
|
45
|
+
- Mixing native EUR (etc.) with USD in one amount series; convert first ([fx.md](fx.md))
|
|
46
|
+
- Plotting a 0% chargeback-rate point for a brand-month with no CBs ([chargebacks.md](chargebacks.md))
|
|
47
|
+
- Inventing Sankey checkpoints not present in the data
|