Repository: shipshapecode/shepherd (language: javascript)

Issue:
Update Polar checkout flow to updated version
Polar team asked if we can migrate to our new checkout vs. old one. It has a lot of more powerful features, showcases the product and your brand etc. Plus the migration should be fairly easy and straightforward.

https://docs.polar.sh/api/v1/checkouts/custom/post


Discussion / hints:

Fix patch:
diff --git a/landing/package.json b/landing/package.json
index 8d9a25b48..a7403e57b 100644
--- a/landing/package.json
+++ b/landing/package.json
@@ -17,7 +17,7 @@
     "@astrojs/sitemap": "^3.2.1",
     "@astrojs/tailwind": "^5.1.2",
     "@astrojs/vercel": "^7.8.2",
-    "@polar-sh/sdk": "^0.16.0",
+    "@polar-sh/sdk": "^0.20.2",
     "astro": "^4.16.1",
     "shepherd.js": "workspace:*",
     "tailwindcss": "^3.4.17",
diff --git a/landing/src/actions/index.ts b/landing/src/actions/index.ts
index d50914a6b..cda15fc72 100644
--- a/landing/src/actions/index.ts
+++ b/landing/src/actions/index.ts
@@ -17,7 +17,7 @@ export const server = {
       let result;
 
       try {
-        result = await polar.checkouts.create({
+        result = await polar.checkouts.custom.create({
           productPriceId,
           successUrl: 'https://docs.shepherdjs.dev'
         });
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c03cc58c8..016357391 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -127,8 +127,8 @@ importers:
         specifier: ^7.8.2
         version: 7.8.2(astro@4.16.1(@types/node@20.14.12)(rollup@4.24.0)(terser@5.31.3)(typescript@5.6.3))(encoding@0.1.13)(react@18.3.1)
       '@polar-sh/sdk':
-        specifier: ^0.16.0
-        version: 0.16.0(zod@3.23.8)
+        specifier: ^0.20.2
+        version: 0.20.2(zod@3.23.8)
       astro:
         specifier: ^4.16.1
         version: 4.16.1(@types/node@20.14.12)(rollup@4.24.0)(terser@5.31.3)(typescript@5.6.3)
@@ -2077,8 +2077,8 @@ packages:
     resolution: {integrity: sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==}
     engines: {node: '>=12'}
 
-  '@polar-sh/sdk@0.16.0':
-    resolution: {integrity: sha512-36ZNq2TGNQETHyNTvyKBkpO04vonPSuqhiofRC03JgkaS90oqJxljW5zjcDsC7GjgS9Ixe+r20G66qj65XbA0Q==}
+  '@polar-sh/sdk@0.20.2':
+    resolution: {integrity: sha512-Rrqt2jyg1VhO9Gfy3WpLF9bST5yxXGnNJ1a/vHw/N4CXWZNbafKjKVGI2f7t1emCosvzkT2BpIBf+b19CpUTiw==}
     peerDependencies:
       zod: '>= 3'
 
@@ -2389,6 +2389,9 @@ packages:
   '@sinonjs/fake-timers@10.3.0':
     resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==}
 
+  '@stablelib/base64@1.0.1':
+    resolution: {integrity: sha512-1bnPQqSxSuc3Ii6MhBysoWCg58j97aUjuCSZrGSmDxNqtytIi0k8utUenAwTZN4V5mXXYGsVUI9zeBqy+jBOSQ==}
+
   '@tailwindcss/typography@0.5.15':
     resolution: {integrity: sha512-AqhlCXl+8grUz8uqExv5OTtgpjuVIwFTSXTrh8y9/pw6q2ek7fJ+Y8ZEVw7EB2DCcuCOtEjf9w3+J3rzts01uA==}
     peerDependencies:
@@ -4071,6 +4074,9 @@ packages:
   fast-levenshtein@2.0.6:
     resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
 
+  fast-sha256@1.3.0:
+    resolution: {integrity: sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ==}
+
   fast-uri@3.0.1:
     resolution: {integrity: sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==}
 
@@ -7285,6 +7291,9 @@ packages:
   stackback@0.0.2:
     resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
 
+  standardwebhooks@1.0.0:
+    resolution: {integrity: sha512-BbHGOQK9olHPMvQNHWul6MYlrRTAOKn03rOe4A8O3CLWhNf4YHBqq2HJKKC+sfqpxiBY52pNeesD6jIiLDz8jg==}
+
   starlight-typedoc@0.16.0:
     resolution: {integrity: sha512-9B2kmX8S2J3cHenlf+TqVV+ogIrOolf8UxMu0f/lWDX/XVQDAjr44j0/y8k7Nfc+V6TmndsJbRIOpAmPAIvxAg==}
     engines: {node: '>=18.14.1'}
@@ -10612,8 +10621,9 @@ snapshots:
       '@pnpm/network.ca-file': 1.0.2
       config-chain: 1.1.13
 
-  '@polar-sh/sdk@0.16.0(zod@3.23.8)':
+  '@polar-sh/sdk@0.20.2(zod@3.23.8)':
     dependencies:
+      standardwebhooks: 1.0.0
       zod: 3.23.8
 
   '@polka/url@1.0.0-next.25': {}
@@ -10878,6 +10888,8 @@ snapshots:
     dependencies:
       '@sinonjs/commons': 3.0.1
 
+  '@stablelib/base64@1.0.1': {}
+
   '@tailwindcss/typography@0.5.15(tailwindcss@3.4.17)':
     dependencies:
       lodash.castarray: 4.4.0
@@ -13047,6 +13059,8 @@ snapshots:
 
   fast-levenshtein@2.0.6: {}
 
+  fast-sha256@1.3.0: {}
+
   fast-uri@3.0.1: {}
 
   fast-xml-parser@4.5.0:
@@ -17206,6 +17220,11 @@ snapshots:
 
   stackback@0.0.2: {}
 
+  standardwebhooks@1.0.0:
+    dependencies:
+      '@stablelib/base64': 1.0.1
+      fast-sha256: 1.3.0
+
   starlight-typedoc@0.16.0(@astrojs/starlight@0.27.1(astro@4.16.1(@types/node@20.14.12)(rollup@4.24.0)(terser@5.31.3)(typescript@5.6.3)))(astro@4.16.1(@types/node@20.14.12)(rollup@4.24.0)(terser@5.31.3)(typescript@5.6.3))(typedoc-plugin-markdown@4.2.9(typedoc@0.26.7(typescript@5.6.3)))(typedoc@0.26.7(typescript@5.6.3)):
     dependencies:
       '@astrojs/starlight': 0.27.1(astro@4.16.1(@types/node@20.14.12)(rollup@4.24.0)(terser@5.31.3)(typescript@5.6.3))


Test patch: