@curless/hotel-storefront 0.39.0 → 0.40.0
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/dist/backend.d.ts +18 -5
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js.map +1 -1
- package/dist/card.generated.d.ts +1 -1
- package/dist/card.generated.js +2 -2
- package/dist/card.generated.js.map +1 -1
- package/dist/huazhu/backend.d.ts.map +1 -1
- package/dist/huazhu/backend.js +730 -264
- package/dist/huazhu/backend.js.map +1 -1
- package/dist/huazhu/bookings.d.ts +39 -0
- package/dist/huazhu/bookings.d.ts.map +1 -1
- package/dist/huazhu/bookings.js +17 -1
- package/dist/huazhu/bookings.js.map +1 -1
- package/dist/huazhu/catalog.d.ts +9 -1
- package/dist/huazhu/catalog.d.ts.map +1 -1
- package/dist/huazhu/catalog.js +12 -3
- package/dist/huazhu/catalog.js.map +1 -1
- package/dist/huazhu/client.js +1 -1
- package/dist/huazhu/client.js.map +1 -1
- package/dist/huazhu/english.d.ts.map +1 -1
- package/dist/huazhu/english.js +5 -2
- package/dist/huazhu/english.js.map +1 -1
- package/dist/huazhu/fake.d.ts +3 -1
- package/dist/huazhu/fake.d.ts.map +1 -1
- package/dist/huazhu/fake.js +19 -1
- package/dist/huazhu/fake.js.map +1 -1
- package/dist/huazhu/labels.d.ts.map +1 -1
- package/dist/huazhu/labels.js +17 -0
- package/dist/huazhu/labels.js.map +1 -1
- package/dist/huazhu/make.d.ts.map +1 -1
- package/dist/huazhu/make.js +31 -7
- package/dist/huazhu/make.js.map +1 -1
- package/dist/huazhu/sellable.d.ts +3 -1
- package/dist/huazhu/sellable.d.ts.map +1 -1
- package/dist/huazhu/sellable.js +14 -4
- package/dist/huazhu/sellable.js.map +1 -1
- package/dist/legal.d.ts.map +1 -1
- package/dist/legal.js +30 -7
- package/dist/legal.js.map +1 -1
- package/dist/paid.d.ts.map +1 -1
- package/dist/paid.js +68 -34
- package/dist/paid.js.map +1 -1
- package/dist/payments/checkout.d.ts +15 -2
- package/dist/payments/checkout.d.ts.map +1 -1
- package/dist/payments/checkout.js +4 -1
- package/dist/payments/checkout.js.map +1 -1
- package/dist/payments/fake-stripe.d.ts +1 -0
- package/dist/payments/fake-stripe.d.ts.map +1 -1
- package/dist/payments/fake-stripe.js +20 -4
- package/dist/payments/fake-stripe.js.map +1 -1
- package/dist/payments/fake-unionpay.d.ts +3 -0
- package/dist/payments/fake-unionpay.d.ts.map +1 -1
- package/dist/payments/fake-unionpay.js +20 -2
- package/dist/payments/fake-unionpay.js.map +1 -1
- package/dist/payments/stripe-checkout.d.ts +2 -1
- package/dist/payments/stripe-checkout.d.ts.map +1 -1
- package/dist/payments/stripe-checkout.js +11 -4
- package/dist/payments/stripe-checkout.js.map +1 -1
- package/dist/payments/unionpay.d.ts +12 -1
- package/dist/payments/unionpay.d.ts.map +1 -1
- package/dist/payments/unionpay.js +10 -3
- package/dist/payments/unionpay.js.map +1 -1
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +129 -24
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -57,6 +57,13 @@ export interface UnionPayHandoff {
|
|
|
57
57
|
* it cannot be read. ⚠️ The caller hands it on and drops it.
|
|
58
58
|
*/
|
|
59
59
|
card(sessionId: string): Promise<OneTimeCard | undefined>;
|
|
60
|
+
/**
|
|
61
|
+
* The booking will never use this payment's one-time card: the gateway
|
|
62
|
+
* throws it away now, or refuses it when it comes (网关 a974cc2a,
|
|
63
|
+
* 2026-10-16 audit P1-6). `released`: it was handed over already - to a
|
|
64
|
+
* step here that may have booked it.
|
|
65
|
+
*/
|
|
66
|
+
discard(sessionId: string): Promise<'discarded' | 'not-issued-yet' | 'released'>;
|
|
60
67
|
/** Stops a confirmation nobody finished; one already issued answers `issued`. */
|
|
61
68
|
close(sessionId: string): Promise<UnionPayState>;
|
|
62
69
|
}
|
|
@@ -87,7 +94,10 @@ export type GatewayUnionPayOptions = {
|
|
|
87
94
|
/**
|
|
88
95
|
* The guest, as UnionPay files their cards: a merchant member keyed by their
|
|
89
96
|
* email (robin, 2026-10-15: no Huazhu member sign-in yet - the email until
|
|
90
|
-
* there is one). Hashed, so the
|
|
97
|
+
* there is one). Hashed, so the address is not stored at the gateway as it
|
|
98
|
+
* is - ⚠️ but not salted: anyone with a list of addresses can work out which
|
|
99
|
+
* one a reference is (2026-10-16 audit, P2). Salting it now would orphan
|
|
100
|
+
* every card already bound; a member sign-in replaces it.
|
|
91
101
|
*/
|
|
92
102
|
export declare const memberRefOf: (email: string) => string;
|
|
93
103
|
export declare class GatewayUnionPay implements UnionPayHandoff {
|
|
@@ -120,6 +130,7 @@ export declare class GatewayUnionPay implements UnionPayHandoff {
|
|
|
120
130
|
* - 403: a live key - thrown; the gateway takes test keys only.
|
|
121
131
|
*/
|
|
122
132
|
card(sessionId: string): Promise<OneTimeCard | undefined>;
|
|
133
|
+
discard(sessionId: string): Promise<'discarded' | 'not-issued-yet' | 'released'>;
|
|
123
134
|
/**
|
|
124
135
|
* A payment handed to UnionPay cannot be cancelled at the gateway - and need
|
|
125
136
|
* not be: nothing is charged unless its card is handed on, which a lapsed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unionpay.d.ts","sourceRoot":"","sources":["../../src/payments/unionpay.ts"],"names":[],"mappings":"AAoBA,qEAAqE;AACrE,MAAM,MAAM,WAAW,GAAG;IACxB,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;CAIjB,CAAC;AAEF,4CAA4C;AAC5C,MAAM,MAAM,aAAa;AACvB,qDAAqD;AACnD,MAAM;AACR,sEAAsE;GACpE,QAAQ;AACV,4EAA4E;GAC1E,QAAQ,CAAC;AAEb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AAW,GAAG,SAAS,CAAC;IAuBzD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,gBAAgB,GAAG,UAAU,CAAC;IAQtF;;;;OAIG;IACG,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAGvD"}
|
|
@@ -31,7 +31,10 @@ export const expiryMMyy = (c) => `${c.expMonth.padStart(2, '0').slice(-2)}${c.ex
|
|
|
31
31
|
/**
|
|
32
32
|
* The guest, as UnionPay files their cards: a merchant member keyed by their
|
|
33
33
|
* email (robin, 2026-10-15: no Huazhu member sign-in yet - the email until
|
|
34
|
-
* there is one). Hashed, so the
|
|
34
|
+
* there is one). Hashed, so the address is not stored at the gateway as it
|
|
35
|
+
* is - ⚠️ but not salted: anyone with a list of addresses can work out which
|
|
36
|
+
* one a reference is (2026-10-16 audit, P2). Salting it now would orphan
|
|
37
|
+
* every card already bound; a member sign-in replaces it.
|
|
35
38
|
*/
|
|
36
39
|
export const memberRefOf = (email) => `hz-${createHash('sha256').update(email.trim().toLowerCase()).digest('hex').slice(0, 40)}`;
|
|
37
40
|
/** UnionPay shows ASCII only - anything else is dropped by the gateway anyway. */
|
|
@@ -72,10 +75,10 @@ export class GatewayUnionPay {
|
|
|
72
75
|
if (!res.ok) {
|
|
73
76
|
// Its own message, never the request - and never a card: a key rides in
|
|
74
77
|
// a header, and a one-time card only ever in an answer we read once.
|
|
75
|
-
let said = text.slice(0, 300).replace(/\d{
|
|
78
|
+
let said = text.slice(0, 300).replace(/\d(?:[ -]?\d){11,18}/g, '****');
|
|
76
79
|
try {
|
|
77
80
|
const j = JSON.parse(text);
|
|
78
|
-
said = (j.error?.message ?? said).replace(/\d{
|
|
81
|
+
said = (j.error?.message ?? said).replace(/\d(?:[ -]?\d){11,18}/g, '****');
|
|
79
82
|
}
|
|
80
83
|
catch { }
|
|
81
84
|
throw new UnionPayError(`the gateway answered ${res.status}: ${said}`, res.status);
|
|
@@ -184,6 +187,10 @@ export class GatewayUnionPay {
|
|
|
184
187
|
expYear: String(r.expYear).length === 2 ? `20${r.expYear}` : String(r.expYear),
|
|
185
188
|
};
|
|
186
189
|
}
|
|
190
|
+
async discard(sessionId) {
|
|
191
|
+
const r = await this.call('DELETE', `/v1/merchant/${encodeURIComponent(this.opts.merchantId)}/payment-intents/${encodeURIComponent(sessionId)}/uaag/credential`);
|
|
192
|
+
return r.state === 'released' || r.state === 'not-issued-yet' ? r.state : 'discarded';
|
|
193
|
+
}
|
|
187
194
|
/**
|
|
188
195
|
* A payment handed to UnionPay cannot be cancelled at the gateway - and need
|
|
189
196
|
* not be: nothing is charged unless its card is handed on, which a lapsed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unionpay.js","sourceRoot":"","sources":["../../src/payments/unionpay.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,gDAAgD;AAChD,kEAAkE;AAClE,2EAA2E;AAC3E,2EAA2E;AAC3E,uEAAuE;AACvE,mBAAmB;AACnB,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AACrE,+EAA+E;AAC/E,8EAA8E;AAC9E,oEAAoE;AACpE,EAAE;AACF,0EAA0E;AAC1E,qBAAqB;AAErB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AA+B7F,MAAM,OAAO,aAAc,SAAQ,KAAK;IAG3B;IAFX,YACE,OAAe,EACN,MAAe;QAExB,KAAK,CAAC,OAAO,CAAC,CAAC;QAFN,WAAM,GAAN,MAAM,CAAS;QAGxB,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"unionpay.js","sourceRoot":"","sources":["../../src/payments/unionpay.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,gDAAgD;AAChD,kEAAkE;AAClE,2EAA2E;AAC3E,2EAA2E;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QACD,IAAI,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,OAAO;YACjF,OAAO,SAAS,CAAC;QACnB,kEAAkE;QAClE,OAAO;YACL,MAAM,EAAE,CAAC,CAAC,UAAU;YACpB,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;YAC7C,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;SAC/E,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,SAAiB;QAC7B,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CACvB,QAAQ,EACR,gBAAgB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,oBAAoB,kBAAkB,CAAC,SAAS,CAAC,kBAAkB,CAC5H,CAAC;QACF,OAAO,CAAC,CAAC,KAAK,KAAK,UAAU,IAAI,CAAC,CAAC,KAAK,KAAK,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAK,CAAC,SAAiB;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;CACF"}
|
package/dist/server.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const INITIALIZE_PER_MINUTE = 300;
|
|
|
28
28
|
* number. Found by reading the boot banner of a container that had just been
|
|
29
29
|
* deployed (2026-09-22): seventeen tools listed, and "0.7.0" above them.
|
|
30
30
|
*/
|
|
31
|
-
export declare const VERSION = "0.
|
|
31
|
+
export declare const VERSION = "0.40.0";
|
|
32
32
|
/**
|
|
33
33
|
* The card's resource URI.
|
|
34
34
|
*
|
|
@@ -37,7 +37,7 @@ export declare const VERSION = "0.39.0";
|
|
|
37
37
|
* connector went storefront-v35 → v40 in a single day of UI work for exactly
|
|
38
38
|
* this reason.
|
|
39
39
|
*/
|
|
40
|
-
export declare const CARD_URI = "ui://curless/hotel/booking-
|
|
40
|
+
export declare const CARD_URI = "ui://curless/hotel/booking-v79.html";
|
|
41
41
|
/**
|
|
42
42
|
* The URI one deployment names its card by: `CARD_URI` with a short hash of
|
|
43
43
|
* everything a host caches under it - the card itself, and the hosts it may
|
package/dist/server.js
CHANGED
|
@@ -47,7 +47,7 @@ export const INITIALIZE_PER_MINUTE = 300;
|
|
|
47
47
|
* number. Found by reading the boot banner of a container that had just been
|
|
48
48
|
* deployed (2026-09-22): seventeen tools listed, and "0.7.0" above them.
|
|
49
49
|
*/
|
|
50
|
-
export const VERSION = '0.
|
|
50
|
+
export const VERSION = '0.40.0';
|
|
51
51
|
/**
|
|
52
52
|
* The card's resource URI.
|
|
53
53
|
*
|
|
@@ -56,7 +56,7 @@ export const VERSION = '0.39.0';
|
|
|
56
56
|
* connector went storefront-v35 → v40 in a single day of UI work for exactly
|
|
57
57
|
* this reason.
|
|
58
58
|
*/
|
|
59
|
-
export const CARD_URI = 'ui://curless/hotel/booking-
|
|
59
|
+
export const CARD_URI = 'ui://curless/hotel/booking-v79.html';
|
|
60
60
|
/** The card as it ships, hashed once - what a host caches under the URI. */
|
|
61
61
|
const CARD_HTML_SHA = createHash('sha256').update(HOTEL_CARD_HTML).digest('hex');
|
|
62
62
|
/**
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EASzB,MAAM,cAA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AAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,4FAA4F;IAC5F,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA2vCF;;;;GAIG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC;AAyJjC;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,GAAI,MAAM,QAAQ,KAAG,UAOzC,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,MAAM,QAAQ,EACd,MAAM,MAAM,EACZ,SAAS,OAAO,EAChB,KAAK,WAAW,KACf,OAAO,CAAC,UAAU,CAkBpB,CAAC"}
|
package/dist/tools.js
CHANGED
|
@@ -1405,34 +1405,94 @@ const bookingForCard = (b) => ({
|
|
|
1405
1405
|
...(b.payment ? { payment: { ...b.payment, amount: formatMoney(b.payment.amount) } } : {}),
|
|
1406
1406
|
});
|
|
1407
1407
|
/**
|
|
1408
|
-
* A booking paid
|
|
1409
|
-
*
|
|
1408
|
+
* A booking paid in advance, as the guest is told it - where its money stands.
|
|
1409
|
+
* Undefined for any other booking.
|
|
1410
|
+
*
|
|
1411
|
+
* ⚠️ THE BOOKING FIRST, THEN THE MONEY (2026-10-16 audit, P0-C). This read the
|
|
1412
|
+
* payment alone, so a stay cancelled after its free time - whose fee is all of
|
|
1413
|
+
* it, and nothing goes back - was told "the hotel has not confirmed it; if it
|
|
1414
|
+
* does not take it, all of it goes back", every time; and a UnionPay stay
|
|
1415
|
+
* cancelled was told "cancelled. undefined". Each state of each way of paying
|
|
1416
|
+
* is said here, and a cancelled stay by what the cancellation kept (`fee`,
|
|
1417
|
+
* the hotel's own figure where it gave one).
|
|
1410
1418
|
*/
|
|
1411
|
-
const paidLine = (deps, b) => {
|
|
1419
|
+
const paidLine = (deps, b, fee) => {
|
|
1412
1420
|
const p = b.payment;
|
|
1413
1421
|
if (!p)
|
|
1414
1422
|
return undefined;
|
|
1415
1423
|
const h = holderOf(deps, b.supplier);
|
|
1416
1424
|
const amount = formatMoney(p.amount);
|
|
1425
|
+
const back = formatMoney(p.refundAmount ?? p.amount);
|
|
1426
|
+
const whole = !p.refundAmount || p.refundAmount.minor === p.amount.minor;
|
|
1427
|
+
const unionpay = p.method === 'unionpay';
|
|
1417
1428
|
const test = h.sandbox
|
|
1418
|
-
?
|
|
1429
|
+
? ` This is a test: ${unionpay ? "UnionPay's test system" : 'the card page in test mode'}, no real money moves, and the booking is in the simulated system.`
|
|
1419
1430
|
: h.test
|
|
1420
|
-
? ` This is a test: the card page
|
|
1431
|
+
? ` This is a test: ${unionpay ? "UnionPay's test system" : 'the card page in test mode'}, no real money moves, and the booking is a test booking in ${h.name}'s test system.`
|
|
1421
1432
|
: '';
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
:
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1433
|
+
const ended = b.status === 'cancelled' || b.status === 'expired' || b.status === 'failed';
|
|
1434
|
+
const said = (() => {
|
|
1435
|
+
// Its money as it stands once the stay has ended - never "if it does not take it".
|
|
1436
|
+
if (ended) {
|
|
1437
|
+
switch (p.status) {
|
|
1438
|
+
case 'awaiting':
|
|
1439
|
+
case 'lapsed':
|
|
1440
|
+
return unionpay
|
|
1441
|
+
? 'Not booked: the one-time card UnionPay issued for it was not charged, and nothing was paid.'
|
|
1442
|
+
: 'Not paid: nothing was booked and nothing was charged.';
|
|
1443
|
+
case 'issued':
|
|
1444
|
+
return `UnionPay had confirmed it; anything ${h.name} charged to the one-time card is ${h.name}'s to return, under its terms.`;
|
|
1445
|
+
case 'paid': {
|
|
1446
|
+
// Paid, cancelled, and nothing going back yet: the fee took all of
|
|
1447
|
+
// it - or a part, or the hotel cancelled late, which a person here
|
|
1448
|
+
// settles (华住, 2026-10-16: `attention`). Never "all of it" unless so.
|
|
1449
|
+
const kept = fee ?? b.cancellationFee;
|
|
1450
|
+
if (kept && kept.minor >= p.amount.minor)
|
|
1451
|
+
return `The cancellation fee ${h.name} charges, ${formatMoney(kept)}, is the whole ${amount} paid${unionpay ? ' with UnionPay' : ''}, so nothing goes back.`;
|
|
1452
|
+
return kept && kept.minor > 0
|
|
1453
|
+
? `${h.name}'s cancellation fee is ${formatMoney(kept)} of the ${amount} paid; what is due back of the rest, a person here is settling.`
|
|
1454
|
+
: `What of the ${amount} paid comes back depends on ${h.name}'s cancellation fee, which a person here is confirming.`;
|
|
1455
|
+
}
|
|
1456
|
+
case 'refunding':
|
|
1457
|
+
return p.refundStuck
|
|
1458
|
+
? `${back} is due back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}. Sending it back did not go through, and a person is seeing to it.`
|
|
1459
|
+
: `${whole ? `All ${back}` : `${back} of the ${amount} paid`} is going back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}.`;
|
|
1460
|
+
case 'refunded':
|
|
1461
|
+
return `${whole ? `All ${back}` : `${back} of the ${amount} paid`} has gone back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}.`;
|
|
1462
|
+
case 'hotel-refunds':
|
|
1463
|
+
return `The money is with ${h.name}, who charged the one-time card UnionPay issued: what its terms give back${fee && fee.minor > 0 ? ` after its fee of ${formatMoney(fee)}` : ''}, it returns to that card - not this connector${p.refundReason ? ` (${p.refundReason})` : ''}.`;
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
switch (p.status) {
|
|
1467
|
+
case 'awaiting':
|
|
1468
|
+
// ⚠️ NOT "nothing paid": the card page may have been paid a moment ago
|
|
1469
|
+
// and not read yet (audit, P0-D) - what is said is what is to be done.
|
|
1470
|
+
return unionpay
|
|
1471
|
+
? `**Not booked yet.** ${amount} is to be confirmed on UnionPay's page by ${p.payByLocal ?? p.payBy} hotel time${p.url ? `: ${p.url}` : ''}. Once UnionPay issues its one-time card, the stay is booked with ${h.name}, who charges that card; not confirmed by then, nothing is booked or charged.`
|
|
1472
|
+
: `**Not booked yet.** ${amount} is to be paid on the card page by ${p.payByLocal ?? p.payBy} hotel time: ${p.url}. Once it is paid the stay is booked with ${h.name}, and ${deps.tools.listBookings} shows it; unpaid by then, the page closes and nothing is booked or charged.`;
|
|
1473
|
+
case 'issued':
|
|
1474
|
+
return `Confirmed on UnionPay: ${h.name} is being asked to book it now, and ${deps.tools.listBookings} shows when it has. If ${h.name} does not take it, the one-time card is not charged.`;
|
|
1475
|
+
case 'paid':
|
|
1476
|
+
if (unionpay)
|
|
1477
|
+
return b.status === 'confirmed'
|
|
1478
|
+
? `${amount} paid with UnionPay, and booked with ${h.name}, who charges the one-time card UnionPay issued: nothing more is paid at the hotel.`
|
|
1479
|
+
: `${amount} confirmed on UnionPay. ${h.name} has not confirmed the booking yet - ${deps.tools.listBookings} shows when it has; if it does not take it, the one-time card is not charged.`;
|
|
1480
|
+
return b.status === 'confirmed'
|
|
1481
|
+
? `${amount} paid in advance by card, and booked with ${h.name}: nothing more is paid at the hotel.`
|
|
1482
|
+
: `${amount} paid in advance by card. ${h.name} has not confirmed the booking yet - ${deps.tools.listBookings} shows when it has; if it does not take it, all ${amount} goes back.`;
|
|
1483
|
+
case 'lapsed':
|
|
1484
|
+
return 'Not paid in time: nothing was booked and nothing was charged.';
|
|
1485
|
+
case 'refunding':
|
|
1486
|
+
return p.refundStuck
|
|
1487
|
+
? `${back} is due back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}. Sending it back did not go through, and a person is seeing to it.`
|
|
1488
|
+
: `${whole ? `All ${back}` : `${back} of the ${amount} paid`} is going back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}.`;
|
|
1489
|
+
case 'refunded':
|
|
1490
|
+
return `${whole ? `All ${back}` : `${back} of the ${amount} paid`} has gone back to the card it was paid with${p.refundReason ? ` - ${p.refundReason}` : ''}.`;
|
|
1491
|
+
case 'hotel-refunds':
|
|
1492
|
+
return `The money is with ${h.name}, who returns what its terms give back to the card it charged - not this connector.`;
|
|
1493
|
+
}
|
|
1494
|
+
})();
|
|
1495
|
+
return `${said}${test}`;
|
|
1436
1496
|
};
|
|
1437
1497
|
/**
|
|
1438
1498
|
* A stay sent to the hotel's own system whose answer is not in yet: being
|
|
@@ -1862,7 +1922,25 @@ const UNIONPAY_WORDS = {
|
|
|
1862
1922
|
paid: 'paid in advance with UnionPay - the hotel charges the card UnionPay issued',
|
|
1863
1923
|
lapsed: 'not booked - the hotel turned it down before charging, so nothing was charged',
|
|
1864
1924
|
};
|
|
1865
|
-
|
|
1925
|
+
/**
|
|
1926
|
+
* Its money in a line - the booking's status first (2026-10-16 audit, P0-C): a
|
|
1927
|
+
* stay cancelled with nothing going back is never "paid in advance by card".
|
|
1928
|
+
*/
|
|
1929
|
+
const paymentWords = (b) => {
|
|
1930
|
+
const p = b.payment;
|
|
1931
|
+
const ended = b.status === 'cancelled' || b.status === 'expired' || b.status === 'failed';
|
|
1932
|
+
if (ended && p.status === 'paid')
|
|
1933
|
+
return b.cancellationFee && b.cancellationFee.minor >= p.amount.minor
|
|
1934
|
+
? 'cancelled after its free time - the fee was the whole amount paid, and nothing goes back'
|
|
1935
|
+
: 'cancelled - what comes back of it depends on the cancellation fee, which a person is settling';
|
|
1936
|
+
if (p.status === 'refunding' && p.refundStuck)
|
|
1937
|
+
return 'due back to the card it was paid with - sending it back did not go through, and a person is seeing to it';
|
|
1938
|
+
if ((p.status === 'refunding' || p.status === 'refunded') &&
|
|
1939
|
+
p.refundAmount &&
|
|
1940
|
+
p.refundAmount.minor !== p.amount.minor)
|
|
1941
|
+
return `${formatMoney(p.refundAmount)} of ${formatMoney(p.amount)} ${p.status === 'refunded' ? 'refunded' : 'going back'} - the rest was the fee`;
|
|
1942
|
+
return ((p.method === 'unionpay' ? UNIONPAY_WORDS[p.status] : undefined) ?? PAYMENT_WORDS[p.status]);
|
|
1943
|
+
};
|
|
1866
1944
|
const bookingLine = (b) => {
|
|
1867
1945
|
const kinds = b.requests?.kinds ?? [];
|
|
1868
1946
|
return [
|
|
@@ -1873,7 +1951,7 @@ const bookingLine = (b) => {
|
|
|
1873
1951
|
: b.status}`,
|
|
1874
1952
|
kinds.length ? ` · asked for ${kinds.map(bare).join(', ')}` : '',
|
|
1875
1953
|
b.payment
|
|
1876
|
-
? ` · ${paymentWords(b
|
|
1954
|
+
? ` · ${paymentWords(b)}${b.payment.status === 'awaiting' && b.payment.url ? ` by ${b.payment.payByLocal ?? b.payment.payBy}: ${b.payment.url}` : ''}`
|
|
1877
1955
|
: '',
|
|
1878
1956
|
].join('');
|
|
1879
1957
|
};
|
|
@@ -3820,9 +3898,36 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
3820
3898
|
const email = str(args.email);
|
|
3821
3899
|
const who = identity(deps, ctx, key, args);
|
|
3822
3900
|
const pay = deps.backend.unionPay?.bind(deps.backend);
|
|
3823
|
-
|
|
3901
|
+
// ⚠️ EVERY TRY COUNTS, NOT ONLY A MISS (2026-10-16 audit, P0-E). `guarded`
|
|
3902
|
+
// counts a code and email that do not match; one that does was free, and
|
|
3903
|
+
// each call opens UnionPay's card page or its confirmation through the
|
|
3904
|
+
// gateway - fifty of them used up its key's limit for every guest. A
|
|
3905
|
+
// guest's own card takes a press, a "continue" and a reopen at most.
|
|
3906
|
+
const tries = [
|
|
3907
|
+
`unionpay|booking|${code.trim().toLowerCase()}`,
|
|
3908
|
+
`unionpay|session|${who.sessionId}`,
|
|
3909
|
+
...(ctx.ip ? [`ip|unionpay|${ctx.ip}`] : []),
|
|
3910
|
+
];
|
|
3911
|
+
const used = !!code && !!deps.misses?.blocked(tries);
|
|
3912
|
+
if (pay && code && email && !used)
|
|
3913
|
+
deps.misses?.miss(tries);
|
|
3914
|
+
const { found: step, tooMany } = pay && code && email && !used
|
|
3824
3915
|
? await guarded(deps, ctx, who, code, async () => (await pay(code, email, who)) ?? null)
|
|
3825
|
-
: { found: null, tooMany:
|
|
3916
|
+
: { found: null, tooMany: used };
|
|
3917
|
+
if (used) {
|
|
3918
|
+
const why = 'Paying with UnionPay has been asked for this stay too many times just now. Try again in a quarter of an hour - or pay on the card page, which is still open.';
|
|
3919
|
+
return {
|
|
3920
|
+
structured: {
|
|
3921
|
+
view: 'error',
|
|
3922
|
+
...common(deps, key),
|
|
3923
|
+
error: 'unionpay-refused',
|
|
3924
|
+
detail: why,
|
|
3925
|
+
refusal: 'too-many',
|
|
3926
|
+
},
|
|
3927
|
+
text: why,
|
|
3928
|
+
isError: true,
|
|
3929
|
+
};
|
|
3930
|
+
}
|
|
3826
3931
|
if (!step) {
|
|
3827
3932
|
return {
|
|
3828
3933
|
structured: {
|
|
@@ -4100,7 +4205,7 @@ const answerTool = async (deps, name, rawArgs, ctx) => {
|
|
|
4100
4205
|
text: [
|
|
4101
4206
|
cancelled.payment
|
|
4102
4207
|
? // Paid here in advance: what becomes of the money is the answer.
|
|
4103
|
-
`${cancelled.confirmationCode} is ${cancelled.status === 'expired' ? 'called off before it was paid' : 'cancelled'}. ${paidLine(deps, cancelled)}`
|
|
4208
|
+
`${cancelled.confirmationCode} is ${cancelled.status === 'expired' ? 'called off before it was paid' : 'cancelled'}. ${paidLine(deps, cancelled, charged)}`
|
|
4104
4209
|
: h.sandbox
|
|
4105
4210
|
? // A test booking cancelled in the simulation: no hotel, no charge (2026-10-05 audit, P2).
|
|
4106
4211
|
`${cancelled.confirmationCode} is cancelled in the simulated system. ${charged.minor === 0 ? 'No fee.' : `A real booking on this rate would be charged ${formatMoney(charged)}; this one is a test, and nothing is charged.`}`
|