@cimplify/sdk 0.101.1 → 0.103.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.
Files changed (70) hide show
  1. package/dist/advanced.d.mts +3 -3
  2. package/dist/advanced.d.ts +3 -3
  3. package/dist/advanced.js +23 -22
  4. package/dist/advanced.mjs +4 -3
  5. package/dist/{chunk-QPRI2NII.js → chunk-2P4KXFB6.js} +6 -0
  6. package/dist/{chunk-4G5UWFC3.mjs → chunk-3V4DVXV3.mjs} +6 -1
  7. package/dist/{chunk-YHPMFTMN.mjs → chunk-C2JSNJUC.mjs} +406 -95
  8. package/dist/chunk-CNN7Z2IP.js +125 -0
  9. package/dist/{chunk-DKLHCZ5M.mjs → chunk-GERXZQSX.mjs} +487 -11
  10. package/dist/chunk-GOHSXBKW.mjs +105 -0
  11. package/dist/{chunk-7H6IL7CX.mjs → chunk-H7ACMHM3.mjs} +40 -15
  12. package/dist/{chunk-Z3K2D3TE.mjs → chunk-J6PNHDHL.mjs} +453 -483
  13. package/dist/{chunk-NIOUSKQQ.js → chunk-JG5CQNCB.js} +5 -0
  14. package/dist/{chunk-YER7DIOM.js → chunk-JSWJ4XDE.js} +471 -519
  15. package/dist/{chunk-DLW3RWRK.mjs → chunk-M4URVKHE.mjs} +46 -12
  16. package/dist/{chunk-WMEC5JWN.js → chunk-NNG6IFFX.js} +50 -13
  17. package/dist/{chunk-ICCCSVN3.js → chunk-QOWPGS7Z.js} +42 -16
  18. package/dist/{chunk-YDA46OZ6.js → chunk-R6OLQ33I.js} +560 -80
  19. package/dist/{chunk-H5SSGN7W.js → chunk-VIL6IQCG.js} +408 -97
  20. package/dist/{chunk-O3YUHLZL.mjs → chunk-VNPEYLB2.mjs} +5 -0
  21. package/dist/{client-Db554902.d.ts → client-BfpNjJ_a.d.mts} +93 -299
  22. package/dist/{client-CdTx7X_X.d.mts → client-DHBwvh7U.d.ts} +93 -299
  23. package/dist/{client-WkUcvRvO.d.mts → client-DpqRobY9.d.mts} +2 -2
  24. package/dist/{client-D40kI8z2.d.ts → client-Dqg2mc-7.d.ts} +2 -2
  25. package/dist/{index-D3UXgAYl.d.ts → index-C8uDqLwJ.d.ts} +14 -4
  26. package/dist/{index-BjWUkYgY.d.mts → index-e2y6AK70.d.mts} +14 -4
  27. package/dist/index.d.mts +92 -8
  28. package/dist/index.d.ts +92 -8
  29. package/dist/index.js +225 -188
  30. package/dist/index.mjs +7 -6
  31. package/dist/link-cuNVYc2s.d.mts +297 -0
  32. package/dist/link-cuNVYc2s.d.ts +297 -0
  33. package/dist/mock/cli.mjs +412 -94
  34. package/dist/mock/library.js +412 -94
  35. package/dist/mock/library.mjs +412 -94
  36. package/dist/mock/msw.js +412 -94
  37. package/dist/mock/msw.mjs +412 -94
  38. package/dist/{product-DwKdC_to.d.mts → payment-H5LoIvXU.d.mts} +207 -7
  39. package/dist/{product-DwKdC_to.d.ts → payment-H5LoIvXU.d.ts} +207 -7
  40. package/dist/{price-CiQUd_XX.d.mts → price-BvePgDXe.d.mts} +1 -1
  41. package/dist/{price-D9EOj8y8.d.ts → price-C2RqscMY.d.ts} +1 -1
  42. package/dist/react.d.mts +6 -4
  43. package/dist/react.d.ts +6 -4
  44. package/dist/react.js +203 -198
  45. package/dist/react.mjs +11 -6
  46. package/dist/{server-CeDb93WA.d.ts → server-C7FyLdrz.d.mts} +11 -9
  47. package/dist/{server-D-nSkrUr.d.mts → server-DoXIpSd7.d.ts} +11 -9
  48. package/dist/server.d.mts +4 -4
  49. package/dist/server.d.ts +4 -4
  50. package/dist/server.js +11 -10
  51. package/dist/server.mjs +5 -4
  52. package/dist/testing/msw.d.mts +2 -2
  53. package/dist/testing/msw.d.ts +2 -2
  54. package/dist/testing/msw.js +4 -3
  55. package/dist/testing/msw.mjs +3 -2
  56. package/dist/testing/suite.d.mts +6 -6
  57. package/dist/testing/suite.d.ts +6 -6
  58. package/dist/testing/suite.js +26 -25
  59. package/dist/testing/suite.mjs +7 -6
  60. package/dist/testing.d.mts +175 -45
  61. package/dist/testing.d.ts +175 -45
  62. package/dist/testing.js +86 -81
  63. package/dist/testing.mjs +8 -7
  64. package/dist/utils.d.mts +4 -4
  65. package/dist/utils.d.ts +4 -4
  66. package/dist/utils.js +37 -29
  67. package/dist/utils.mjs +2 -2
  68. package/package.json +7 -1
  69. package/dist/payment-CRqjGrx6.d.mts +0 -113
  70. package/dist/payment-DO1Z1Ip6.d.ts +0 -113
@@ -1,5 +1,6 @@
1
1
  import { messagePreview } from './chunk-U4MW6PYU.mjs';
2
- import { ErrorCode } from './chunk-O3YUHLZL.mjs';
2
+ import { PAYMENT_METHOD } from './chunk-GOHSXBKW.mjs';
3
+ import { ErrorCode } from './chunk-VNPEYLB2.mjs';
3
4
  import { __publicField, __privateAdd, __privateSet, __privateGet, __privateMethod, __privateWrapper } from './chunk-3G6RQLXK.mjs';
4
5
 
5
6
  // ../node_modules/.bun/hono@4.12.25/node_modules/hono/dist/compose.js
@@ -2188,10 +2189,22 @@ function buildV1(deps) {
2188
2189
  }));
2189
2190
  });
2190
2191
  app.get("/business", (c) => tryRoute(c, () => deps.business.primary()));
2191
- app.get("/business/by-handle/:handle", (c) => tryRoute(c, () => deps.business.byHandle(c.req.param("handle"))));
2192
- app.get("/business/by-domain", (c) => tryRoute(c, () => deps.business.byDomain(c.req.query("domain") ?? "")));
2193
- app.get("/business/settings", (c) => tryRoute(c, () => deps.business.settings(deps.defaultBusinessId)));
2194
- app.get("/business/locations", (c) => tryRoute(c, () => deps.business.locations(deps.defaultBusinessId)));
2192
+ app.get(
2193
+ "/business/by-handle/:handle",
2194
+ (c) => tryRoute(c, () => deps.business.byHandle(c.req.param("handle")))
2195
+ );
2196
+ app.get(
2197
+ "/business/by-domain",
2198
+ (c) => tryRoute(c, () => deps.business.byDomain(c.req.query("domain") ?? ""))
2199
+ );
2200
+ app.get(
2201
+ "/business/settings",
2202
+ (c) => tryRoute(c, () => deps.business.settings(deps.defaultBusinessId))
2203
+ );
2204
+ app.get(
2205
+ "/business/locations",
2206
+ (c) => tryRoute(c, () => deps.business.locations(deps.defaultBusinessId))
2207
+ );
2195
2208
  app.get("/business/hours", (c) => tryRoute(c, () => deps.business.hours(deps.defaultBusinessId)));
2196
2209
  app.get("/catalogue", (c) => tryRoute(c, () => deps.catalogue.snapshot(deps.defaultBusinessId)));
2197
2210
  app.get(
@@ -2206,57 +2219,165 @@ function buildV1(deps) {
2206
2219
  })
2207
2220
  )
2208
2221
  );
2209
- app.get("/catalogue/products/:product_id", (c) => tryRoute(c, () => deps.catalogue.getProduct(c.req.param("product_id"))));
2210
- app.get("/catalogue/products/:product_id/variants", (c) => tryRoute(c, () => deps.catalogue.getProductVariants(c.req.param("product_id"))));
2211
- app.get("/catalogue/products/:product_id/variant-axes", (c) => tryRoute(c, () => deps.catalogue.getProductVariantAxes(c.req.param("product_id"))));
2222
+ app.get(
2223
+ "/catalogue/products/:product_id",
2224
+ (c) => tryRoute(c, () => deps.catalogue.getProduct(c.req.param("product_id")))
2225
+ );
2226
+ app.get(
2227
+ "/catalogue/products/:product_id/variants",
2228
+ (c) => tryRoute(c, () => deps.catalogue.getProductVariants(c.req.param("product_id")))
2229
+ );
2230
+ app.get(
2231
+ "/catalogue/products/:product_id/variant-axes",
2232
+ (c) => tryRoute(c, () => deps.catalogue.getProductVariantAxes(c.req.param("product_id")))
2233
+ );
2212
2234
  app.get(
2213
2235
  "/catalogue/products/:product_id/variants/:variant_id",
2214
- (c) => tryRoute(c, () => deps.catalogue.getProductVariantById(c.req.param("product_id"), c.req.param("variant_id")))
2236
+ (c) => tryRoute(
2237
+ c,
2238
+ () => deps.catalogue.getProductVariantById(c.req.param("product_id"), c.req.param("variant_id"))
2239
+ )
2215
2240
  );
2216
2241
  app.post("/catalogue/products/:product_id/variants/find", async (c) => {
2217
2242
  const body = await c.req.json().catch(() => ({}));
2218
2243
  return tryRoute(
2219
2244
  c,
2220
- () => deps.catalogue.findProductVariant(c.req.param("product_id"), body.axis_selections ?? body.properties ?? {})
2245
+ () => deps.catalogue.findProductVariant(
2246
+ c.req.param("product_id"),
2247
+ body.axis_selections ?? body.properties ?? {}
2248
+ )
2221
2249
  );
2222
2250
  });
2223
- app.get("/catalogue/products/:product_id/add-ons", (c) => tryRoute(c, () => deps.catalogue.getProductAddOns(c.req.param("product_id"))));
2224
- app.get("/catalogue/categories", (c) => tryRoute(c, () => deps.catalogue.listCategories(deps.defaultBusinessId)));
2225
- app.get("/catalogue/categories/:category_id", (c) => tryRoute(c, () => deps.catalogue.getCategory(c.req.param("category_id"))));
2226
- app.get("/catalogue/categories/:category_id/products", (c) => tryRoute(c, () => deps.catalogue.getCategoryProducts(c.req.param("category_id"))));
2227
- app.get("/catalogue/categories/:category_id/attributes", (c) => tryRoute(c, () => deps.catalogue.getCategoryAttributes(c.req.param("category_id"))));
2228
- app.get("/catalogue/categories/:category_id/deals", (c) => tryRoute(c, () => deps.catalogue.getCategoryDeals(c.req.param("category_id"))));
2229
- app.get("/catalogue/collections", (c) => tryRoute(c, () => deps.catalogue.listCollections(deps.defaultBusinessId)));
2230
- app.get("/catalogue/collections/:collection_id", (c) => tryRoute(c, () => deps.catalogue.getCollection(c.req.param("collection_id"))));
2231
- app.get("/catalogue/collections/:collection_id/products", (c) => tryRoute(c, () => deps.catalogue.getCollectionProducts(c.req.param("collection_id"))));
2232
- app.get("/catalogue/collections/:collection_id/attributes", (c) => tryRoute(c, () => deps.catalogue.getCollectionAttributes(c.req.param("collection_id"))));
2233
- app.get("/catalogue/collections/:collection_id/deals", (c) => tryRoute(c, () => deps.catalogue.getCollectionDeals(c.req.param("collection_id"))));
2234
- app.get("/catalogue/bundles", (c) => tryRoute(c, () => deps.catalogue.listBundles(deps.defaultBusinessId)));
2235
- app.get("/catalogue/bundles/:bundle_id", (c) => tryRoute(c, () => deps.catalogue.getBundle(c.req.param("bundle_id"))));
2236
- app.get("/catalogue/composites", (c) => tryRoute(c, () => deps.catalogue.listComposites(deps.defaultBusinessId)));
2237
- app.get("/catalogue/composites/by-product/:product_id", (c) => tryRoute(c, () => deps.catalogue.getCompositeByProduct(c.req.param("product_id"))));
2238
- app.get("/catalogue/composites/:composite_id", (c) => tryRoute(c, () => deps.catalogue.getComposite(c.req.param("composite_id"))));
2251
+ app.get(
2252
+ "/catalogue/products/:product_id/add-ons",
2253
+ (c) => tryRoute(c, () => deps.catalogue.getProductAddOns(c.req.param("product_id")))
2254
+ );
2255
+ app.get(
2256
+ "/catalogue/categories",
2257
+ (c) => tryRoute(c, () => deps.catalogue.listCategories(deps.defaultBusinessId))
2258
+ );
2259
+ app.get(
2260
+ "/catalogue/categories/:category_id",
2261
+ (c) => tryRoute(c, () => deps.catalogue.getCategory(c.req.param("category_id")))
2262
+ );
2263
+ app.get(
2264
+ "/catalogue/categories/:category_id/products",
2265
+ (c) => tryRoute(c, () => deps.catalogue.getCategoryProducts(c.req.param("category_id")))
2266
+ );
2267
+ app.get(
2268
+ "/catalogue/categories/:category_id/attributes",
2269
+ (c) => tryRoute(c, () => deps.catalogue.getCategoryAttributes(c.req.param("category_id")))
2270
+ );
2271
+ app.get(
2272
+ "/catalogue/categories/:category_id/deals",
2273
+ (c) => tryRoute(c, () => deps.catalogue.getCategoryDeals(c.req.param("category_id")))
2274
+ );
2275
+ app.get(
2276
+ "/catalogue/collections",
2277
+ (c) => tryRoute(c, () => deps.catalogue.listCollections(deps.defaultBusinessId))
2278
+ );
2279
+ app.get(
2280
+ "/catalogue/collections/:collection_id",
2281
+ (c) => tryRoute(c, () => deps.catalogue.getCollection(c.req.param("collection_id")))
2282
+ );
2283
+ app.get(
2284
+ "/catalogue/collections/:collection_id/products",
2285
+ (c) => tryRoute(c, () => deps.catalogue.getCollectionProducts(c.req.param("collection_id")))
2286
+ );
2287
+ app.get(
2288
+ "/catalogue/collections/:collection_id/attributes",
2289
+ (c) => tryRoute(c, () => deps.catalogue.getCollectionAttributes(c.req.param("collection_id")))
2290
+ );
2291
+ app.get(
2292
+ "/catalogue/collections/:collection_id/deals",
2293
+ (c) => tryRoute(c, () => deps.catalogue.getCollectionDeals(c.req.param("collection_id")))
2294
+ );
2295
+ app.get(
2296
+ "/catalogue/bundles",
2297
+ (c) => tryRoute(c, () => deps.catalogue.listBundles(deps.defaultBusinessId))
2298
+ );
2299
+ app.get(
2300
+ "/catalogue/bundles/:bundle_id",
2301
+ (c) => tryRoute(c, () => deps.catalogue.getBundle(c.req.param("bundle_id")))
2302
+ );
2303
+ app.get(
2304
+ "/catalogue/composites",
2305
+ (c) => tryRoute(c, () => deps.catalogue.listComposites(deps.defaultBusinessId))
2306
+ );
2307
+ app.get(
2308
+ "/catalogue/composites/by-product/:product_id",
2309
+ (c) => tryRoute(c, () => deps.catalogue.getCompositeByProduct(c.req.param("product_id")))
2310
+ );
2311
+ app.get(
2312
+ "/catalogue/composites/:composite_id",
2313
+ (c) => tryRoute(c, () => deps.catalogue.getComposite(c.req.param("composite_id")))
2314
+ );
2239
2315
  app.post("/catalogue/composites/:composite_id/calculate-price", async (c) => {
2240
2316
  const body = await c.req.json().catch(() => ({}));
2241
- return tryRoute(c, () => deps.catalogue.calculateCompositePrice(c.req.param("composite_id"), body));
2317
+ return tryRoute(
2318
+ c,
2319
+ () => deps.catalogue.calculateCompositePrice(c.req.param("composite_id"), body)
2320
+ );
2242
2321
  });
2243
- app.get("/catalogue/taxonomies", (c) => tryRoute(c, () => deps.catalogue.listTaxonomies(deps.defaultBusinessId)));
2244
- app.get("/catalogue/taxonomies/search", (c) => tryRoute(c, () => deps.catalogue.searchTaxonomies(deps.defaultBusinessId, c.req.query("q") ?? "")));
2245
- app.get("/catalogue/taxonomies/:taxonomy_id", (c) => tryRoute(c, () => deps.catalogue.getTaxonomy(c.req.param("taxonomy_id"))));
2246
- app.get("/catalogue/taxonomies/:taxonomy_id/attributes", (c) => tryRoute(c, () => deps.catalogue.getTaxonomyAttributes(c.req.param("taxonomy_id"))));
2247
- app.get("/catalogue/taxonomies/:taxonomy_id/path", (c) => tryRoute(c, () => deps.catalogue.getTaxonomyPath(c.req.param("taxonomy_id"))));
2248
- app.get("/catalogue/attributes", (c) => tryRoute(c, () => deps.catalogue.listAttributes(deps.defaultBusinessId)));
2249
- app.get("/catalogue/properties/facets", (c) => tryRoute(c, () => deps.catalogue.listPropertyFacets(deps.defaultBusinessId)));
2250
- app.get("/catalogue/tags", (c) => tryRoute(c, () => deps.catalogue.listTags(deps.defaultBusinessId)));
2322
+ app.get(
2323
+ "/catalogue/taxonomies",
2324
+ (c) => tryRoute(c, () => deps.catalogue.listTaxonomies(deps.defaultBusinessId))
2325
+ );
2326
+ app.get(
2327
+ "/catalogue/taxonomies/search",
2328
+ (c) => tryRoute(
2329
+ c,
2330
+ () => deps.catalogue.searchTaxonomies(deps.defaultBusinessId, c.req.query("q") ?? "")
2331
+ )
2332
+ );
2333
+ app.get(
2334
+ "/catalogue/taxonomies/:taxonomy_id",
2335
+ (c) => tryRoute(c, () => deps.catalogue.getTaxonomy(c.req.param("taxonomy_id")))
2336
+ );
2337
+ app.get(
2338
+ "/catalogue/taxonomies/:taxonomy_id/attributes",
2339
+ (c) => tryRoute(c, () => deps.catalogue.getTaxonomyAttributes(c.req.param("taxonomy_id")))
2340
+ );
2341
+ app.get(
2342
+ "/catalogue/taxonomies/:taxonomy_id/path",
2343
+ (c) => tryRoute(c, () => deps.catalogue.getTaxonomyPath(c.req.param("taxonomy_id")))
2344
+ );
2345
+ app.get(
2346
+ "/catalogue/attributes",
2347
+ (c) => tryRoute(c, () => deps.catalogue.listAttributes(deps.defaultBusinessId))
2348
+ );
2349
+ app.get(
2350
+ "/catalogue/properties/facets",
2351
+ (c) => tryRoute(c, () => deps.catalogue.listPropertyFacets(deps.defaultBusinessId))
2352
+ );
2353
+ app.get(
2354
+ "/catalogue/tags",
2355
+ (c) => tryRoute(c, () => deps.catalogue.listTags(deps.defaultBusinessId))
2356
+ );
2251
2357
  app.get("/catalogue/menu", (c) => tryRoute(c, () => deps.lite.getMenu(deps.defaultBusinessId)));
2252
- app.get("/catalogue/menu/categories/:category_id", (c) => tryRoute(c, () => deps.lite.getMenuCategory(c.req.param("category_id"))));
2253
- app.get("/catalogue/menu/items/:item_id", (c) => tryRoute(c, () => deps.catalogue.getProduct(c.req.param("item_id"))));
2254
- app.get("/catalogue/knowledge-base/articles", (c) => tryRoute(c, () => ({ articles: deps.catalogue.listKnowledgeArticles(deps.defaultBusinessId) })));
2358
+ app.get(
2359
+ "/catalogue/menu/categories/:category_id",
2360
+ (c) => tryRoute(c, () => deps.lite.getMenuCategory(c.req.param("category_id")))
2361
+ );
2362
+ app.get(
2363
+ "/catalogue/menu/items/:item_id",
2364
+ (c) => tryRoute(c, () => deps.catalogue.getProduct(c.req.param("item_id")))
2365
+ );
2366
+ app.get(
2367
+ "/catalogue/knowledge-base/articles",
2368
+ (c) => tryRoute(c, () => ({ articles: deps.catalogue.listKnowledgeArticles(deps.defaultBusinessId) }))
2369
+ );
2255
2370
  app.get(
2256
2371
  "/catalogue/knowledge-base/search",
2257
- (c) => tryRoute(c, () => ({ results: deps.catalogue.searchKnowledgeBase(deps.defaultBusinessId, c.req.query("q") ?? ""), query: c.req.query("q") ?? "" }))
2372
+ (c) => tryRoute(c, () => ({
2373
+ results: deps.catalogue.searchKnowledgeBase(deps.defaultBusinessId, c.req.query("q") ?? ""),
2374
+ query: c.req.query("q") ?? ""
2375
+ }))
2376
+ );
2377
+ app.get(
2378
+ "/catalogue/products/:product_id/attributes",
2379
+ (c) => tryRoute(c, () => deps.catalogue.getProductAttributes(c.req.param("product_id")))
2258
2380
  );
2259
- app.get("/catalogue/products/:product_id/attributes", (c) => tryRoute(c, () => deps.catalogue.getProductAttributes(c.req.param("product_id"))));
2260
2381
  app.get(
2261
2382
  "/catalogue/products/:product_id/available-now",
2262
2383
  (c) => tryRoute(c, () => {
@@ -2275,22 +2396,45 @@ function buildV1(deps) {
2275
2396
  "/catalogue/products/:product_id/schedules",
2276
2397
  (c) => tryRoute(c, () => {
2277
2398
  const p = deps.registry.products.get(c.req.param("product_id"));
2278
- return { schedules: p?.metadata?.["time_profiles"] ?? [] };
2399
+ return {
2400
+ schedules: p?.metadata?.["time_profiles"] ?? []
2401
+ };
2279
2402
  })
2280
2403
  );
2281
- app.get("/catalogue/deals", (c) => tryRoute(c, () => deps.catalogue.listDeals(deps.defaultBusinessId)));
2282
- app.get("/catalogue/deals/on-sale", (c) => tryRoute(c, () => deps.catalogue.listOnSale(deps.defaultBusinessId)));
2404
+ app.get(
2405
+ "/catalogue/deals",
2406
+ (c) => tryRoute(c, () => deps.catalogue.listDeals(deps.defaultBusinessId))
2407
+ );
2408
+ app.get(
2409
+ "/catalogue/deals/on-sale",
2410
+ (c) => tryRoute(c, () => deps.catalogue.listOnSale(deps.defaultBusinessId))
2411
+ );
2283
2412
  app.post("/catalogue/deals/validate", async (c) => {
2284
2413
  const body = await c.req.json().catch(() => ({}));
2285
- return tryRoute(c, () => deps.catalogue.validateDiscount(body.discount_code ?? body.code ?? "", deps.defaultBusinessId));
2414
+ return tryRoute(
2415
+ c,
2416
+ () => deps.catalogue.validateDiscount(
2417
+ body.discount_code ?? body.code ?? "",
2418
+ deps.defaultBusinessId
2419
+ )
2420
+ );
2286
2421
  });
2287
- app.get("/catalogue/products/:product_id/deals", (c) => tryRoute(c, () => deps.catalogue.getProductDeals(c.req.param("product_id"))));
2422
+ app.get(
2423
+ "/catalogue/products/:product_id/deals",
2424
+ (c) => tryRoute(c, () => deps.catalogue.getProductDeals(c.req.param("product_id")))
2425
+ );
2288
2426
  app.post("/catalogue/quotes", async (c) => {
2289
2427
  const body = await c.req.json().catch(() => ({}));
2290
2428
  return tryRoute(c, () => deps.catalogue.createQuote(deps.defaultBusinessId, body));
2291
2429
  });
2292
- app.get("/catalogue/quotes/:quote_id", (c) => tryRoute(c, () => deps.catalogue.getQuote(c.req.param("quote_id"))));
2293
- app.post("/catalogue/quotes/:quote_id/refresh", (c) => tryRoute(c, () => deps.catalogue.refreshQuote(c.req.param("quote_id"))));
2430
+ app.get(
2431
+ "/catalogue/quotes/:quote_id",
2432
+ (c) => tryRoute(c, () => deps.catalogue.getQuote(c.req.param("quote_id")))
2433
+ );
2434
+ app.post(
2435
+ "/catalogue/quotes/:quote_id/refresh",
2436
+ (c) => tryRoute(c, () => deps.catalogue.refreshQuote(c.req.param("quote_id")))
2437
+ );
2294
2438
  app.get("/cart", (c) => tryRoute(c, () => deps.cart.toUICart(deps.cart.get(c.var.session))));
2295
2439
  app.delete("/cart", (c) => tryRoute(c, () => deps.cart.clear(c.var.session)));
2296
2440
  app.get("/cart/items", (c) => tryRoute(c, () => deps.cart.getItems(c.var.session)));
@@ -2301,9 +2445,15 @@ function buildV1(deps) {
2301
2445
  app.patch("/cart/items/:cart_item_id", async (c) => {
2302
2446
  const body = await c.req.json().catch(() => ({}));
2303
2447
  if (typeof body.quantity !== "number") return fail(c, validation("quantity required"));
2304
- return tryRoute(c, () => deps.cart.updateQuantity(c.var.session, c.req.param("cart_item_id"), body.quantity));
2448
+ return tryRoute(
2449
+ c,
2450
+ () => deps.cart.updateQuantity(c.var.session, c.req.param("cart_item_id"), body.quantity)
2451
+ );
2305
2452
  });
2306
- app.delete("/cart/items/:cart_item_id", (c) => tryRoute(c, () => deps.cart.removeItem(c.var.session, c.req.param("cart_item_id"))));
2453
+ app.delete(
2454
+ "/cart/items/:cart_item_id",
2455
+ (c) => tryRoute(c, () => deps.cart.removeItem(c.var.session, c.req.param("cart_item_id")))
2456
+ );
2307
2457
  app.get("/cart/count", (c) => tryRoute(c, () => deps.cart.getCount(c.var.session)));
2308
2458
  app.get("/cart/total", (c) => tryRoute(c, () => deps.cart.getTotal(c.var.session)));
2309
2459
  app.post("/cart/destination-quote", async (c) => {
@@ -2314,10 +2464,25 @@ function buildV1(deps) {
2314
2464
  const body = await c.req.json().catch(() => ({}));
2315
2465
  return tryRoute(c, () => deps.cart.applyCoupon(c.var.session, body.coupon_code ?? ""));
2316
2466
  });
2317
- app.delete("/cart/coupons/current", (c) => tryRoute(c, () => deps.cart.removeCoupon(c.var.session)));
2318
- app.get("/orders", (c) => tryRoute(c, () => deps.orders.list(c.var.session, { limit: getQueryNum(c, "limit"), status: c.req.query("status") })));
2467
+ app.delete(
2468
+ "/cart/coupons/current",
2469
+ (c) => tryRoute(c, () => deps.cart.removeCoupon(c.var.session))
2470
+ );
2471
+ app.get(
2472
+ "/orders",
2473
+ (c) => tryRoute(
2474
+ c,
2475
+ () => deps.orders.list(c.var.session, {
2476
+ limit: getQueryNum(c, "limit"),
2477
+ status: c.req.query("status")
2478
+ })
2479
+ )
2480
+ );
2319
2481
  app.get("/orders/:order_id", (c) => tryRoute(c, () => deps.orders.get(c.req.param("order_id"))));
2320
- app.get("/orders/:order_id/payment-status", (c) => tryRoute(c, () => deps.orders.getPaymentStatus(c.req.param("order_id"))));
2482
+ app.get(
2483
+ "/orders/:order_id/payment-status",
2484
+ (c) => tryRoute(c, () => deps.orders.getPaymentStatus(c.req.param("order_id")))
2485
+ );
2321
2486
  app.post("/orders/:order_id/cancel", async (c) => {
2322
2487
  const body = await c.req.json().catch(() => ({}));
2323
2488
  return tryRoute(c, () => deps.orders.cancel(c.req.param("order_id"), body.reason));
@@ -2326,13 +2491,46 @@ function buildV1(deps) {
2326
2491
  const body = await c.req.json().catch(() => ({}));
2327
2492
  return tryRoute(c, () => deps.orders.updateCustomer(c.req.param("order_id"), body));
2328
2493
  });
2329
- app.post("/orders/:order_id/verify-payment", (c) => tryRoute(c, () => deps.orders.verifyPayment(c.req.param("order_id"))));
2494
+ app.post(
2495
+ "/orders/:order_id/verify-payment",
2496
+ (c) => tryRoute(c, () => deps.orders.verifyPayment(c.req.param("order_id")))
2497
+ );
2330
2498
  app.get("/subscriptions", (c) => tryRoute(c, () => deps.subscriptions.list(c.var.session)));
2331
- app.get("/subscriptions/:subscription_id", (c) => tryRoute(c, () => deps.subscriptions.get(c.req.param("subscription_id"))));
2332
- app.post("/subscriptions/:subscription_id/cancel", (c) => tryRoute(c, () => deps.subscriptions.cancel(c.req.param("subscription_id"))));
2333
- app.post("/subscriptions/:subscription_id/pause", (c) => tryRoute(c, () => deps.subscriptions.pause(c.req.param("subscription_id"))));
2334
- app.post("/subscriptions/:subscription_id/resume", (c) => tryRoute(c, () => deps.subscriptions.resume(c.req.param("subscription_id"))));
2335
- app.post("/subscriptions/:subscription_id/skip", (c) => tryRoute(c, () => deps.subscriptions.skipNext(c.req.param("subscription_id"))));
2499
+ app.get(
2500
+ "/subscriptions/:subscription_id",
2501
+ (c) => tryRoute(c, () => deps.subscriptions.get(c.req.param("subscription_id")))
2502
+ );
2503
+ app.post(
2504
+ "/subscriptions/:subscription_id/cancel",
2505
+ (c) => tryRoute(c, () => deps.subscriptions.cancel(c.req.param("subscription_id")))
2506
+ );
2507
+ app.post(
2508
+ "/subscriptions/:subscription_id/pause",
2509
+ (c) => tryRoute(c, () => deps.subscriptions.pause(c.req.param("subscription_id")))
2510
+ );
2511
+ app.post(
2512
+ "/subscriptions/:subscription_id/resume",
2513
+ (c) => tryRoute(c, () => deps.subscriptions.resume(c.req.param("subscription_id")))
2514
+ );
2515
+ app.post(
2516
+ "/subscriptions/:subscription_id/skip",
2517
+ (c) => tryRoute(c, () => deps.subscriptions.skipNext(c.req.param("subscription_id")))
2518
+ );
2519
+ app.get("/payments/collection-options", (c) => {
2520
+ const currency = c.req.query("currency")?.trim().toUpperCase();
2521
+ if (!currency || !/^[A-Z]{3}$/.test(currency)) {
2522
+ return fail(c, validation("currency must be a canonical three-letter code"));
2523
+ }
2524
+ return tryRoute(c, () => ({
2525
+ presentment_currency: currency,
2526
+ options: currency === "GHS" ? [
2527
+ { method: PAYMENT_METHOD.CARD, network: null },
2528
+ { method: PAYMENT_METHOD.MOBILE_MONEY, network: "mtn" },
2529
+ { method: PAYMENT_METHOD.MOBILE_MONEY, network: "telecel" },
2530
+ { method: PAYMENT_METHOD.MOBILE_MONEY, network: "airteltigo" }
2531
+ ] : currency === "USD" ? [{ method: PAYMENT_METHOD.CARD, network: null }] : []
2532
+ }));
2533
+ });
2336
2534
  app.post("/checkout", async (c) => {
2337
2535
  const body = await c.req.json().catch(() => ({}));
2338
2536
  return tryRoute(c, () => deps.checkout.process(c.var.session, body));
@@ -2386,15 +2584,33 @@ function buildV1(deps) {
2386
2584
  return { success: true, message: "Profile updated successfully" };
2387
2585
  });
2388
2586
  });
2389
- app.get("/inventory/products/:product_id/stock", (c) => tryRoute(c, () => deps.inventory.productStock(c.req.param("product_id"))));
2390
- app.get("/inventory/variants/:variant_id/stock", (c) => tryRoute(c, () => deps.inventory.variantStock(c.req.param("variant_id"))));
2587
+ app.get(
2588
+ "/inventory/products/:product_id/stock",
2589
+ (c) => tryRoute(c, () => deps.inventory.productStock(c.req.param("product_id")))
2590
+ );
2591
+ app.get(
2592
+ "/inventory/variants/:variant_id/stock",
2593
+ (c) => tryRoute(c, () => deps.inventory.variantStock(c.req.param("variant_id")))
2594
+ );
2391
2595
  app.get(
2392
2596
  "/inventory/products/:product_id/availability",
2393
- (c) => tryRoute(c, () => deps.inventory.productAvailability(c.req.param("product_id"), getQueryNum(c, "quantity") ?? 1))
2597
+ (c) => tryRoute(
2598
+ c,
2599
+ () => deps.inventory.productAvailability(
2600
+ c.req.param("product_id"),
2601
+ getQueryNum(c, "quantity") ?? 1
2602
+ )
2603
+ )
2394
2604
  );
2395
2605
  app.get(
2396
2606
  "/inventory/variants/:variant_id/availability",
2397
- (c) => tryRoute(c, () => deps.inventory.variantAvailability(c.req.param("variant_id"), getQueryNum(c, "quantity") ?? 1))
2607
+ (c) => tryRoute(
2608
+ c,
2609
+ () => deps.inventory.variantAvailability(
2610
+ c.req.param("variant_id"),
2611
+ getQueryNum(c, "quantity") ?? 1
2612
+ )
2613
+ )
2398
2614
  );
2399
2615
  app.get(
2400
2616
  "/delivery/fee",
@@ -2421,35 +2637,75 @@ function buildV1(deps) {
2421
2637
  );
2422
2638
  app.post("/places/autocomplete", async (c) => {
2423
2639
  const body = await c.req.json().catch(() => ({}));
2424
- return tryRoute(c, () => deps.places.autocomplete({ query: body.input ?? body.query ?? "", country: body.country }));
2640
+ return tryRoute(
2641
+ c,
2642
+ () => deps.places.autocomplete({ query: body.input ?? body.query ?? "", country: body.country })
2643
+ );
2425
2644
  });
2426
2645
  app.post("/places/details", async (c) => {
2427
2646
  const body = await c.req.json().catch(() => ({}));
2428
2647
  return tryRoute(c, () => deps.places.details({ place_id: body.place_id ?? "" }));
2429
2648
  });
2430
- app.get("/scheduling/services", (c) => tryRoute(c, () => deps.scheduling.listServices(deps.defaultBusinessId)));
2431
- app.get("/scheduling/services/:service_id", (c) => tryRoute(c, () => deps.scheduling.getService(c.req.param("service_id"))));
2432
- app.get("/scheduling/slots", (c) => tryRoute(c, () => deps.scheduling.getSlots(c.req.query("service_id") ?? "", { date: c.req.query("date") })));
2649
+ app.get(
2650
+ "/scheduling/services",
2651
+ (c) => tryRoute(c, () => deps.scheduling.listServices(deps.defaultBusinessId))
2652
+ );
2653
+ app.get(
2654
+ "/scheduling/services/:service_id",
2655
+ (c) => tryRoute(c, () => deps.scheduling.getService(c.req.param("service_id")))
2656
+ );
2657
+ app.get(
2658
+ "/scheduling/slots",
2659
+ (c) => tryRoute(
2660
+ c,
2661
+ () => deps.scheduling.getSlots(c.req.query("service_id") ?? "", { date: c.req.query("date") })
2662
+ )
2663
+ );
2433
2664
  app.get(
2434
2665
  "/scheduling/slots/check",
2435
- (c) => tryRoute(c, () => deps.scheduling.checkSlot(c.req.query("service_id") ?? "", c.req.query("start") ?? "", c.req.query("end") ?? ""))
2666
+ (c) => tryRoute(
2667
+ c,
2668
+ () => deps.scheduling.checkSlot(
2669
+ c.req.query("service_id") ?? "",
2670
+ c.req.query("start") ?? "",
2671
+ c.req.query("end") ?? ""
2672
+ )
2673
+ )
2674
+ );
2675
+ app.get(
2676
+ "/scheduling/availability",
2677
+ (c) => tryRoute(c, () => deps.scheduling.getServiceAvailability(c.req.query("service_id") ?? ""))
2678
+ );
2679
+ app.get(
2680
+ "/scheduling/bookings",
2681
+ (c) => tryRoute(c, () => deps.scheduling.getCustomerBookings(c.var.session))
2436
2682
  );
2437
- app.get("/scheduling/availability", (c) => tryRoute(c, () => deps.scheduling.getServiceAvailability(c.req.query("service_id") ?? "")));
2438
- app.get("/scheduling/bookings", (c) => tryRoute(c, () => deps.scheduling.getCustomerBookings(c.var.session)));
2439
2683
  app.post("/scheduling/bookings/reschedule", async (c) => {
2440
2684
  const body = await c.req.json().catch(() => ({}));
2441
2685
  return tryRoute(c, () => deps.scheduling.rescheduleBooking(body));
2442
2686
  });
2443
- app.get("/scheduling/bookings/:booking_id", (c) => tryRoute(c, () => deps.scheduling.getBooking(c.req.param("booking_id"))));
2687
+ app.get(
2688
+ "/scheduling/bookings/:booking_id",
2689
+ (c) => tryRoute(c, () => deps.scheduling.getBooking(c.req.param("booking_id")))
2690
+ );
2444
2691
  app.post("/scheduling/bookings/:booking_id/cancel", async (c) => {
2445
2692
  const body = await c.req.json().catch(() => ({}));
2446
2693
  return tryRoute(c, () => deps.scheduling.cancelBooking(c.req.param("booking_id"), body.reason));
2447
2694
  });
2448
2695
  app.get("/lite/bootstrap", (c) => tryRoute(c, () => deps.lite.bootstrap(deps.defaultBusinessId)));
2449
- app.get("/lite/resources/:resource_id", (c) => tryRoute(c, () => deps.lite.getResource(c.req.param("resource_id"))));
2696
+ app.get(
2697
+ "/lite/resources/:resource_id",
2698
+ (c) => tryRoute(c, () => deps.lite.getResource(c.req.param("resource_id")))
2699
+ );
2450
2700
  app.get("/lite/menu", (c) => tryRoute(c, () => deps.lite.getMenu(deps.defaultBusinessId)));
2451
- app.get("/lite/menu/categories/:category_id", (c) => tryRoute(c, () => deps.lite.getMenuCategory(c.req.param("category_id"))));
2452
- app.get("/fx/rate", (c) => tryRoute(c, () => deps.fx.getRate(c.req.query("from") ?? "USD", c.req.query("to") ?? "GHS")));
2701
+ app.get(
2702
+ "/lite/menu/categories/:category_id",
2703
+ (c) => tryRoute(c, () => deps.lite.getMenuCategory(c.req.param("category_id")))
2704
+ );
2705
+ app.get(
2706
+ "/fx/rate",
2707
+ (c) => tryRoute(c, () => deps.fx.getRate(c.req.query("from") ?? "USD", c.req.query("to") ?? "GHS"))
2708
+ );
2453
2709
  app.post("/fx/quotes", async (c) => {
2454
2710
  const body = await c.req.json().catch(() => ({}));
2455
2711
  return tryRoute(c, () => deps.fx.lockQuote(body));
@@ -2462,31 +2718,47 @@ function buildV1(deps) {
2462
2718
  const body = await c.req.json().catch(() => ({}));
2463
2719
  return tryRoute(c, () => deps.uploads.confirm(body));
2464
2720
  });
2465
- app.get(
2466
- "/store-credit/balance",
2467
- (c) => c.json({ data: { balance: "0.00", currency: "USD" } })
2468
- );
2721
+ app.get("/store-credit/balance", (c) => c.json({ data: { balance: "0.00", currency: "USD" } }));
2469
2722
  app.post("/activity/session", async (c) => {
2470
2723
  await c.req.json().catch(() => ({}));
2471
2724
  return c.json({ data: { recorded: true } });
2472
2725
  });
2473
2726
  app.post("/activity/events", async (c) => {
2474
2727
  const body = await c.req.json().catch(() => ({}));
2475
- return tryRoute(c, () => deps.activity.recordEvents(deps.defaultBusinessId, body.analytics_session_id ?? c.var.session.id, body.events ?? []));
2728
+ return tryRoute(
2729
+ c,
2730
+ () => deps.activity.recordEvents(
2731
+ deps.defaultBusinessId,
2732
+ body.analytics_session_id ?? c.var.session.id,
2733
+ body.events ?? []
2734
+ )
2735
+ );
2476
2736
  });
2477
- app.get("/activity/state", (c) => tryRoute(c, () => deps.activity.getState(deps.defaultBusinessId, c.var.session.id)));
2478
- app.get("/activity/recommendations", (c) => tryRoute(c, () => deps.activity.getRecommendations(deps.defaultBusinessId)));
2737
+ app.get(
2738
+ "/activity/state",
2739
+ (c) => tryRoute(c, () => deps.activity.getState(deps.defaultBusinessId, c.var.session.id))
2740
+ );
2741
+ app.get(
2742
+ "/activity/recommendations",
2743
+ (c) => tryRoute(c, () => deps.activity.getRecommendations(deps.defaultBusinessId))
2744
+ );
2479
2745
  app.post("/activity/messages/dismiss", async (c) => {
2480
2746
  const body = await c.req.json().catch(() => ({}));
2481
2747
  return tryRoute(c, () => deps.activity.dismissMessage(body.code ?? body.message_id ?? ""));
2482
2748
  });
2483
2749
  app.post(
2484
2750
  "/support/conversation",
2485
- (c) => tryRoute(c, () => deps.support.openConversation(deps.defaultBusinessId, c.var.session.customer_id))
2751
+ (c) => tryRoute(
2752
+ c,
2753
+ () => deps.support.openConversation(deps.defaultBusinessId, c.var.session.customer_id)
2754
+ )
2486
2755
  );
2487
2756
  app.get(
2488
2757
  "/support/conversation",
2489
- (c) => tryRoute(c, () => deps.support.peekConversation(deps.defaultBusinessId, c.var.session.customer_id))
2758
+ (c) => tryRoute(
2759
+ c,
2760
+ () => deps.support.peekConversation(deps.defaultBusinessId, c.var.session.customer_id)
2761
+ )
2490
2762
  );
2491
2763
  app.post("/support/conversation/messages", async (c) => {
2492
2764
  const body = await c.req.json().catch(() => ({}));
@@ -2502,7 +2774,12 @@ function buildV1(deps) {
2502
2774
  });
2503
2775
  app.get(
2504
2776
  "/support/conversation/messages",
2505
- (c) => tryRoute(c, () => deps.support.listMessages(c.req.query("conversation_id") ?? "", { limit: getQueryNum(c, "limit") }))
2777
+ (c) => tryRoute(
2778
+ c,
2779
+ () => deps.support.listMessages(c.req.query("conversation_id") ?? "", {
2780
+ limit: getQueryNum(c, "limit")
2781
+ })
2782
+ )
2506
2783
  );
2507
2784
  app.post("/support/conversation/messages/:messageId/reactions", async (c) => {
2508
2785
  const body = await c.req.json().catch(() => ({}));
@@ -2523,7 +2800,10 @@ function buildV1(deps) {
2523
2800
  });
2524
2801
  app.get(
2525
2802
  "/support/conversation/ws",
2526
- (c) => c.json({ note: "WebSocket connection \u2014 connect via ws:// at the same path", supported: false }, 426)
2803
+ (c) => c.json(
2804
+ { note: "WebSocket connection \u2014 connect via ws:// at the same path", supported: false },
2805
+ 426
2806
+ )
2527
2807
  );
2528
2808
  return app;
2529
2809
  }
@@ -4659,6 +4939,7 @@ function toUICart(registry, cart) {
4659
4939
  tax_rate: cart.tax_rate,
4660
4940
  service_charge_rate: cart.service_charge_rate,
4661
4941
  tax_inclusive: false,
4942
+ price_display_mode: "unspecified",
4662
4943
  deposit_required: false,
4663
4944
  deposit_amount: "0.00"
4664
4945
  },
@@ -4818,6 +5099,7 @@ function createCartService(opts) {
4818
5099
  tax_jurisdiction_label: label,
4819
5100
  tax_inclusive: false,
4820
5101
  tax_rate: cart.tax_rate,
5102
+ price_display_mode: "unspecified",
4821
5103
  delivery_fee_details: null,
4822
5104
  address_info: body.address_info
4823
5105
  };
@@ -4973,9 +5255,11 @@ function createCheckoutService(opts) {
4973
5255
  if (c.items.length === 0) throw validation("Cart is empty", { code: "CART_EMPTY" });
4974
5256
  const orderId = ids.order();
4975
5257
  const orderNumber = ids.orderNumber();
5258
+ const paymentId = ids.payment();
4976
5259
  const reference = ids.payment();
4977
5260
  const requiresAuth = body.payment_method === "mobile_money";
4978
5261
  const isCard = body.payment_method === "card" || body.payment_method === "stripe";
5262
+ const cardProvider = body.payment_method === "stripe" || body.pay_currency?.toUpperCase() === "USD" ? "stripe" : "paystack";
4979
5263
  const order = {
4980
5264
  id: orderId,
4981
5265
  business_id: c.business_id,
@@ -4999,6 +5283,7 @@ function createCheckoutService(opts) {
4999
5283
  items: c.items,
5000
5284
  applied_discount_ids: c.applied_discount_ids,
5001
5285
  applied_discount_codes: c.applied_discount_codes,
5286
+ payment_id: paymentId,
5002
5287
  payment_reference: reference,
5003
5288
  metadata: body.metadata,
5004
5289
  created_at: clock.iso(),
@@ -5015,31 +5300,57 @@ function createCheckoutService(opts) {
5015
5300
  const result = {
5016
5301
  order_id: orderId,
5017
5302
  order_number: orderNumber,
5018
- payment_status: requiresAuth ? "pending" : "succeeded",
5303
+ payment_id: paymentId,
5304
+ payment_status: requiresAuth || isCard ? "pending" : "succeeded",
5019
5305
  payment_reference: reference,
5020
5306
  requires_authorization: requiresAuth,
5021
5307
  authorization_type: requiresAuth ? "otp" : void 0,
5022
- next_action: requiresAuth ? { type: "authorization", authorization_type: "otp", display_text: "Approve on your mobile money app" } : { type: "none" },
5023
- provider: body.payment_method,
5308
+ next_action: requiresAuth ? {
5309
+ type: "authorization",
5310
+ authorization_type: "otp",
5311
+ display_text: "Approve on your mobile money app"
5312
+ } : { type: "none" },
5313
+ provider: isCard ? cardProvider : body.payment_method,
5024
5314
  bill_token: billToken
5025
5315
  };
5026
5316
  if (isCard) {
5027
- result.next_action = { type: "redirect", authorization_url: `https://mock.cimplify.io/pay/${reference}` };
5028
- result.authorization_url = `https://mock.cimplify.io/pay/${reference}`;
5029
- result.client_secret = `pi_${orderId.slice(-12)}_secret_${Math.random().toString(36).slice(2, 18)}`;
5030
5317
  const proc = globalThis.process;
5031
- result.public_key = proc?.env?.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY ?? "pk_test_mock_publishable_key";
5318
+ result.client_secret = cardProvider === "stripe" ? `pi_${orderId.slice(-12)}_secret_${Math.random().toString(36).slice(2, 18)}` : `access_${reference}`;
5319
+ result.public_key = cardProvider === "stripe" ? proc?.env?.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY ?? "pk_test_mock_stripe" : proc?.env?.NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY ?? "pk_test_mock_paystack";
5320
+ result.next_action = {
5321
+ type: "card_popup",
5322
+ provider: cardProvider,
5323
+ client_secret: result.client_secret,
5324
+ public_key: result.public_key
5325
+ };
5032
5326
  }
5033
5327
  return result;
5034
5328
  },
5035
5329
  authorize(body) {
5036
- const order = registry.orders.get(body.order_id);
5037
- if (!order) throw notFound(`Order ${body.order_id} not found`);
5038
- const updated = { ...order, payment_state: "paid", status: "confirmed", updated_at: clock.iso() };
5330
+ if (!body.payment_id?.trim()) throw validation("payment_id required");
5331
+ if (!body.authorization) throw validation("authorization required");
5332
+ const order = registry.orders.list(
5333
+ (candidate) => candidate.payment_id === body.payment_id
5334
+ )[0];
5335
+ if (!order) throw notFound(`Payment ${body.payment_id} not found`);
5336
+ const updated = {
5337
+ ...order,
5338
+ payment_state: "paid",
5339
+ status: "confirmed",
5340
+ updated_at: clock.iso()
5341
+ };
5039
5342
  registry.orders.put(order.id, updated);
5040
5343
  bus.emit("order.payment.captured", { order_id: order.id }, order.business_id);
5041
5344
  bus.emit("order.confirmed", { order_id: order.id }, order.business_id);
5042
- return { status: "succeeded", order_id: order.id };
5345
+ return {
5346
+ order_id: order.id,
5347
+ order_number: order.user_friendly_id,
5348
+ payment_id: body.payment_id,
5349
+ payment_reference: order.payment_reference,
5350
+ payment_status: "succeeded",
5351
+ requires_authorization: false,
5352
+ next_action: { type: "none" }
5353
+ };
5043
5354
  }
5044
5355
  };
5045
5356
  }