@replohq/sdk 1.14.0 → 1.14.1
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/cart/buy-now-action.js +6 -3
- package/lib/buildMetadata.js +3 -3
- package/package.json +4 -4
package/cart/buy-now-action.js
CHANGED
|
@@ -9,6 +9,7 @@ import { buildBaseUrl } from "../lib/url-utils";
|
|
|
9
9
|
import { createCartAction } from "./cart-actions";
|
|
10
10
|
import { REPLO_ATTRIBUTION_PROPERTY } from "./cart-types";
|
|
11
11
|
import { getReturnUrls } from "./return-urls";
|
|
12
|
+
const REPLO_PROJECT_ID_KEY = "rpid";
|
|
12
13
|
class BuyNowError extends CanopyError {
|
|
13
14
|
}
|
|
14
15
|
class BuyNowCartCreationError extends CanopyError {
|
|
@@ -53,7 +54,7 @@ async function buyNowWithRecoveryAction(input) {
|
|
|
53
54
|
"[Replo] Stripe buy now does not support selling plans or discount codes; those options were ignored."
|
|
54
55
|
);
|
|
55
56
|
}
|
|
56
|
-
const
|
|
57
|
+
const env2 = await getEnv();
|
|
57
58
|
const temporaryCartId = input.checkoutAttemptId ?? uuidv4();
|
|
58
59
|
const body = {
|
|
59
60
|
cartId: temporaryCartId,
|
|
@@ -63,11 +64,11 @@ async function buyNowWithRecoveryAction(input) {
|
|
|
63
64
|
quantity: line.quantity,
|
|
64
65
|
properties: line.properties
|
|
65
66
|
})),
|
|
66
|
-
projectId:
|
|
67
|
+
projectId: env2.PROJECT_ID,
|
|
67
68
|
successUrl: `${origin}/checkout/success`,
|
|
68
69
|
cancelUrl
|
|
69
70
|
};
|
|
70
|
-
const canopyApiUrl = `${buildBaseUrl(
|
|
71
|
+
const canopyApiUrl = `${buildBaseUrl(env2.CANOPY_API_HOST)}/api/v1/stripe-checkout/create-session`;
|
|
71
72
|
const response = await fetch(canopyApiUrl, {
|
|
72
73
|
method: "POST",
|
|
73
74
|
headers: { "Content-Type": "application/json" },
|
|
@@ -130,6 +131,8 @@ async function buyNowWithRecoveryAction(input) {
|
|
|
130
131
|
});
|
|
131
132
|
}
|
|
132
133
|
const checkoutUrl = new URL(cart.checkoutUrl, origin);
|
|
134
|
+
const env = await getEnv();
|
|
135
|
+
checkoutUrl.searchParams.set(REPLO_PROJECT_ID_KEY, env.PROJECT_ID);
|
|
133
136
|
return { result: "created", redirectUrl: checkoutUrl.toString() };
|
|
134
137
|
}
|
|
135
138
|
export {
|
package/lib/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sdk",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.1",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "19094c206182dc6886a38bbc6fcd1541c8123b64",
|
|
6
|
+
"builtAt": "2026-10-08T22:22:26.957Z"
|
|
7
7
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sdk",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.1",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sdk",
|
|
6
|
-
"version": "1.14.
|
|
6
|
+
"version": "1.14.1",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-10-
|
|
8
|
+
"commit": "19094c206182dc6886a38bbc6fcd1541c8123b64",
|
|
9
|
+
"builtAt": "2026-10-08T22:22:26.957Z"
|
|
10
10
|
},
|
|
11
11
|
"description": "Replo SDK — cart, analytics, and data loaders for agent-built Next.js sites.",
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE",
|