Skip to main content

Gaps and what is next

Status as of 2 Dec 2026. The current dev stack has outlet returns and signed site callbacks enabled for testing.

#GapEffect on a new channelWhere
1Hosted checkout returns customers to registered outlets on the current dev stack only. Two test outlets paid and returned on 1 Dec 2026. See the test belowOutlet returns are not available in productionChannel registry (#231)
2Direct Thai QR returns only to https://shop.villamarket.comA channel that is not the shop cannot use the direct QR flowfunctions/callback/qrcallback.py
3The Villa-order Apple Pay route (/stripe/applepay) accepts Villa web origins only for its redirect. The separate site route uses its configured HTTPS originThe Villa-order route falls back to https://villa.kitchen on dev and https://shop.villamarket.com in production for other origins or app schemesApple Pay
4Direct Amex is routed by villaWalletBackend2villaPayment3 cannot choose the channelfunctions/callback/amexcallback.py
5The K Bank signed site callback covers card_charge only. It is live for https://site.villamarket.ai. Thai QR, WeChat, Alipay and Amex still send no signed site callbackSites with their own orders get trusted production confirmation for direct K Bank cards onlySigned server callback
6Multi-outlet hosted checkout is on in dev and off in production. The production plan uses the shop's existing K Bank merchant and callback bridge. One live Thai QR payment must prove the inquiry ID before enablement (B2)New outlets cannot use production hosted checkout yetHosted checkout for outlets, PR #255
7callback is free text on each direct card request; the list of known channels (the registry of gap 1) is read by the hosted checkout onlyFor a direct card payment nothing stops a typo, and nothing tells staff which channel it came fromfunctions/cardtoken/app.py
8A partner cannot start a hosted checkout by itself: a customer session needs a Villa sign-in, a staff link needs a Villa staff keyA partner shop is paid through links that Villa staff or a Villa service make. The Commerce API's partner stores use their own payment link, not this checkoutfunctions/checkout/app.py; partner-api branch feat/p-partner-stores
9On dev, the public addresses (/api/payment3dev/* and /api/payment3devapi/* on villa.kitchen, shop.villamarket.com and dev.villamarket.net) reach an older dev stack, last deployed on 4 Oct 2026 and without the hosted checkout (/checkout/... answers 403 there), and K Bank's sandbox sends the customer back there after 3-D Secure. Measured on 1 Dec 2026A card payment started on the current dev stack's own address ends, in the browser, on the older stack's error page ("Card payment record not found"). A hosted checkout payment is still confirmed, because the checkout asks K Bank itself (page poll, and every 5 minutes): open /checkout/return/{sessionId} to go on. A direct card payment (/cardpayment) does not finish by itself: its result is recorded by the return handler, which the bank never reaches on that stack. In a test it can be finished by posting the bank's return (the form the browser carried to the older stack) to the current stack's own callback addressCloudFront origins of those paths; the return address held by K Bank's sandbox merchant
10Stripe Apple Pay for sites with their own orders is enabled on current dev with test keys. Production is off pending end-to-end testing and an approved live change windowUse the site endpoint for tests onlySite Apple Pay, PR #259 merged, PR #258 off
11The Villa shop takes live Apple Pay. Its Apple Pay button fix is pendingLive payment support does not mean the button issue is fixedApple Pay

Hosted checkout return​

Gap 1 is the one that matters most: the hosted checkout is the only place where K Bank, MPGS and Stripe all come back to the same point (/checkout/return/{sessionId}), so it is the natural place to send the customer on to the right channel.

On the current dev stack, switched on (1 Dec 2026): the channel registry (pull request #231). On 1 Dec 2026 two test channels (outlet-a, outlet-b, each with its own Villa-hosted return site) were registered there, one staff link was made for each, and both were paid with the K Bank sandbox card through 3-D Secure. After 3-D Secure the browser was on the older stack's error page (gap 9), so /checkout/return/{sessionId} was opened on the current stack by hand. From there it went by itself: the session's status was paid, the result page said "Taking you back to Test outlet A…" (or B) and moved to that outlet's own /thankyou?sessionId=…&status=success&state=paid, and the outlet's page read /checkout/status and showed "Payment confirmed".

  • One SSM parameter per channel holds an id, a label and a return base.
  • source on POST /checkout/sessions (or channel on POST /checkout/links) names the channel; the entry is copied into the session.
  • The result page shows "Return to label" and, once the payment is confirmed, continues to {returnBase}/thankyou?sessionId=…&status=success|pending|failure&state=….
  • The return base comes from the registry, never from the request, so no caller can turn the result page into an open redirect.
  • The channel still confirms with GET /checkout/status/{sessionId}.

How to use it: Return to the channel. How to give a new shop a channel in one step: Launch a shop.

Done on 1 Dec 2026: an independent review, the merge to dev, a deploy to the current dev stack (the one built from dev; gap 9 is about an older one that the public addresses still reach), CheckoutChannelRegistry switched on there, and two channels registered and paid through on K Bank's sandbox.

What is still open before a customer sees it:

  1. The bank's return must reach the current dev stack, so the customer comes back without anyone opening /checkout/return/{sessionId} by hand (gap 9).
  2. The public dev proxy paths need to reach the current dev stack. The current stack is reachable directly at its API Gateway address.
  3. Production stays off until a live Thai QR payment proves the inquiry ID (gap 6).

The registry does not close gaps 2, 3, 4 or 7: the direct flows return as before.