mirror of
https://github.com/hanzoai/dataroom.git
synced 2026-10-30 18:41:07 +00:00
hanzo-build-linux-amd64 is the only ARC runner pool installed on hanzo-k8s today (arm64 pool is paused until DigitalOcean ships arm64 droplets, per ~/work/hanzo/.github/RUNNERS.md). The arm64 job was waiting on spark-hanzoai-arm64 — not provisioned in this cluster — so every build sat in queue forever and the amd64 leg got cancelled. Set platforms: linux/amd64 on the reusable build call to skip arm64 entirely. Re-add arm64 if/when DO ships arm64 droplets and the spark runner pool comes back online.
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
/**
|
|
* Compatibility shim — drops Stripe.js Elements in favour of redirecting the
|
|
* browser to Hanzo Pay (pay.hanzo.ai). Hanzo Pay is the @hanzoai/pay React
|
|
* SPA that terminates the actual payment with Hanzo Commerce; we never load
|
|
* card UI inside the dataroom anymore.
|
|
*
|
|
* Returned shape mirrors the subset of `Stripe` the codebase touches:
|
|
* `redirectToCheckout({ sessionId })`. The Commerce checkout-session URL is
|
|
* returned by the server-side upgrade endpoint as `url`; when only the id is
|
|
* available, we build `pay.hanzo.ai/checkout?session=<id>` directly.
|
|
*
|
|
* TODO(stripe-rip): once every caller passes the full `url` from the
|
|
* upgrade endpoint, delete this file and call `window.location.assign(url)`
|
|
* inline.
|
|
*/
|
|
|
|
const PAY_URL = process.env.NEXT_PUBLIC_HANZO_PAY_URL ?? "https://pay.hanzo.ai";
|
|
|
|
interface CommercePay {
|
|
redirectToCheckout(params: { sessionId?: string; url?: string }): Promise<void>;
|
|
}
|
|
|
|
export const getStripe = async (_account: boolean = false): Promise<CommercePay> => {
|
|
return {
|
|
async redirectToCheckout(params: { sessionId?: string; url?: string }) {
|
|
if (params.url) {
|
|
window.location.assign(params.url);
|
|
return;
|
|
}
|
|
if (params.sessionId) {
|
|
window.location.assign(
|
|
`${PAY_URL}/checkout?session=${encodeURIComponent(params.sessionId)}`,
|
|
);
|
|
return;
|
|
}
|
|
throw new Error("commerce checkout: missing sessionId or url");
|
|
},
|
|
};
|
|
};
|