@jsm-mit/tigi-sharded-package 0.9.0 → 0.10.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/README.md CHANGED
@@ -44,6 +44,9 @@ const again = await request.searchAgainAsyncUnsafe(); // a new request, th
44
44
  const ride = await request.getRideAsyncUnsafe(); // from the driver canister, every RIDE_POLL_MS (2 s)
45
45
  await request.getRideRouteAsyncUnsafe(); // K-13: the ride's line while it is active (once; undefined after the end)
46
46
  await request.cancelRideAsyncUnsafe(); // before inProgress, once
47
+ // P-20: card straight to the driver (Stripe) — when ride.cardAccepted, during inProgress:
48
+ const card = await request.startCardPaymentAsyncUnsafe(returnUrl); // open → go to card.url; the same page again while it stands
49
+ await request.checkCardPaymentAsyncUnsafe(); // back from Stripe (card=paid|cancelled in the URL); ride.cardPayment shows it too
47
50
  await request.getLicenceAsyncUnsafe(); // from accepted to the end of the ride
48
51
  await request.rateDriverAsyncUnsafe(5); // after completed, once
49
52
 
@@ -167,6 +167,30 @@ type RideView = record {
167
167
  positionAtNs : opt nat64;
168
168
  etaToPickupSec : opt nat32;
169
169
  price : Money;
170
+ cardAccepted : opt bool; // P-20: the driver takes cards; absent = no
171
+ cardPayment : opt CardPaymentView; // P-20: once the rider started one
172
+ };
173
+
174
+ // P-20: the rider's card payment of a ride — Stripe Checkout on the driver's own account.
175
+ type CardPaymentState = variant {
176
+ creating; // the session is being made
177
+ open; // waits for the rider at `url`
178
+ paid;
179
+ expired; // ran out unpaid; a new one may be started
180
+ failed : text; // could not be made; a new try may be started
181
+ };
182
+
183
+ type CardPaymentView = record {
184
+ state : CardPaymentState;
185
+ amount : Money;
186
+ url : opt text; // the Stripe Checkout page, while `open`
187
+ updatedAtNs : nat64;
188
+ };
189
+
190
+ type CardPaymentArgs = record {
191
+ requestId : RequestId;
192
+ driverKey : DriverKey;
193
+ returnUrl : text; // https; Stripe sends the rider back with `card=paid|cancelled`
170
194
  };
171
195
 
172
196
  type Licence = record {
@@ -196,6 +220,10 @@ service : {
196
220
  // line or after the end); an old canister has no such method — the rider draws none.
197
221
  getRideRoute : (RideRef) -> (variant { ok : RouteLine; err : ProtocolError }) query;
198
222
  cancelRide : (RideRef) -> (variant { ok; err : ProtocolError });
223
+ // P-20: pay by card during the ride (`inProgress`); the same page while it stands. A
224
+ // driver without cards answers `invalidData`; an old canister has no such methods.
225
+ startCardPayment : (CardPaymentArgs) -> (variant { ok : CardPaymentView; err : ProtocolError });
226
+ checkCardPayment : (RideRef) -> (variant { ok : CardPaymentView; err : ProtocolError });
199
227
  }
200
228
 
201
229
  // What a driver canister may call on a worker (part of the worker's interface).
@@ -2,6 +2,25 @@ import type { Principal } from '@icp-sdk/core/principal';
2
2
  import type { ActorMethod } from '@icp-sdk/core/agent';
3
3
  import type { IDL } from '@icp-sdk/core/candid';
4
4
 
5
+ export interface CardPaymentArgs {
6
+ 'returnUrl' : string,
7
+ 'requestId' : RequestId,
8
+ 'driverKey' : DriverKey,
9
+ }
10
+ /**
11
+ * P-20: the rider's card payment of a ride — Stripe Checkout on the driver's own account.
12
+ */
13
+ export type CardPaymentState = { 'expired' : null } |
14
+ { 'creating' : null } |
15
+ { 'open' : null } |
16
+ { 'paid' : null } |
17
+ { 'failed' : string };
18
+ export interface CardPaymentView {
19
+ 'url' : [] | [string],
20
+ 'updatedAtNs' : bigint,
21
+ 'state' : CardPaymentState,
22
+ 'amount' : Money,
23
+ }
5
24
  export type CarrierKind = { 'other' : string } |
6
25
  { 'taxi' : null } |
7
26
  { 'rideHailing' : null } |
@@ -114,9 +133,11 @@ export interface RideView {
114
133
  'status' : RideStatus,
115
134
  'requestId' : RequestId,
116
135
  'positionAtNs' : [] | [bigint],
136
+ 'cardPayment' : [] | [CardPaymentView],
117
137
  'price' : Money,
118
138
  'etaToPickupSec' : [] | [number],
119
139
  'driver' : DriverCard,
140
+ 'cardAccepted' : [] | [boolean],
120
141
  'driverPosition' : [] | [Geo],
121
142
  }
122
143
  export interface RiderRating {
@@ -141,6 +162,11 @@ export interface _SERVICE {
141
162
  { 'ok' : null } |
142
163
  { 'err' : ProtocolError }
143
164
  >,
165
+ 'checkCardPayment' : ActorMethod<
166
+ [RideRef],
167
+ { 'ok' : CardPaymentView } |
168
+ { 'err' : ProtocolError }
169
+ >,
144
170
  'getLicence' : ActorMethod<
145
171
  [RideRef],
146
172
  { 'ok' : Licence } |
@@ -179,6 +205,15 @@ export interface _SERVICE {
179
205
  { 'ok' : null } |
180
206
  { 'err' : ProtocolError }
181
207
  >,
208
+ /**
209
+ * P-20: pay by card during the ride (`inProgress`); the same page while it stands. A
210
+ * driver without cards answers `invalidData`; an old canister has no such methods.
211
+ */
212
+ 'startCardPayment' : ActorMethod<
213
+ [CardPaymentArgs],
214
+ { 'ok' : CardPaymentView } |
215
+ { 'err' : ProtocolError }
216
+ >,
182
217
  }
183
218
  export declare const idlFactory: IDL.InterfaceFactory;
184
219
  export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
@@ -15,12 +15,25 @@ export const idlFactory = ({ IDL }) => {
15
15
  'unsupportedVersion' : IDL.Nat32,
16
16
  'notMyArea' : IDL.Null,
17
17
  });
18
+ const CardPaymentState = IDL.Variant({
19
+ 'expired' : IDL.Null,
20
+ 'creating' : IDL.Null,
21
+ 'open' : IDL.Null,
22
+ 'paid' : IDL.Null,
23
+ 'failed' : IDL.Text,
24
+ });
25
+ const Money = IDL.Record({ 'currency' : IDL.Text, 'amount' : IDL.Nat64 });
26
+ const CardPaymentView = IDL.Record({
27
+ 'url' : IDL.Opt(IDL.Text),
28
+ 'updatedAtNs' : IDL.Nat64,
29
+ 'state' : CardPaymentState,
30
+ 'amount' : Money,
31
+ });
18
32
  const Licence = IDL.Record({
19
33
  'mimeType' : IDL.Text,
20
34
  'image' : IDL.Vec(IDL.Nat8),
21
35
  'documentNumber' : IDL.Text,
22
36
  });
23
- const Money = IDL.Record({ 'currency' : IDL.Text, 'amount' : IDL.Nat64 });
24
37
  const RideStatus = IDL.Variant({
25
38
  'completed' : IDL.Record({ 'price' : Money }),
26
39
  'cancelledByRider' : IDL.Null,
@@ -48,9 +61,11 @@ export const idlFactory = ({ IDL }) => {
48
61
  'status' : RideStatus,
49
62
  'requestId' : RequestId,
50
63
  'positionAtNs' : IDL.Opt(IDL.Nat64),
64
+ 'cardPayment' : IDL.Opt(CardPaymentView),
51
65
  'price' : Money,
52
66
  'etaToPickupSec' : IDL.Opt(IDL.Nat32),
53
67
  'driver' : DriverCard,
68
+ 'cardAccepted' : IDL.Opt(IDL.Bool),
54
69
  'driverPosition' : IDL.Opt(Geo),
55
70
  });
56
71
  const RouteLine = IDL.Record({ 'ride' : IDL.Text, 'toPickup' : IDL.Text });
@@ -85,12 +100,22 @@ export const idlFactory = ({ IDL }) => {
85
100
  'riderName' : IDL.Text,
86
101
  'rider' : IDL.Principal,
87
102
  });
103
+ const CardPaymentArgs = IDL.Record({
104
+ 'returnUrl' : IDL.Text,
105
+ 'requestId' : RequestId,
106
+ 'driverKey' : DriverKey,
107
+ });
88
108
  return IDL.Service({
89
109
  'cancelRide' : IDL.Func(
90
110
  [RideRef],
91
111
  [IDL.Variant({ 'ok' : IDL.Null, 'err' : ProtocolError })],
92
112
  [],
93
113
  ),
114
+ 'checkCardPayment' : IDL.Func(
115
+ [RideRef],
116
+ [IDL.Variant({ 'ok' : CardPaymentView, 'err' : ProtocolError })],
117
+ [],
118
+ ),
94
119
  'getLicence' : IDL.Func(
95
120
  [RideRef],
96
121
  [IDL.Variant({ 'ok' : Licence, 'err' : ProtocolError })],
@@ -118,6 +143,11 @@ export const idlFactory = ({ IDL }) => {
118
143
  [IDL.Variant({ 'ok' : IDL.Null, 'err' : ProtocolError })],
119
144
  [],
120
145
  ),
146
+ 'startCardPayment' : IDL.Func(
147
+ [CardPaymentArgs],
148
+ [IDL.Variant({ 'ok' : CardPaymentView, 'err' : ProtocolError })],
149
+ [],
150
+ ),
121
151
  });
122
152
  };
123
153
  export const init = ({ IDL }) => { return []; };
@@ -1,4 +1,31 @@
1
1
  type CancelledByDriverStatus = record { reason : text };
2
+ // `variant { ok : CardPaymentView; err : ProtocolError }`.
3
+ type CardPaymentAnswer = variant { ok : CardPaymentView; err : ProtocolError };
4
+ // P-20: `startCardPayment` — the rider's front gives the page Stripe sends the rider back to.
5
+ type CardPaymentArgs = record {
6
+ returnUrl : text;
7
+ requestId : text;
8
+ driverKey : text;
9
+ };
10
+ // P-20: where the rider's card payment of a ride stands.
11
+ type CardPaymentState = variant {
12
+ // The session ran out unpaid; a new one may be started.
13
+ expired;
14
+ // The driver canister is making the Stripe Checkout session.
15
+ creating;
16
+ // The session waits for the rider at `url`.
17
+ open;
18
+ paid;
19
+ // The session could not be made (the reason, for the fronts); a new try may be started.
20
+ failed : text;
21
+ };
22
+ type CardPaymentView = record {
23
+ // The Stripe Checkout page, while `open`.
24
+ url : opt text;
25
+ updatedAtNs : nat64;
26
+ state : CardPaymentState;
27
+ amount : Money;
28
+ };
2
29
  type CarrierKind = variant {
3
30
  other : text;
4
31
  taxi;
@@ -239,9 +266,13 @@ type RideView = record {
239
266
  status : RideStatus;
240
267
  requestId : text;
241
268
  positionAtNs : opt nat64;
269
+ // P-20: the rider's card payment of this ride, once started.
270
+ cardPayment : opt CardPaymentView;
242
271
  price : Money;
243
272
  etaToPickupSec : opt nat32;
244
273
  driver : DriverCard;
274
+ // P-20: the driver takes cards (Stripe on the driver's own account); absent = no.
275
+ cardAccepted : opt bool;
245
276
  // Exact, for the rider of this ride only.
246
277
  driverPosition : opt Geo;
247
278
  };
@@ -313,8 +344,8 @@ type SpeedUpArgs = record {
313
344
  factor : nat8;
314
345
  };
315
346
  service : (InitArgs) -> {
316
- // S-14 (KK-33): the rider cancels before `inProgress`, once.
317
347
  cancelRide : (RideRef) -> (ProtocolAnswer);
348
+ checkCardPayment : (RideRef) -> (CardPaymentAnswer);
318
349
  // S-N15: where testers last asked for drivers — the router moves the automat driver
319
350
  // canister near it (TIGI-DRIVER-MODES). None until the first search after an install or
320
351
  // an upgrade.
@@ -343,6 +374,9 @@ service : (InitArgs) -> {
343
374
  // S-2, S-3: virtual drivers around a point, each registered in the worker of its cell
344
375
  // with `validUntilNs` (30 min) instead of a pulse.
345
376
  spawnDrivers : (SpawnArgs) -> (Result_3);
377
+ // S-14 (KK-33): the rider cancels before `inProgress`, once.
378
+ // P-20: simulated drivers take no cards (`cardAccepted` is absent in their `getRide`).
379
+ startCardPayment : (CardPaymentArgs) -> (CardPaymentAnswer);
346
380
  // S-N13: the router's route for one virtual driver — metres, seconds, the line. The quote
347
381
  // goes with it at its moment (S-8), or at once when that moment has passed.
348
382
  submitRoute : (SimRouteResult) -> (Result_2);
@@ -3,6 +3,56 @@ import type { ActorMethod } from '@icp-sdk/core/agent';
3
3
  import type { IDL } from '@icp-sdk/core/candid';
4
4
 
5
5
  export interface CancelledByDriverStatus { 'reason' : string }
6
+ /**
7
+ * `variant { ok : CardPaymentView; err : ProtocolError }`.
8
+ */
9
+ export type CardPaymentAnswer = { 'ok' : CardPaymentView } |
10
+ { 'err' : ProtocolError };
11
+ /**
12
+ * P-20: `startCardPayment` — the rider's front gives the page Stripe sends the rider back to.
13
+ */
14
+ export interface CardPaymentArgs {
15
+ 'returnUrl' : string,
16
+ 'requestId' : string,
17
+ 'driverKey' : string,
18
+ }
19
+ /**
20
+ * P-20: where the rider's card payment of a ride stands.
21
+ */
22
+ export type CardPaymentState = {
23
+ /**
24
+ * The session ran out unpaid; a new one may be started.
25
+ */
26
+ 'expired' : null
27
+ } |
28
+ {
29
+ /**
30
+ * The driver canister is making the Stripe Checkout session.
31
+ */
32
+ 'creating' : null
33
+ } |
34
+ {
35
+ /**
36
+ * The session waits for the rider at `url`.
37
+ */
38
+ 'open' : null
39
+ } |
40
+ { 'paid' : null } |
41
+ {
42
+ /**
43
+ * The session could not be made (the reason, for the fronts); a new try may be started.
44
+ */
45
+ 'failed' : string
46
+ };
47
+ export interface CardPaymentView {
48
+ /**
49
+ * The Stripe Checkout page, while `open`.
50
+ */
51
+ 'url' : [] | [string],
52
+ 'updatedAtNs' : bigint,
53
+ 'state' : CardPaymentState,
54
+ 'amount' : Money,
55
+ }
6
56
  export type CarrierKind = { 'other' : string } |
7
57
  { 'taxi' : null } |
8
58
  {
@@ -332,9 +382,17 @@ export interface RideView {
332
382
  'status' : RideStatus,
333
383
  'requestId' : string,
334
384
  'positionAtNs' : [] | [bigint],
385
+ /**
386
+ * P-20: the rider's card payment of this ride, once started.
387
+ */
388
+ 'cardPayment' : [] | [CardPaymentView],
335
389
  'price' : Money,
336
390
  'etaToPickupSec' : [] | [number],
337
391
  'driver' : DriverCard,
392
+ /**
393
+ * P-20: the driver takes cards (Stripe on the driver's own account); absent = no.
394
+ */
395
+ 'cardAccepted' : [] | [boolean],
338
396
  /**
339
397
  * Exact, for the rider of this ride only.
340
398
  */
@@ -435,10 +493,8 @@ export interface SpeedUpArgs {
435
493
  'factor' : number,
436
494
  }
437
495
  export interface _SERVICE {
438
- /**
439
- * S-14 (KK-33): the rider cancels before `inProgress`, once.
440
- */
441
496
  'cancelRide' : ActorMethod<[RideRef], ProtocolAnswer>,
497
+ 'checkCardPayment' : ActorMethod<[RideRef], CardPaymentAnswer>,
442
498
  /**
443
499
  * S-N15: where testers last asked for drivers — the router moves the automat driver
444
500
  * canister near it (TIGI-DRIVER-MODES). None until the first search after an install or
@@ -485,6 +541,11 @@ export interface _SERVICE {
485
541
  * with `validUntilNs` (30 min) instead of a pulse.
486
542
  */
487
543
  'spawnDrivers' : ActorMethod<[SpawnArgs], Result_3>,
544
+ /**
545
+ * S-14 (KK-33): the rider cancels before `inProgress`, once.
546
+ * P-20: simulated drivers take no cards (`cardAccepted` is absent in their `getRide`).
547
+ */
548
+ 'startCardPayment' : ActorMethod<[CardPaymentArgs], CardPaymentAnswer>,
488
549
  /**
489
550
  * S-N13: the router's route for one virtual driver — metres, seconds, the line. The quote
490
551
  * goes with it at its moment (S-8), or at once when that moment has passed.
@@ -28,6 +28,24 @@ export const idlFactory = ({ IDL }) => {
28
28
  'ok' : IDL.Null,
29
29
  'err' : ProtocolError,
30
30
  });
31
+ const CardPaymentState = IDL.Variant({
32
+ 'expired' : IDL.Null,
33
+ 'creating' : IDL.Null,
34
+ 'open' : IDL.Null,
35
+ 'paid' : IDL.Null,
36
+ 'failed' : IDL.Text,
37
+ });
38
+ const Money = IDL.Record({ 'currency' : IDL.Text, 'amount' : IDL.Nat64 });
39
+ const CardPaymentView = IDL.Record({
40
+ 'url' : IDL.Opt(IDL.Text),
41
+ 'updatedAtNs' : IDL.Nat64,
42
+ 'state' : CardPaymentState,
43
+ 'amount' : Money,
44
+ });
45
+ const CardPaymentAnswer = IDL.Variant({
46
+ 'ok' : CardPaymentView,
47
+ 'err' : ProtocolError,
48
+ });
31
49
  const Geo = IDL.Record({ 'lat' : IDL.Float64, 'lng' : IDL.Float64 });
32
50
  const SpawnPlace = IDL.Record({ 'center' : Geo, 'atNs' : IDL.Nat64 });
33
51
  const SimulatorError = IDL.Variant({
@@ -46,7 +64,6 @@ export const idlFactory = ({ IDL }) => {
46
64
  'documentNumber' : IDL.Text,
47
65
  });
48
66
  const LicenceAnswer = IDL.Variant({ 'ok' : Licence, 'err' : ProtocolError });
49
- const Money = IDL.Record({ 'currency' : IDL.Text, 'amount' : IDL.Nat64 });
50
67
  const CompletedStatus = IDL.Record({ 'price' : Money });
51
68
  const CancelledByDriverStatus = IDL.Record({ 'reason' : IDL.Text });
52
69
  const RideStatus = IDL.Variant({
@@ -75,9 +92,11 @@ export const idlFactory = ({ IDL }) => {
75
92
  'status' : RideStatus,
76
93
  'requestId' : IDL.Text,
77
94
  'positionAtNs' : IDL.Opt(IDL.Nat64),
95
+ 'cardPayment' : IDL.Opt(CardPaymentView),
78
96
  'price' : Money,
79
97
  'etaToPickupSec' : IDL.Opt(IDL.Nat32),
80
98
  'driver' : DriverCard,
99
+ 'cardAccepted' : IDL.Opt(IDL.Bool),
81
100
  'driverPosition' : IDL.Opt(Geo),
82
101
  });
83
102
  const RideAnswer = IDL.Variant({ 'ok' : RideView, 'err' : ProtocolError });
@@ -168,6 +187,11 @@ export const idlFactory = ({ IDL }) => {
168
187
  'validUntilNs' : IDL.Nat64,
169
188
  });
170
189
  const Result_3 = IDL.Variant({ 'Ok' : SpawnResult, 'Err' : SimulatorError });
190
+ const CardPaymentArgs = IDL.Record({
191
+ 'returnUrl' : IDL.Text,
192
+ 'requestId' : IDL.Text,
193
+ 'driverKey' : IDL.Text,
194
+ });
171
195
  const SimRouteResult = IDL.Record({
172
196
  'requestId' : IDL.Text,
173
197
  'rideMeters' : IDL.Nat32,
@@ -179,6 +203,7 @@ export const idlFactory = ({ IDL }) => {
179
203
  });
180
204
  return IDL.Service({
181
205
  'cancelRide' : IDL.Func([RideRef], [ProtocolAnswer], []),
206
+ 'checkCardPayment' : IDL.Func([RideRef], [CardPaymentAnswer], []),
182
207
  'getLastSpawn' : IDL.Func([], [Result], ['query']),
183
208
  'getLicence' : IDL.Func([RideRef], [LicenceAnswer], ['query']),
184
209
  'getRide' : IDL.Func([RideRef], [RideAnswer], ['query']),
@@ -193,6 +218,7 @@ export const idlFactory = ({ IDL }) => {
193
218
  'setRouter' : IDL.Func([SetRouterArgs], [Result_2], []),
194
219
  'setSpeedUp' : IDL.Func([SpeedUpArgs], [Result_2], []),
195
220
  'spawnDrivers' : IDL.Func([SpawnArgs], [Result_3], []),
221
+ 'startCardPayment' : IDL.Func([CardPaymentArgs], [CardPaymentAnswer], []),
196
222
  'submitRoute' : IDL.Func([SimRouteResult], [Result_2], []),
197
223
  });
198
224
  };
@@ -2,7 +2,7 @@ import type { Identity } from "@icp-sdk/core/agent";
2
2
  import { type GroupOptions } from "../group/canister-actor.js";
3
3
  import { TigiGroup } from "../group/group.js";
4
4
  import { type Geo } from "../geo.js";
5
- import type { ChatPlace, ChooseOutcome, LicenceView, RequestSnapshot, RideView, RouteLineView } from "../interfaces.js";
5
+ import type { CardPaymentView, ChatPlace, ChooseOutcome, LicenceView, RequestSnapshot, RideView, RouteLineView } from "../interfaces.js";
6
6
  /** U-29: the rider's radius, and the radius after `WIDEN_AFTER_MS` without offers. */
7
7
  export declare const SEARCH_RADIUS_METERS = 3000;
8
8
  export declare const WIDE_RADIUS_METERS = 6000;
@@ -219,6 +219,23 @@ export declare class RideRequest {
219
219
  * @throws Error with message `CriticalCanisterError` — the driver canister does not answer
220
220
  */
221
221
  cancelRideAsyncUnsafe(): Promise<void>;
222
+ /**
223
+ * P-20 (D-2): the rider pays by card during the ride — the driver canister makes a Stripe
224
+ * Checkout session on the driver's account; send the rider to `url` while `open`. Again
225
+ * while it stands → the same page. Stripe sends the rider back to `returnUrl` with
226
+ * `card=paid` or `card=cancelled`: call `checkCardPaymentAsyncUnsafe` then.
227
+ * @param returnUrl - https, the rider's page of this ride
228
+ * @throws Error with message `CanisterError` — `invalidData` (the driver takes no cards, the ride has not started, too many tries, a bad `returnUrl`), `expired` (the ride ended), `NoCards` (an older driver canister), `NOT_ACCEPTED`, `notAuthorized`
229
+ * @throws Error with message `CallRefusedAtInspectionStage` — the daily limit of the driver canister
230
+ * @throws Error with message `CriticalCanisterError` — the driver canister does not answer
231
+ */
232
+ startCardPaymentAsyncUnsafe(returnUrl: string): Promise<CardPaymentView>;
233
+ /**
234
+ * P-20: after Stripe sent the rider back — the driver canister asks Stripe now.
235
+ * @throws Error with message `CanisterError` — `notFound` (no card payment started), `NoCards`, `NOT_ACCEPTED`, `notAuthorized`
236
+ * @throws Error with message `CriticalCanisterError` — the driver canister does not answer
237
+ */
238
+ checkCardPaymentAsyncUnsafe(): Promise<CardPaymentView>;
222
239
  /**
223
240
  * U-11, PR-23: the driver's licence, from the acceptance to the end of the ride.
224
241
  * @throws Error with message `CanisterError` — `notFound` (no photo), `notAuthorized` (after the ride), `NOT_ACCEPTED`
@@ -1 +1 @@
1
- {"version":3,"file":"rides-actor.d.ts","sourceRoot":"","sources":["../../src/actors/rides-actor.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,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;;OASG;IACU,2BAA2B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAYrF;;;;OAIG;IACU,2BAA2B,IAAI,OAAO,CAAC,eAAe,CAAC;IAYpE;;;;OAIG;IACU,qBAAqB,IAAI,OAAO,CAAC,WAAW,CAAC;IAO1D;;;;;;;;;OASG;IACU,uBAAuB,IAAI,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAOtE;;;;;;OAMG;IACU,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IASnE,4IAA4I;IAC5I,OAAO,CAAC,WAAW;YAML,kBAAkB;YA2BlB,UAAU;IA8DxB,iHAAiH;YACnG,gBAAgB;IAS9B,6FAA6F;YAC/E,UAAU;YASV,kBAAkB;YAalB,mBAAmB;YAOnB,WAAW;CAG5B"}
@@ -437,6 +437,47 @@ export class RideRequest {
437
437
  await executeProtocolAsyncUnsafe(async () => (await this.driverAsync(accepted.canister)).cancelRide({ requestId: this.state.requestId, driverKey: accepted.driverKey }));
438
438
  this.freshNext = true;
439
439
  }
440
+ /**
441
+ * P-20 (D-2): the rider pays by card during the ride — the driver canister makes a Stripe
442
+ * Checkout session on the driver's account; send the rider to `url` while `open`. Again
443
+ * while it stands → the same page. Stripe sends the rider back to `returnUrl` with
444
+ * `card=paid` or `card=cancelled`: call `checkCardPaymentAsyncUnsafe` then.
445
+ * @param returnUrl - https, the rider's page of this ride
446
+ * @throws Error with message `CanisterError` — `invalidData` (the driver takes no cards, the ride has not started, too many tries, a bad `returnUrl`), `expired` (the ride ended), `NoCards` (an older driver canister), `NOT_ACCEPTED`, `notAuthorized`
447
+ * @throws Error with message `CallRefusedAtInspectionStage` — the daily limit of the driver canister
448
+ * @throws Error with message `CriticalCanisterError` — the driver canister does not answer
449
+ */
450
+ async startCardPaymentAsyncUnsafe(returnUrl) {
451
+ const accepted = await this.acceptedAsyncUnsafe();
452
+ try {
453
+ const payment = await executeProtocolAsyncUnsafe(async () => (await this.driverAsync(accepted.canister)).startCardPayment({ requestId: this.state.requestId, driverKey: accepted.driverKey, returnUrl }));
454
+ this.freshNext = true;
455
+ return cardPaymentOf(payment);
456
+ }
457
+ catch (err) {
458
+ if (isMethodMissingError(err))
459
+ throw canisterError("NoCards", "the driver canister is older than card payments");
460
+ throw err;
461
+ }
462
+ }
463
+ /**
464
+ * P-20: after Stripe sent the rider back — the driver canister asks Stripe now.
465
+ * @throws Error with message `CanisterError` — `notFound` (no card payment started), `NoCards`, `NOT_ACCEPTED`, `notAuthorized`
466
+ * @throws Error with message `CriticalCanisterError` — the driver canister does not answer
467
+ */
468
+ async checkCardPaymentAsyncUnsafe() {
469
+ const accepted = await this.acceptedAsyncUnsafe();
470
+ try {
471
+ const payment = await executeProtocolAsyncUnsafe(async () => (await this.driverAsync(accepted.canister)).checkCardPayment({ requestId: this.state.requestId, driverKey: accepted.driverKey }));
472
+ this.freshNext = true;
473
+ return cardPaymentOf(payment);
474
+ }
475
+ catch (err) {
476
+ if (isMethodMissingError(err))
477
+ throw canisterError("NoCards", "the driver canister is older than card payments");
478
+ throw err;
479
+ }
480
+ }
440
481
  /**
441
482
  * U-11, PR-23: the driver's licence, from the acceptance to the end of the ride.
442
483
  * @throws Error with message `CanisterError` — `notFound` (no photo), `notAuthorized` (after the ride), `NOT_ACCEPTED`
@@ -627,5 +668,13 @@ async function getRideOfAsyncUnsafe(identity, options, driver, requestId) {
627
668
  positionAtMs: ride.positionAtNs[0] === undefined ? undefined : msOf(ride.positionAtNs[0]),
628
669
  etaToPickupSec: ride.etaToPickupSec[0],
629
670
  price: moneyOf(ride.price),
671
+ cardAccepted: ride.cardAccepted?.[0] === true,
672
+ cardPayment: ride.cardPayment?.[0] === undefined ? undefined : cardPaymentOf(ride.cardPayment[0]),
630
673
  };
631
674
  }
675
+ /** P-20: the protocol's card payment as the package gives it. */
676
+ function cardPaymentOf(payment) {
677
+ const state = Object.keys(payment.state)[0];
678
+ const failure = "failed" in payment.state ? payment.state.failed : undefined;
679
+ return { state, ...(failure === undefined ? {} : { failure }), amount: moneyOf(payment.amount), url: payment.url[0], updatedAtMs: msOf(payment.updatedAtNs) };
680
+ }
@@ -128,6 +128,22 @@ export interface RideView {
128
128
  positionAtMs?: number;
129
129
  etaToPickupSec?: number;
130
130
  price: Money;
131
+ /** P-20: the driver takes cards — show "Zapłać kartą" once the ride is `inProgress`. False for an older driver canister. */
132
+ cardAccepted: boolean;
133
+ /** P-20: the rider's card payment of this ride, once started. */
134
+ cardPayment?: CardPaymentView;
135
+ }
136
+ /**
137
+ * P-20: the rider's card payment — Stripe Checkout on the driver's own account.
138
+ * `open`: send the rider to `url`; `expired` / `failed`: "Zapłać kartą" may be tapped again.
139
+ */
140
+ export interface CardPaymentView {
141
+ state: "creating" | "open" | "paid" | "expired" | "failed";
142
+ /** Why it failed (the driver canister's or Stripe's words), with `failed`. */
143
+ failure?: string;
144
+ amount: Money;
145
+ url?: string;
146
+ updatedAtMs: number;
131
147
  }
132
148
  /** The driver's licence, for the rider of an accepted ride until its end (U-11). */
133
149
  export interface LicenceView {
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,wEAAwE;AACxE,MAAM,WAAW,KAAK;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,CAAC;AAE7E,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC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AAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,EAAE,CActM;AAID;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAalF"}
package/dist/mappers.js CHANGED
@@ -268,5 +268,10 @@ export function fresherRide(before, next) {
268
268
  if (before.positionAtMs !== undefined && (next.positionAtMs === undefined || next.positionAtMs < before.positionAtMs)) {
269
269
  ride = { ...ride, driverPosition: before.driverPosition, positionAtMs: before.positionAtMs, etaToPickupSec: before.etaToPickupSec };
270
270
  }
271
+ // P-20: the card payment never goes back either (paid stays paid; the newer state wins).
272
+ const card = before.cardPayment;
273
+ if (card !== undefined && (next.cardPayment === undefined || next.cardPayment.updatedAtMs < card.updatedAtMs || (card.state === "paid" && next.cardPayment.state !== "paid"))) {
274
+ ride = { ...ride, cardPayment: card, cardAccepted: before.cardAccepted || ride.cardAccepted };
275
+ }
271
276
  return ride;
272
277
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsm-mit/tigi-sharded-package",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "The one package of the Tigi network group: takes the coordinator's id and hides the coordinator, the core and the workers — for a consumer the group is one canister; plus the rider's few driver-canister endpoints (U-14).",
5
5
  "homepage": "https://github.com/JSM-Tigi/tigi-sharded/tree/master/package#readme",
6
6
  "repository": {
@@ -59,11 +59,11 @@
59
59
  "tigiSharded": {
60
60
  "repo": "tigi-sharded",
61
61
  "repoUrl": "https://github.com/JSM-Tigi/tigi-sharded",
62
- "commit": "8c6479bb45aa71143e5623182d44eec0d03c9a87"
62
+ "commit": "8289506ee9ebe2c9496f713cb8bb34e6bd241755"
63
63
  },
64
64
  "tigiDriverRust": {
65
65
  "repo": "tigi-driver-rust",
66
66
  "repoUrl": "https://github.com/JSM-Tigi/tigi-driver-rust",
67
- "commit": "94bd6b741a8340bbb7748791363abf1bdb3f52ff"
67
+ "commit": "0e075f25fdddac1c828ec1a53bf03c8eff58a004"
68
68
  }
69
69
  }