@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.
- package/dist/advanced.d.mts +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +23 -22
- package/dist/advanced.mjs +4 -3
- package/dist/{chunk-QPRI2NII.js → chunk-2P4KXFB6.js} +6 -0
- package/dist/{chunk-4G5UWFC3.mjs → chunk-3V4DVXV3.mjs} +6 -1
- package/dist/{chunk-YHPMFTMN.mjs → chunk-C2JSNJUC.mjs} +406 -95
- package/dist/chunk-CNN7Z2IP.js +125 -0
- package/dist/{chunk-DKLHCZ5M.mjs → chunk-GERXZQSX.mjs} +487 -11
- package/dist/chunk-GOHSXBKW.mjs +105 -0
- package/dist/{chunk-7H6IL7CX.mjs → chunk-H7ACMHM3.mjs} +40 -15
- package/dist/{chunk-Z3K2D3TE.mjs → chunk-J6PNHDHL.mjs} +453 -483
- package/dist/{chunk-NIOUSKQQ.js → chunk-JG5CQNCB.js} +5 -0
- package/dist/{chunk-YER7DIOM.js → chunk-JSWJ4XDE.js} +471 -519
- package/dist/{chunk-DLW3RWRK.mjs → chunk-M4URVKHE.mjs} +46 -12
- package/dist/{chunk-WMEC5JWN.js → chunk-NNG6IFFX.js} +50 -13
- package/dist/{chunk-ICCCSVN3.js → chunk-QOWPGS7Z.js} +42 -16
- package/dist/{chunk-YDA46OZ6.js → chunk-R6OLQ33I.js} +560 -80
- package/dist/{chunk-H5SSGN7W.js → chunk-VIL6IQCG.js} +408 -97
- package/dist/{chunk-O3YUHLZL.mjs → chunk-VNPEYLB2.mjs} +5 -0
- package/dist/{client-Db554902.d.ts → client-BfpNjJ_a.d.mts} +93 -299
- package/dist/{client-CdTx7X_X.d.mts → client-DHBwvh7U.d.ts} +93 -299
- package/dist/{client-WkUcvRvO.d.mts → client-DpqRobY9.d.mts} +2 -2
- package/dist/{client-D40kI8z2.d.ts → client-Dqg2mc-7.d.ts} +2 -2
- package/dist/{index-D3UXgAYl.d.ts → index-C8uDqLwJ.d.ts} +14 -4
- package/dist/{index-BjWUkYgY.d.mts → index-e2y6AK70.d.mts} +14 -4
- package/dist/index.d.mts +92 -8
- package/dist/index.d.ts +92 -8
- package/dist/index.js +225 -188
- package/dist/index.mjs +7 -6
- package/dist/link-cuNVYc2s.d.mts +297 -0
- package/dist/link-cuNVYc2s.d.ts +297 -0
- package/dist/mock/cli.mjs +412 -94
- package/dist/mock/library.js +412 -94
- package/dist/mock/library.mjs +412 -94
- package/dist/mock/msw.js +412 -94
- package/dist/mock/msw.mjs +412 -94
- package/dist/{product-DwKdC_to.d.mts → payment-H5LoIvXU.d.mts} +207 -7
- package/dist/{product-DwKdC_to.d.ts → payment-H5LoIvXU.d.ts} +207 -7
- package/dist/{price-CiQUd_XX.d.mts → price-BvePgDXe.d.mts} +1 -1
- package/dist/{price-D9EOj8y8.d.ts → price-C2RqscMY.d.ts} +1 -1
- package/dist/react.d.mts +6 -4
- package/dist/react.d.ts +6 -4
- package/dist/react.js +203 -198
- package/dist/react.mjs +11 -6
- package/dist/{server-CeDb93WA.d.ts → server-C7FyLdrz.d.mts} +11 -9
- package/dist/{server-D-nSkrUr.d.mts → server-DoXIpSd7.d.ts} +11 -9
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +11 -10
- package/dist/server.mjs +5 -4
- package/dist/testing/msw.d.mts +2 -2
- package/dist/testing/msw.d.ts +2 -2
- package/dist/testing/msw.js +4 -3
- package/dist/testing/msw.mjs +3 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +26 -25
- package/dist/testing/suite.mjs +7 -6
- package/dist/testing.d.mts +175 -45
- package/dist/testing.d.ts +175 -45
- package/dist/testing.js +86 -81
- package/dist/testing.mjs +8 -7
- package/dist/utils.d.mts +4 -4
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +37 -29
- package/dist/utils.mjs +2 -2
- package/package.json +7 -1
- package/dist/payment-CRqjGrx6.d.mts +0 -113
- package/dist/payment-DO1Z1Ip6.d.ts +0 -113
package/dist/mock/library.js
CHANGED
|
@@ -2096,6 +2096,8 @@ var ERROR_SUGGESTIONS = {
|
|
|
2096
2096
|
PRICE_CHANGED: "Prices changed since the quote was created. Refresh pricing, show the new total to the shopper, and require explicit confirmation before re-submitting.",
|
|
2097
2097
|
PAYMENT_FAILED: "Payment provider rejected or failed processing. Show retry/change-method options to the shopper.",
|
|
2098
2098
|
PAYMENT_CANCELLED: "Payment was cancelled by the shopper or provider flow. Allow a safe retry path.",
|
|
2099
|
+
PAYMENT_CAPABILITY_MISMATCH: "Refresh collection capabilities for the exact tenant and presentment currency before retrying.",
|
|
2100
|
+
UNSUPPORTED_CURRENCY: "Choose a supported presentment currency before loading payment methods or submitting checkout.",
|
|
2099
2101
|
INSUFFICIENT_FUNDS: "Payment method has insufficient funds. Prompt shopper to use another method.",
|
|
2100
2102
|
CARD_DECLINED: "Card was declined. Ask shopper to retry or switch payment method.",
|
|
2101
2103
|
INVALID_OTP: "Authorization code is invalid. Let shopper re-enter OTP/PIN and retry.",
|
|
@@ -2244,6 +2246,12 @@ function getQueryNum(c, key) {
|
|
|
2244
2246
|
return Number.isFinite(n) ? n : void 0;
|
|
2245
2247
|
}
|
|
2246
2248
|
|
|
2249
|
+
// src/constants.ts
|
|
2250
|
+
var PAYMENT_METHOD = {
|
|
2251
|
+
MOBILE_MONEY: "mobile_money",
|
|
2252
|
+
CARD: "card"
|
|
2253
|
+
};
|
|
2254
|
+
|
|
2247
2255
|
// src/mock/routes/v1.ts
|
|
2248
2256
|
function buildV1(deps) {
|
|
2249
2257
|
const app = new Hono2();
|
|
@@ -2260,10 +2268,22 @@ function buildV1(deps) {
|
|
|
2260
2268
|
}));
|
|
2261
2269
|
});
|
|
2262
2270
|
app.get("/business", (c) => tryRoute(c, () => deps.business.primary()));
|
|
2263
|
-
app.get(
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2271
|
+
app.get(
|
|
2272
|
+
"/business/by-handle/:handle",
|
|
2273
|
+
(c) => tryRoute(c, () => deps.business.byHandle(c.req.param("handle")))
|
|
2274
|
+
);
|
|
2275
|
+
app.get(
|
|
2276
|
+
"/business/by-domain",
|
|
2277
|
+
(c) => tryRoute(c, () => deps.business.byDomain(c.req.query("domain") ?? ""))
|
|
2278
|
+
);
|
|
2279
|
+
app.get(
|
|
2280
|
+
"/business/settings",
|
|
2281
|
+
(c) => tryRoute(c, () => deps.business.settings(deps.defaultBusinessId))
|
|
2282
|
+
);
|
|
2283
|
+
app.get(
|
|
2284
|
+
"/business/locations",
|
|
2285
|
+
(c) => tryRoute(c, () => deps.business.locations(deps.defaultBusinessId))
|
|
2286
|
+
);
|
|
2267
2287
|
app.get("/business/hours", (c) => tryRoute(c, () => deps.business.hours(deps.defaultBusinessId)));
|
|
2268
2288
|
app.get("/catalogue", (c) => tryRoute(c, () => deps.catalogue.snapshot(deps.defaultBusinessId)));
|
|
2269
2289
|
app.get(
|
|
@@ -2278,57 +2298,165 @@ function buildV1(deps) {
|
|
|
2278
2298
|
})
|
|
2279
2299
|
)
|
|
2280
2300
|
);
|
|
2281
|
-
app.get(
|
|
2282
|
-
|
|
2283
|
-
|
|
2301
|
+
app.get(
|
|
2302
|
+
"/catalogue/products/:product_id",
|
|
2303
|
+
(c) => tryRoute(c, () => deps.catalogue.getProduct(c.req.param("product_id")))
|
|
2304
|
+
);
|
|
2305
|
+
app.get(
|
|
2306
|
+
"/catalogue/products/:product_id/variants",
|
|
2307
|
+
(c) => tryRoute(c, () => deps.catalogue.getProductVariants(c.req.param("product_id")))
|
|
2308
|
+
);
|
|
2309
|
+
app.get(
|
|
2310
|
+
"/catalogue/products/:product_id/variant-axes",
|
|
2311
|
+
(c) => tryRoute(c, () => deps.catalogue.getProductVariantAxes(c.req.param("product_id")))
|
|
2312
|
+
);
|
|
2284
2313
|
app.get(
|
|
2285
2314
|
"/catalogue/products/:product_id/variants/:variant_id",
|
|
2286
|
-
(c) => tryRoute(
|
|
2315
|
+
(c) => tryRoute(
|
|
2316
|
+
c,
|
|
2317
|
+
() => deps.catalogue.getProductVariantById(c.req.param("product_id"), c.req.param("variant_id"))
|
|
2318
|
+
)
|
|
2287
2319
|
);
|
|
2288
2320
|
app.post("/catalogue/products/:product_id/variants/find", async (c) => {
|
|
2289
2321
|
const body = await c.req.json().catch(() => ({}));
|
|
2290
2322
|
return tryRoute(
|
|
2291
2323
|
c,
|
|
2292
|
-
() => deps.catalogue.findProductVariant(
|
|
2324
|
+
() => deps.catalogue.findProductVariant(
|
|
2325
|
+
c.req.param("product_id"),
|
|
2326
|
+
body.axis_selections ?? body.properties ?? {}
|
|
2327
|
+
)
|
|
2293
2328
|
);
|
|
2294
2329
|
});
|
|
2295
|
-
app.get(
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
app.get(
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
app.get(
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
app.get(
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2330
|
+
app.get(
|
|
2331
|
+
"/catalogue/products/:product_id/add-ons",
|
|
2332
|
+
(c) => tryRoute(c, () => deps.catalogue.getProductAddOns(c.req.param("product_id")))
|
|
2333
|
+
);
|
|
2334
|
+
app.get(
|
|
2335
|
+
"/catalogue/categories",
|
|
2336
|
+
(c) => tryRoute(c, () => deps.catalogue.listCategories(deps.defaultBusinessId))
|
|
2337
|
+
);
|
|
2338
|
+
app.get(
|
|
2339
|
+
"/catalogue/categories/:category_id",
|
|
2340
|
+
(c) => tryRoute(c, () => deps.catalogue.getCategory(c.req.param("category_id")))
|
|
2341
|
+
);
|
|
2342
|
+
app.get(
|
|
2343
|
+
"/catalogue/categories/:category_id/products",
|
|
2344
|
+
(c) => tryRoute(c, () => deps.catalogue.getCategoryProducts(c.req.param("category_id")))
|
|
2345
|
+
);
|
|
2346
|
+
app.get(
|
|
2347
|
+
"/catalogue/categories/:category_id/attributes",
|
|
2348
|
+
(c) => tryRoute(c, () => deps.catalogue.getCategoryAttributes(c.req.param("category_id")))
|
|
2349
|
+
);
|
|
2350
|
+
app.get(
|
|
2351
|
+
"/catalogue/categories/:category_id/deals",
|
|
2352
|
+
(c) => tryRoute(c, () => deps.catalogue.getCategoryDeals(c.req.param("category_id")))
|
|
2353
|
+
);
|
|
2354
|
+
app.get(
|
|
2355
|
+
"/catalogue/collections",
|
|
2356
|
+
(c) => tryRoute(c, () => deps.catalogue.listCollections(deps.defaultBusinessId))
|
|
2357
|
+
);
|
|
2358
|
+
app.get(
|
|
2359
|
+
"/catalogue/collections/:collection_id",
|
|
2360
|
+
(c) => tryRoute(c, () => deps.catalogue.getCollection(c.req.param("collection_id")))
|
|
2361
|
+
);
|
|
2362
|
+
app.get(
|
|
2363
|
+
"/catalogue/collections/:collection_id/products",
|
|
2364
|
+
(c) => tryRoute(c, () => deps.catalogue.getCollectionProducts(c.req.param("collection_id")))
|
|
2365
|
+
);
|
|
2366
|
+
app.get(
|
|
2367
|
+
"/catalogue/collections/:collection_id/attributes",
|
|
2368
|
+
(c) => tryRoute(c, () => deps.catalogue.getCollectionAttributes(c.req.param("collection_id")))
|
|
2369
|
+
);
|
|
2370
|
+
app.get(
|
|
2371
|
+
"/catalogue/collections/:collection_id/deals",
|
|
2372
|
+
(c) => tryRoute(c, () => deps.catalogue.getCollectionDeals(c.req.param("collection_id")))
|
|
2373
|
+
);
|
|
2374
|
+
app.get(
|
|
2375
|
+
"/catalogue/bundles",
|
|
2376
|
+
(c) => tryRoute(c, () => deps.catalogue.listBundles(deps.defaultBusinessId))
|
|
2377
|
+
);
|
|
2378
|
+
app.get(
|
|
2379
|
+
"/catalogue/bundles/:bundle_id",
|
|
2380
|
+
(c) => tryRoute(c, () => deps.catalogue.getBundle(c.req.param("bundle_id")))
|
|
2381
|
+
);
|
|
2382
|
+
app.get(
|
|
2383
|
+
"/catalogue/composites",
|
|
2384
|
+
(c) => tryRoute(c, () => deps.catalogue.listComposites(deps.defaultBusinessId))
|
|
2385
|
+
);
|
|
2386
|
+
app.get(
|
|
2387
|
+
"/catalogue/composites/by-product/:product_id",
|
|
2388
|
+
(c) => tryRoute(c, () => deps.catalogue.getCompositeByProduct(c.req.param("product_id")))
|
|
2389
|
+
);
|
|
2390
|
+
app.get(
|
|
2391
|
+
"/catalogue/composites/:composite_id",
|
|
2392
|
+
(c) => tryRoute(c, () => deps.catalogue.getComposite(c.req.param("composite_id")))
|
|
2393
|
+
);
|
|
2311
2394
|
app.post("/catalogue/composites/:composite_id/calculate-price", async (c) => {
|
|
2312
2395
|
const body = await c.req.json().catch(() => ({}));
|
|
2313
|
-
return tryRoute(
|
|
2396
|
+
return tryRoute(
|
|
2397
|
+
c,
|
|
2398
|
+
() => deps.catalogue.calculateCompositePrice(c.req.param("composite_id"), body)
|
|
2399
|
+
);
|
|
2314
2400
|
});
|
|
2315
|
-
app.get(
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
app.get(
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2401
|
+
app.get(
|
|
2402
|
+
"/catalogue/taxonomies",
|
|
2403
|
+
(c) => tryRoute(c, () => deps.catalogue.listTaxonomies(deps.defaultBusinessId))
|
|
2404
|
+
);
|
|
2405
|
+
app.get(
|
|
2406
|
+
"/catalogue/taxonomies/search",
|
|
2407
|
+
(c) => tryRoute(
|
|
2408
|
+
c,
|
|
2409
|
+
() => deps.catalogue.searchTaxonomies(deps.defaultBusinessId, c.req.query("q") ?? "")
|
|
2410
|
+
)
|
|
2411
|
+
);
|
|
2412
|
+
app.get(
|
|
2413
|
+
"/catalogue/taxonomies/:taxonomy_id",
|
|
2414
|
+
(c) => tryRoute(c, () => deps.catalogue.getTaxonomy(c.req.param("taxonomy_id")))
|
|
2415
|
+
);
|
|
2416
|
+
app.get(
|
|
2417
|
+
"/catalogue/taxonomies/:taxonomy_id/attributes",
|
|
2418
|
+
(c) => tryRoute(c, () => deps.catalogue.getTaxonomyAttributes(c.req.param("taxonomy_id")))
|
|
2419
|
+
);
|
|
2420
|
+
app.get(
|
|
2421
|
+
"/catalogue/taxonomies/:taxonomy_id/path",
|
|
2422
|
+
(c) => tryRoute(c, () => deps.catalogue.getTaxonomyPath(c.req.param("taxonomy_id")))
|
|
2423
|
+
);
|
|
2424
|
+
app.get(
|
|
2425
|
+
"/catalogue/attributes",
|
|
2426
|
+
(c) => tryRoute(c, () => deps.catalogue.listAttributes(deps.defaultBusinessId))
|
|
2427
|
+
);
|
|
2428
|
+
app.get(
|
|
2429
|
+
"/catalogue/properties/facets",
|
|
2430
|
+
(c) => tryRoute(c, () => deps.catalogue.listPropertyFacets(deps.defaultBusinessId))
|
|
2431
|
+
);
|
|
2432
|
+
app.get(
|
|
2433
|
+
"/catalogue/tags",
|
|
2434
|
+
(c) => tryRoute(c, () => deps.catalogue.listTags(deps.defaultBusinessId))
|
|
2435
|
+
);
|
|
2323
2436
|
app.get("/catalogue/menu", (c) => tryRoute(c, () => deps.lite.getMenu(deps.defaultBusinessId)));
|
|
2324
|
-
app.get(
|
|
2325
|
-
|
|
2326
|
-
|
|
2437
|
+
app.get(
|
|
2438
|
+
"/catalogue/menu/categories/:category_id",
|
|
2439
|
+
(c) => tryRoute(c, () => deps.lite.getMenuCategory(c.req.param("category_id")))
|
|
2440
|
+
);
|
|
2441
|
+
app.get(
|
|
2442
|
+
"/catalogue/menu/items/:item_id",
|
|
2443
|
+
(c) => tryRoute(c, () => deps.catalogue.getProduct(c.req.param("item_id")))
|
|
2444
|
+
);
|
|
2445
|
+
app.get(
|
|
2446
|
+
"/catalogue/knowledge-base/articles",
|
|
2447
|
+
(c) => tryRoute(c, () => ({ articles: deps.catalogue.listKnowledgeArticles(deps.defaultBusinessId) }))
|
|
2448
|
+
);
|
|
2327
2449
|
app.get(
|
|
2328
2450
|
"/catalogue/knowledge-base/search",
|
|
2329
|
-
(c) => tryRoute(c, () => ({
|
|
2451
|
+
(c) => tryRoute(c, () => ({
|
|
2452
|
+
results: deps.catalogue.searchKnowledgeBase(deps.defaultBusinessId, c.req.query("q") ?? ""),
|
|
2453
|
+
query: c.req.query("q") ?? ""
|
|
2454
|
+
}))
|
|
2455
|
+
);
|
|
2456
|
+
app.get(
|
|
2457
|
+
"/catalogue/products/:product_id/attributes",
|
|
2458
|
+
(c) => tryRoute(c, () => deps.catalogue.getProductAttributes(c.req.param("product_id")))
|
|
2330
2459
|
);
|
|
2331
|
-
app.get("/catalogue/products/:product_id/attributes", (c) => tryRoute(c, () => deps.catalogue.getProductAttributes(c.req.param("product_id"))));
|
|
2332
2460
|
app.get(
|
|
2333
2461
|
"/catalogue/products/:product_id/available-now",
|
|
2334
2462
|
(c) => tryRoute(c, () => {
|
|
@@ -2347,22 +2475,45 @@ function buildV1(deps) {
|
|
|
2347
2475
|
"/catalogue/products/:product_id/schedules",
|
|
2348
2476
|
(c) => tryRoute(c, () => {
|
|
2349
2477
|
const p = deps.registry.products.get(c.req.param("product_id"));
|
|
2350
|
-
return {
|
|
2478
|
+
return {
|
|
2479
|
+
schedules: p?.metadata?.["time_profiles"] ?? []
|
|
2480
|
+
};
|
|
2351
2481
|
})
|
|
2352
2482
|
);
|
|
2353
|
-
app.get(
|
|
2354
|
-
|
|
2483
|
+
app.get(
|
|
2484
|
+
"/catalogue/deals",
|
|
2485
|
+
(c) => tryRoute(c, () => deps.catalogue.listDeals(deps.defaultBusinessId))
|
|
2486
|
+
);
|
|
2487
|
+
app.get(
|
|
2488
|
+
"/catalogue/deals/on-sale",
|
|
2489
|
+
(c) => tryRoute(c, () => deps.catalogue.listOnSale(deps.defaultBusinessId))
|
|
2490
|
+
);
|
|
2355
2491
|
app.post("/catalogue/deals/validate", async (c) => {
|
|
2356
2492
|
const body = await c.req.json().catch(() => ({}));
|
|
2357
|
-
return tryRoute(
|
|
2493
|
+
return tryRoute(
|
|
2494
|
+
c,
|
|
2495
|
+
() => deps.catalogue.validateDiscount(
|
|
2496
|
+
body.discount_code ?? body.code ?? "",
|
|
2497
|
+
deps.defaultBusinessId
|
|
2498
|
+
)
|
|
2499
|
+
);
|
|
2358
2500
|
});
|
|
2359
|
-
app.get(
|
|
2501
|
+
app.get(
|
|
2502
|
+
"/catalogue/products/:product_id/deals",
|
|
2503
|
+
(c) => tryRoute(c, () => deps.catalogue.getProductDeals(c.req.param("product_id")))
|
|
2504
|
+
);
|
|
2360
2505
|
app.post("/catalogue/quotes", async (c) => {
|
|
2361
2506
|
const body = await c.req.json().catch(() => ({}));
|
|
2362
2507
|
return tryRoute(c, () => deps.catalogue.createQuote(deps.defaultBusinessId, body));
|
|
2363
2508
|
});
|
|
2364
|
-
app.get(
|
|
2365
|
-
|
|
2509
|
+
app.get(
|
|
2510
|
+
"/catalogue/quotes/:quote_id",
|
|
2511
|
+
(c) => tryRoute(c, () => deps.catalogue.getQuote(c.req.param("quote_id")))
|
|
2512
|
+
);
|
|
2513
|
+
app.post(
|
|
2514
|
+
"/catalogue/quotes/:quote_id/refresh",
|
|
2515
|
+
(c) => tryRoute(c, () => deps.catalogue.refreshQuote(c.req.param("quote_id")))
|
|
2516
|
+
);
|
|
2366
2517
|
app.get("/cart", (c) => tryRoute(c, () => deps.cart.toUICart(deps.cart.get(c.var.session))));
|
|
2367
2518
|
app.delete("/cart", (c) => tryRoute(c, () => deps.cart.clear(c.var.session)));
|
|
2368
2519
|
app.get("/cart/items", (c) => tryRoute(c, () => deps.cart.getItems(c.var.session)));
|
|
@@ -2373,9 +2524,15 @@ function buildV1(deps) {
|
|
|
2373
2524
|
app.patch("/cart/items/:cart_item_id", async (c) => {
|
|
2374
2525
|
const body = await c.req.json().catch(() => ({}));
|
|
2375
2526
|
if (typeof body.quantity !== "number") return fail(c, validation("quantity required"));
|
|
2376
|
-
return tryRoute(
|
|
2527
|
+
return tryRoute(
|
|
2528
|
+
c,
|
|
2529
|
+
() => deps.cart.updateQuantity(c.var.session, c.req.param("cart_item_id"), body.quantity)
|
|
2530
|
+
);
|
|
2377
2531
|
});
|
|
2378
|
-
app.delete(
|
|
2532
|
+
app.delete(
|
|
2533
|
+
"/cart/items/:cart_item_id",
|
|
2534
|
+
(c) => tryRoute(c, () => deps.cart.removeItem(c.var.session, c.req.param("cart_item_id")))
|
|
2535
|
+
);
|
|
2379
2536
|
app.get("/cart/count", (c) => tryRoute(c, () => deps.cart.getCount(c.var.session)));
|
|
2380
2537
|
app.get("/cart/total", (c) => tryRoute(c, () => deps.cart.getTotal(c.var.session)));
|
|
2381
2538
|
app.post("/cart/destination-quote", async (c) => {
|
|
@@ -2386,10 +2543,25 @@ function buildV1(deps) {
|
|
|
2386
2543
|
const body = await c.req.json().catch(() => ({}));
|
|
2387
2544
|
return tryRoute(c, () => deps.cart.applyCoupon(c.var.session, body.coupon_code ?? ""));
|
|
2388
2545
|
});
|
|
2389
|
-
app.delete(
|
|
2390
|
-
|
|
2546
|
+
app.delete(
|
|
2547
|
+
"/cart/coupons/current",
|
|
2548
|
+
(c) => tryRoute(c, () => deps.cart.removeCoupon(c.var.session))
|
|
2549
|
+
);
|
|
2550
|
+
app.get(
|
|
2551
|
+
"/orders",
|
|
2552
|
+
(c) => tryRoute(
|
|
2553
|
+
c,
|
|
2554
|
+
() => deps.orders.list(c.var.session, {
|
|
2555
|
+
limit: getQueryNum(c, "limit"),
|
|
2556
|
+
status: c.req.query("status")
|
|
2557
|
+
})
|
|
2558
|
+
)
|
|
2559
|
+
);
|
|
2391
2560
|
app.get("/orders/:order_id", (c) => tryRoute(c, () => deps.orders.get(c.req.param("order_id"))));
|
|
2392
|
-
app.get(
|
|
2561
|
+
app.get(
|
|
2562
|
+
"/orders/:order_id/payment-status",
|
|
2563
|
+
(c) => tryRoute(c, () => deps.orders.getPaymentStatus(c.req.param("order_id")))
|
|
2564
|
+
);
|
|
2393
2565
|
app.post("/orders/:order_id/cancel", async (c) => {
|
|
2394
2566
|
const body = await c.req.json().catch(() => ({}));
|
|
2395
2567
|
return tryRoute(c, () => deps.orders.cancel(c.req.param("order_id"), body.reason));
|
|
@@ -2398,13 +2570,46 @@ function buildV1(deps) {
|
|
|
2398
2570
|
const body = await c.req.json().catch(() => ({}));
|
|
2399
2571
|
return tryRoute(c, () => deps.orders.updateCustomer(c.req.param("order_id"), body));
|
|
2400
2572
|
});
|
|
2401
|
-
app.post(
|
|
2573
|
+
app.post(
|
|
2574
|
+
"/orders/:order_id/verify-payment",
|
|
2575
|
+
(c) => tryRoute(c, () => deps.orders.verifyPayment(c.req.param("order_id")))
|
|
2576
|
+
);
|
|
2402
2577
|
app.get("/subscriptions", (c) => tryRoute(c, () => deps.subscriptions.list(c.var.session)));
|
|
2403
|
-
app.get(
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
app.post(
|
|
2578
|
+
app.get(
|
|
2579
|
+
"/subscriptions/:subscription_id",
|
|
2580
|
+
(c) => tryRoute(c, () => deps.subscriptions.get(c.req.param("subscription_id")))
|
|
2581
|
+
);
|
|
2582
|
+
app.post(
|
|
2583
|
+
"/subscriptions/:subscription_id/cancel",
|
|
2584
|
+
(c) => tryRoute(c, () => deps.subscriptions.cancel(c.req.param("subscription_id")))
|
|
2585
|
+
);
|
|
2586
|
+
app.post(
|
|
2587
|
+
"/subscriptions/:subscription_id/pause",
|
|
2588
|
+
(c) => tryRoute(c, () => deps.subscriptions.pause(c.req.param("subscription_id")))
|
|
2589
|
+
);
|
|
2590
|
+
app.post(
|
|
2591
|
+
"/subscriptions/:subscription_id/resume",
|
|
2592
|
+
(c) => tryRoute(c, () => deps.subscriptions.resume(c.req.param("subscription_id")))
|
|
2593
|
+
);
|
|
2594
|
+
app.post(
|
|
2595
|
+
"/subscriptions/:subscription_id/skip",
|
|
2596
|
+
(c) => tryRoute(c, () => deps.subscriptions.skipNext(c.req.param("subscription_id")))
|
|
2597
|
+
);
|
|
2598
|
+
app.get("/payments/collection-options", (c) => {
|
|
2599
|
+
const currency = c.req.query("currency")?.trim().toUpperCase();
|
|
2600
|
+
if (!currency || !/^[A-Z]{3}$/.test(currency)) {
|
|
2601
|
+
return fail(c, validation("currency must be a canonical three-letter code"));
|
|
2602
|
+
}
|
|
2603
|
+
return tryRoute(c, () => ({
|
|
2604
|
+
presentment_currency: currency,
|
|
2605
|
+
options: currency === "GHS" ? [
|
|
2606
|
+
{ method: PAYMENT_METHOD.CARD, network: null },
|
|
2607
|
+
{ method: PAYMENT_METHOD.MOBILE_MONEY, network: "mtn" },
|
|
2608
|
+
{ method: PAYMENT_METHOD.MOBILE_MONEY, network: "telecel" },
|
|
2609
|
+
{ method: PAYMENT_METHOD.MOBILE_MONEY, network: "airteltigo" }
|
|
2610
|
+
] : currency === "USD" ? [{ method: PAYMENT_METHOD.CARD, network: null }] : []
|
|
2611
|
+
}));
|
|
2612
|
+
});
|
|
2408
2613
|
app.post("/checkout", async (c) => {
|
|
2409
2614
|
const body = await c.req.json().catch(() => ({}));
|
|
2410
2615
|
return tryRoute(c, () => deps.checkout.process(c.var.session, body));
|
|
@@ -2458,15 +2663,33 @@ function buildV1(deps) {
|
|
|
2458
2663
|
return { success: true, message: "Profile updated successfully" };
|
|
2459
2664
|
});
|
|
2460
2665
|
});
|
|
2461
|
-
app.get(
|
|
2462
|
-
|
|
2666
|
+
app.get(
|
|
2667
|
+
"/inventory/products/:product_id/stock",
|
|
2668
|
+
(c) => tryRoute(c, () => deps.inventory.productStock(c.req.param("product_id")))
|
|
2669
|
+
);
|
|
2670
|
+
app.get(
|
|
2671
|
+
"/inventory/variants/:variant_id/stock",
|
|
2672
|
+
(c) => tryRoute(c, () => deps.inventory.variantStock(c.req.param("variant_id")))
|
|
2673
|
+
);
|
|
2463
2674
|
app.get(
|
|
2464
2675
|
"/inventory/products/:product_id/availability",
|
|
2465
|
-
(c) => tryRoute(
|
|
2676
|
+
(c) => tryRoute(
|
|
2677
|
+
c,
|
|
2678
|
+
() => deps.inventory.productAvailability(
|
|
2679
|
+
c.req.param("product_id"),
|
|
2680
|
+
getQueryNum(c, "quantity") ?? 1
|
|
2681
|
+
)
|
|
2682
|
+
)
|
|
2466
2683
|
);
|
|
2467
2684
|
app.get(
|
|
2468
2685
|
"/inventory/variants/:variant_id/availability",
|
|
2469
|
-
(c) => tryRoute(
|
|
2686
|
+
(c) => tryRoute(
|
|
2687
|
+
c,
|
|
2688
|
+
() => deps.inventory.variantAvailability(
|
|
2689
|
+
c.req.param("variant_id"),
|
|
2690
|
+
getQueryNum(c, "quantity") ?? 1
|
|
2691
|
+
)
|
|
2692
|
+
)
|
|
2470
2693
|
);
|
|
2471
2694
|
app.get(
|
|
2472
2695
|
"/delivery/fee",
|
|
@@ -2493,35 +2716,75 @@ function buildV1(deps) {
|
|
|
2493
2716
|
);
|
|
2494
2717
|
app.post("/places/autocomplete", async (c) => {
|
|
2495
2718
|
const body = await c.req.json().catch(() => ({}));
|
|
2496
|
-
return tryRoute(
|
|
2719
|
+
return tryRoute(
|
|
2720
|
+
c,
|
|
2721
|
+
() => deps.places.autocomplete({ query: body.input ?? body.query ?? "", country: body.country })
|
|
2722
|
+
);
|
|
2497
2723
|
});
|
|
2498
2724
|
app.post("/places/details", async (c) => {
|
|
2499
2725
|
const body = await c.req.json().catch(() => ({}));
|
|
2500
2726
|
return tryRoute(c, () => deps.places.details({ place_id: body.place_id ?? "" }));
|
|
2501
2727
|
});
|
|
2502
|
-
app.get(
|
|
2503
|
-
|
|
2504
|
-
|
|
2728
|
+
app.get(
|
|
2729
|
+
"/scheduling/services",
|
|
2730
|
+
(c) => tryRoute(c, () => deps.scheduling.listServices(deps.defaultBusinessId))
|
|
2731
|
+
);
|
|
2732
|
+
app.get(
|
|
2733
|
+
"/scheduling/services/:service_id",
|
|
2734
|
+
(c) => tryRoute(c, () => deps.scheduling.getService(c.req.param("service_id")))
|
|
2735
|
+
);
|
|
2736
|
+
app.get(
|
|
2737
|
+
"/scheduling/slots",
|
|
2738
|
+
(c) => tryRoute(
|
|
2739
|
+
c,
|
|
2740
|
+
() => deps.scheduling.getSlots(c.req.query("service_id") ?? "", { date: c.req.query("date") })
|
|
2741
|
+
)
|
|
2742
|
+
);
|
|
2505
2743
|
app.get(
|
|
2506
2744
|
"/scheduling/slots/check",
|
|
2507
|
-
(c) => tryRoute(
|
|
2745
|
+
(c) => tryRoute(
|
|
2746
|
+
c,
|
|
2747
|
+
() => deps.scheduling.checkSlot(
|
|
2748
|
+
c.req.query("service_id") ?? "",
|
|
2749
|
+
c.req.query("start") ?? "",
|
|
2750
|
+
c.req.query("end") ?? ""
|
|
2751
|
+
)
|
|
2752
|
+
)
|
|
2753
|
+
);
|
|
2754
|
+
app.get(
|
|
2755
|
+
"/scheduling/availability",
|
|
2756
|
+
(c) => tryRoute(c, () => deps.scheduling.getServiceAvailability(c.req.query("service_id") ?? ""))
|
|
2757
|
+
);
|
|
2758
|
+
app.get(
|
|
2759
|
+
"/scheduling/bookings",
|
|
2760
|
+
(c) => tryRoute(c, () => deps.scheduling.getCustomerBookings(c.var.session))
|
|
2508
2761
|
);
|
|
2509
|
-
app.get("/scheduling/availability", (c) => tryRoute(c, () => deps.scheduling.getServiceAvailability(c.req.query("service_id") ?? "")));
|
|
2510
|
-
app.get("/scheduling/bookings", (c) => tryRoute(c, () => deps.scheduling.getCustomerBookings(c.var.session)));
|
|
2511
2762
|
app.post("/scheduling/bookings/reschedule", async (c) => {
|
|
2512
2763
|
const body = await c.req.json().catch(() => ({}));
|
|
2513
2764
|
return tryRoute(c, () => deps.scheduling.rescheduleBooking(body));
|
|
2514
2765
|
});
|
|
2515
|
-
app.get(
|
|
2766
|
+
app.get(
|
|
2767
|
+
"/scheduling/bookings/:booking_id",
|
|
2768
|
+
(c) => tryRoute(c, () => deps.scheduling.getBooking(c.req.param("booking_id")))
|
|
2769
|
+
);
|
|
2516
2770
|
app.post("/scheduling/bookings/:booking_id/cancel", async (c) => {
|
|
2517
2771
|
const body = await c.req.json().catch(() => ({}));
|
|
2518
2772
|
return tryRoute(c, () => deps.scheduling.cancelBooking(c.req.param("booking_id"), body.reason));
|
|
2519
2773
|
});
|
|
2520
2774
|
app.get("/lite/bootstrap", (c) => tryRoute(c, () => deps.lite.bootstrap(deps.defaultBusinessId)));
|
|
2521
|
-
app.get(
|
|
2775
|
+
app.get(
|
|
2776
|
+
"/lite/resources/:resource_id",
|
|
2777
|
+
(c) => tryRoute(c, () => deps.lite.getResource(c.req.param("resource_id")))
|
|
2778
|
+
);
|
|
2522
2779
|
app.get("/lite/menu", (c) => tryRoute(c, () => deps.lite.getMenu(deps.defaultBusinessId)));
|
|
2523
|
-
app.get(
|
|
2524
|
-
|
|
2780
|
+
app.get(
|
|
2781
|
+
"/lite/menu/categories/:category_id",
|
|
2782
|
+
(c) => tryRoute(c, () => deps.lite.getMenuCategory(c.req.param("category_id")))
|
|
2783
|
+
);
|
|
2784
|
+
app.get(
|
|
2785
|
+
"/fx/rate",
|
|
2786
|
+
(c) => tryRoute(c, () => deps.fx.getRate(c.req.query("from") ?? "USD", c.req.query("to") ?? "GHS"))
|
|
2787
|
+
);
|
|
2525
2788
|
app.post("/fx/quotes", async (c) => {
|
|
2526
2789
|
const body = await c.req.json().catch(() => ({}));
|
|
2527
2790
|
return tryRoute(c, () => deps.fx.lockQuote(body));
|
|
@@ -2534,31 +2797,47 @@ function buildV1(deps) {
|
|
|
2534
2797
|
const body = await c.req.json().catch(() => ({}));
|
|
2535
2798
|
return tryRoute(c, () => deps.uploads.confirm(body));
|
|
2536
2799
|
});
|
|
2537
|
-
app.get(
|
|
2538
|
-
"/store-credit/balance",
|
|
2539
|
-
(c) => c.json({ data: { balance: "0.00", currency: "USD" } })
|
|
2540
|
-
);
|
|
2800
|
+
app.get("/store-credit/balance", (c) => c.json({ data: { balance: "0.00", currency: "USD" } }));
|
|
2541
2801
|
app.post("/activity/session", async (c) => {
|
|
2542
2802
|
await c.req.json().catch(() => ({}));
|
|
2543
2803
|
return c.json({ data: { recorded: true } });
|
|
2544
2804
|
});
|
|
2545
2805
|
app.post("/activity/events", async (c) => {
|
|
2546
2806
|
const body = await c.req.json().catch(() => ({}));
|
|
2547
|
-
return tryRoute(
|
|
2807
|
+
return tryRoute(
|
|
2808
|
+
c,
|
|
2809
|
+
() => deps.activity.recordEvents(
|
|
2810
|
+
deps.defaultBusinessId,
|
|
2811
|
+
body.analytics_session_id ?? c.var.session.id,
|
|
2812
|
+
body.events ?? []
|
|
2813
|
+
)
|
|
2814
|
+
);
|
|
2548
2815
|
});
|
|
2549
|
-
app.get(
|
|
2550
|
-
|
|
2816
|
+
app.get(
|
|
2817
|
+
"/activity/state",
|
|
2818
|
+
(c) => tryRoute(c, () => deps.activity.getState(deps.defaultBusinessId, c.var.session.id))
|
|
2819
|
+
);
|
|
2820
|
+
app.get(
|
|
2821
|
+
"/activity/recommendations",
|
|
2822
|
+
(c) => tryRoute(c, () => deps.activity.getRecommendations(deps.defaultBusinessId))
|
|
2823
|
+
);
|
|
2551
2824
|
app.post("/activity/messages/dismiss", async (c) => {
|
|
2552
2825
|
const body = await c.req.json().catch(() => ({}));
|
|
2553
2826
|
return tryRoute(c, () => deps.activity.dismissMessage(body.code ?? body.message_id ?? ""));
|
|
2554
2827
|
});
|
|
2555
2828
|
app.post(
|
|
2556
2829
|
"/support/conversation",
|
|
2557
|
-
(c) => tryRoute(
|
|
2830
|
+
(c) => tryRoute(
|
|
2831
|
+
c,
|
|
2832
|
+
() => deps.support.openConversation(deps.defaultBusinessId, c.var.session.customer_id)
|
|
2833
|
+
)
|
|
2558
2834
|
);
|
|
2559
2835
|
app.get(
|
|
2560
2836
|
"/support/conversation",
|
|
2561
|
-
(c) => tryRoute(
|
|
2837
|
+
(c) => tryRoute(
|
|
2838
|
+
c,
|
|
2839
|
+
() => deps.support.peekConversation(deps.defaultBusinessId, c.var.session.customer_id)
|
|
2840
|
+
)
|
|
2562
2841
|
);
|
|
2563
2842
|
app.post("/support/conversation/messages", async (c) => {
|
|
2564
2843
|
const body = await c.req.json().catch(() => ({}));
|
|
@@ -2574,7 +2853,12 @@ function buildV1(deps) {
|
|
|
2574
2853
|
});
|
|
2575
2854
|
app.get(
|
|
2576
2855
|
"/support/conversation/messages",
|
|
2577
|
-
(c) => tryRoute(
|
|
2856
|
+
(c) => tryRoute(
|
|
2857
|
+
c,
|
|
2858
|
+
() => deps.support.listMessages(c.req.query("conversation_id") ?? "", {
|
|
2859
|
+
limit: getQueryNum(c, "limit")
|
|
2860
|
+
})
|
|
2861
|
+
)
|
|
2578
2862
|
);
|
|
2579
2863
|
app.post("/support/conversation/messages/:messageId/reactions", async (c) => {
|
|
2580
2864
|
const body = await c.req.json().catch(() => ({}));
|
|
@@ -2595,7 +2879,10 @@ function buildV1(deps) {
|
|
|
2595
2879
|
});
|
|
2596
2880
|
app.get(
|
|
2597
2881
|
"/support/conversation/ws",
|
|
2598
|
-
(c) => c.json(
|
|
2882
|
+
(c) => c.json(
|
|
2883
|
+
{ note: "WebSocket connection \u2014 connect via ws:// at the same path", supported: false },
|
|
2884
|
+
426
|
|
2885
|
+
)
|
|
2599
2886
|
);
|
|
2600
2887
|
return app;
|
|
2601
2888
|
}
|
|
@@ -4731,6 +5018,7 @@ function toUICart(registry, cart) {
|
|
|
4731
5018
|
tax_rate: cart.tax_rate,
|
|
4732
5019
|
service_charge_rate: cart.service_charge_rate,
|
|
4733
5020
|
tax_inclusive: false,
|
|
5021
|
+
price_display_mode: "unspecified",
|
|
4734
5022
|
deposit_required: false,
|
|
4735
5023
|
deposit_amount: "0.00"
|
|
4736
5024
|
},
|
|
@@ -4890,6 +5178,7 @@ function createCartService(opts) {
|
|
|
4890
5178
|
tax_jurisdiction_label: label,
|
|
4891
5179
|
tax_inclusive: false,
|
|
4892
5180
|
tax_rate: cart.tax_rate,
|
|
5181
|
+
price_display_mode: "unspecified",
|
|
4893
5182
|
delivery_fee_details: null,
|
|
4894
5183
|
address_info: body.address_info
|
|
4895
5184
|
};
|
|
@@ -5045,9 +5334,11 @@ function createCheckoutService(opts) {
|
|
|
5045
5334
|
if (c.items.length === 0) throw validation("Cart is empty", { code: "CART_EMPTY" });
|
|
5046
5335
|
const orderId = ids.order();
|
|
5047
5336
|
const orderNumber = ids.orderNumber();
|
|
5337
|
+
const paymentId = ids.payment();
|
|
5048
5338
|
const reference = ids.payment();
|
|
5049
5339
|
const requiresAuth = body.payment_method === "mobile_money";
|
|
5050
5340
|
const isCard = body.payment_method === "card" || body.payment_method === "stripe";
|
|
5341
|
+
const cardProvider = body.payment_method === "stripe" || body.pay_currency?.toUpperCase() === "USD" ? "stripe" : "paystack";
|
|
5051
5342
|
const order = {
|
|
5052
5343
|
id: orderId,
|
|
5053
5344
|
business_id: c.business_id,
|
|
@@ -5071,6 +5362,7 @@ function createCheckoutService(opts) {
|
|
|
5071
5362
|
items: c.items,
|
|
5072
5363
|
applied_discount_ids: c.applied_discount_ids,
|
|
5073
5364
|
applied_discount_codes: c.applied_discount_codes,
|
|
5365
|
+
payment_id: paymentId,
|
|
5074
5366
|
payment_reference: reference,
|
|
5075
5367
|
metadata: body.metadata,
|
|
5076
5368
|
created_at: clock.iso(),
|
|
@@ -5087,31 +5379,57 @@ function createCheckoutService(opts) {
|
|
|
5087
5379
|
const result = {
|
|
5088
5380
|
order_id: orderId,
|
|
5089
5381
|
order_number: orderNumber,
|
|
5090
|
-
|
|
5382
|
+
payment_id: paymentId,
|
|
5383
|
+
payment_status: requiresAuth || isCard ? "pending" : "succeeded",
|
|
5091
5384
|
payment_reference: reference,
|
|
5092
5385
|
requires_authorization: requiresAuth,
|
|
5093
5386
|
authorization_type: requiresAuth ? "otp" : void 0,
|
|
5094
|
-
next_action: requiresAuth ? {
|
|
5095
|
-
|
|
5387
|
+
next_action: requiresAuth ? {
|
|
5388
|
+
type: "authorization",
|
|
5389
|
+
authorization_type: "otp",
|
|
5390
|
+
display_text: "Approve on your mobile money app"
|
|
5391
|
+
} : { type: "none" },
|
|
5392
|
+
provider: isCard ? cardProvider : body.payment_method,
|
|
5096
5393
|
bill_token: billToken
|
|
5097
5394
|
};
|
|
5098
5395
|
if (isCard) {
|
|
5099
|
-
result.next_action = { type: "redirect", authorization_url: `https://mock.cimplify.io/pay/${reference}` };
|
|
5100
|
-
result.authorization_url = `https://mock.cimplify.io/pay/${reference}`;
|
|
5101
|
-
result.client_secret = `pi_${orderId.slice(-12)}_secret_${Math.random().toString(36).slice(2, 18)}`;
|
|
5102
5396
|
const proc = globalThis.process;
|
|
5103
|
-
result.
|
|
5397
|
+
result.client_secret = cardProvider === "stripe" ? `pi_${orderId.slice(-12)}_secret_${Math.random().toString(36).slice(2, 18)}` : `access_${reference}`;
|
|
5398
|
+
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";
|
|
5399
|
+
result.next_action = {
|
|
5400
|
+
type: "card_popup",
|
|
5401
|
+
provider: cardProvider,
|
|
5402
|
+
client_secret: result.client_secret,
|
|
5403
|
+
public_key: result.public_key
|
|
5404
|
+
};
|
|
5104
5405
|
}
|
|
5105
5406
|
return result;
|
|
5106
5407
|
},
|
|
5107
5408
|
authorize(body) {
|
|
5108
|
-
|
|
5109
|
-
if (!
|
|
5110
|
-
const
|
|
5409
|
+
if (!body.payment_id?.trim()) throw validation("payment_id required");
|
|
5410
|
+
if (!body.authorization) throw validation("authorization required");
|
|
5411
|
+
const order = registry.orders.list(
|
|
5412
|
+
(candidate) => candidate.payment_id === body.payment_id
|
|
5413
|
+
)[0];
|
|
5414
|
+
if (!order) throw notFound(`Payment ${body.payment_id} not found`);
|
|
5415
|
+
const updated = {
|
|
5416
|
+
...order,
|
|
5417
|
+
payment_state: "paid",
|
|
5418
|
+
status: "confirmed",
|
|
5419
|
+
updated_at: clock.iso()
|
|
5420
|
+
};
|
|
5111
5421
|
registry.orders.put(order.id, updated);
|
|
5112
5422
|
bus.emit("order.payment.captured", { order_id: order.id }, order.business_id);
|
|
5113
5423
|
bus.emit("order.confirmed", { order_id: order.id }, order.business_id);
|
|
5114
|
-
return {
|
|
5424
|
+
return {
|
|
5425
|
+
order_id: order.id,
|
|
5426
|
+
order_number: order.user_friendly_id,
|
|
5427
|
+
payment_id: body.payment_id,
|
|
5428
|
+
payment_reference: order.payment_reference,
|
|
5429
|
+
payment_status: "succeeded",
|
|
5430
|
+
requires_authorization: false,
|
|
5431
|
+
next_action: { type: "none" }
|
|
5432
|
+
};
|
|
5115
5433
|
}
|
|
5116
5434
|
};
|
|
5117
5435
|
}
|