Skip to content

Commit 69c7f45

Browse files
authored
Merge pull request #505 from wasp-lang/franjo/refactor-stripe-payment-provider
2 parents 026ac73 + 5f894c0 commit 69c7f45

30 files changed

+613
-542
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ jobs:
106106
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
107107
STRIPE_API_KEY: ${{ secrets.STRIPE_KEY }}
108108
STRIPE_WEBHOOK_SECRET: ${{ secrets.STRIPE_WEBHOOK_SECRET }}
109-
STRIPE_CUSTOMER_PORTAL_URL: https://billing.stripe.com/p/login/test_8wM8x17JN7DT4zC000
110109
PAYMENTS_HOBBY_SUBSCRIPTION_PLAN_ID: ${{ secrets.STRIPE_HOBBY_SUBSCRIPTION_PRICE_ID }}
111110
PAYMENTS_PRO_SUBSCRIPTION_PLAN_ID: ${{ secrets.STRIPE_PRO_SUBSCRIPTION_PRICE_ID }}
112111
PAYMENTS_CREDITS_10_PLAN_ID: ${{ secrets.STRIPE_CREDITS_PRICE_ID }}

opensaas-sh/app_diff/README.md.diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
--- template/app/README.md
22
+++ opensaas-sh/app/README.md
3-
@@ -1,16 +1,31 @@
3+
@@ -1,6 +1,8 @@
44
-# <YOUR_APP_NAME>
55
+# opensaas.sh (demo) app
66

77
-Built with [Wasp](https://wasp.sh), based on the [Open Saas](https://opensaas.sh) template.
88
+This is a Wasp app based on Open Saas template with minimal modifications that make it into a demo app that showcases Open Saas's abilities.
9-
10-
+It is deployed to https://opensaas.sh and serves both as a landing page for Open Saas and as a demo app.
119
+
10+
+It is deployed to https://opensaas.sh and serves both as a landing page for Open Saas and as a demo app.
11+
1212
## UI Components
1313

14-
This template includes [ShadCN UI](https://ui.shadcn.com/) v2 for beautiful, accessible React components. See [SHADCN_SETUP.md](./SHADCN_SETUP.md) for details on how to use ShadCN components in your app.
14+
@@ -8,9 +10,22 @@
1515

1616
## Development
1717

opensaas-sh/app_diff/deletions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ src/payment/lemonSqueezy/checkoutUtils.ts
55
src/payment/lemonSqueezy/paymentDetails.ts
66
src/payment/lemonSqueezy/paymentProcessor.ts
77
src/payment/lemonSqueezy/webhook.ts
8+
src/payment/lemonSqueezy/webhookPayload.ts
89
src/payment/webhook.ts

opensaas-sh/app_diff/package-lock.json.diff

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

opensaas-sh/app_diff/src/analytics/stats.ts.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { type DailyStats } from "wasp/entities";
77
import { type DailyStatsJob } from "wasp/server/jobs";
88
+import { SubscriptionStatus } from "../payment/plans";
9-
import { stripe } from "../payment/stripe/stripeClient";
9+
import { stripeClient } from "../payment/stripe/stripeClient";
1010
import {
1111
getDailyPageViews,
1212
getSources,
@@ -38,7 +38,7 @@
3838

3939
const { totalViews, prevDayViewsChangePercent } = await getDailyPageViews();
4040

41-
@@ -176,38 +162,3 @@
41+
@@ -177,38 +163,3 @@
4242
// Revenue is in cents so we convert to dollars (or your main currency unit)
4343
return totalRevenue / 100;
4444
}

opensaas-sh/app_diff/src/client/Main.css.diff

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
--- template/app/src/client/Main.css
22
+++ opensaas-sh/app/src/client/Main.css
3-
@@ -56,8 +56,66 @@
3+
@@ -56,6 +56,64 @@
44
.border-gradient-primary > * {
55
background: hsl(var(--background));
66
}
@@ -21,8 +21,8 @@
2121
+ hsl(var(--card)) 100%
2222
+ );
2323
+ }
24-
}
25-
24+
+}
25+
+
2626
+/* Satoshi Font Family */
2727
+@font-face {
2828
+ font-family: "Satoshi";
@@ -62,11 +62,9 @@
6262
+ font-weight: 900;
6363
+ font-style: normal;
6464
+ font-display: swap;
65-
+}
66-
+
67-
/* third-party libraries CSS */
65+
}
6866

69-
.tableCheckbox:checked ~ div span {
67+
/* third-party libraries CSS */
7068
@@ -176,4 +234,22 @@
7169
body {
7270
@apply bg-background text-foreground;
@@ -85,8 +83,8 @@
8583
+ p {
8684
+ @apply font-mono text-base leading-relaxed;
8785
+ }
88-
}
86+
+}
8987
+
9088
+.navbar-maxwidth-transition {
9189
+ transition: max-width 300ms cubic-bezier(0.4, 0, 0.2, 1);
92-
+}
90+
}

opensaas-sh/app_diff/src/file-upload/operations.ts.diff

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import * as z from "zod";
1212
import { ensureArgsSchemaOrThrowHttpError } from "../server/validation";
13-
@@ -37,11 +38,16 @@
13+
@@ -37,10 +38,15 @@
1414
throw new HttpError(401);
1515
}
1616

@@ -25,9 +25,8 @@
2525
+ if (userFileLimitReached) {
2626
+ throw new HttpError(403, 'This demo only allows 2 file uploads per user.');
2727
+ }
28-
29-
+ const { fileType, fileName } = ensureArgsSchemaOrThrowHttpError(createFileInputSchema, rawArgs);
3028
+
29+
+ const { fileType, fileName } = ensureArgsSchemaOrThrowHttpError(createFileInputSchema, rawArgs);
30+
3131
return await getUploadFileSignedURLFromS3({
3232
fileType,
33-
fileName,

opensaas-sh/app_diff/src/landing-page/contentSections.tsx.diff

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -160,42 +160,46 @@
160160
- avatarSrc: daBoiAvatar,
161161
- socialUrl: "https://twitter.com/wasplang",
162162
- quote: "I don't even know how to code. I'm just a plushie.",
163+
- },
164+
- {
165+
- name: "Mr. Foobar",
166+
- role: "Founder @ Cool Startup",
167+
- avatarSrc: daBoiAvatar,
168+
- socialUrl: "",
169+
- quote: "This product makes me cooler than I already am.",
170+
- },
171+
- {
172+
- name: "Jamie",
173+
- role: "Happy Customer",
174+
- avatarSrc: daBoiAvatar,
175+
- socialUrl: "#",
176+
- quote: "My cats love it!",
163177
+ name: "Max Khamrovskyi",
164178
+ role: "Senior Eng @ Red Hat",
165179
+ avatarSrc:
166180
+ "https://pbs.twimg.com/profile_images/1719397191205179392/V_QrGPSO_400x400.jpg",
167181
+ socialUrl: "https://twitter.com/maksim36ua",
168182
+ quote:
169183
+ "I used Wasp to build and sell my AI-augmented SaaS app for marketplace vendors within two months!",
170-
},
171-
{
172-
- name: "Mr. Foobar",
173-
- role: "Founder @ Cool Startup",
174-
- avatarSrc: daBoiAvatar,
175-
- socialUrl: "",
176-
- quote: "This product makes me cooler than I already am.",
184+
+ },
185+
+ {
177186
+ name: "Jonathan Cocharan",
178187
+ role: "Entrepreneur",
179188
+ avatarSrc:
180189
+ "https://pbs.twimg.com/profile_images/1950172296376639488/sZ0JIqfR_400x400.jpg",
181190
+ socialUrl: "https://twitter.com/JonathanCochran",
182191
+ quote:
183192
+ "In just 6 nights... my SaaS app is live 🎉! Huge thanks to the amazing @wasplang community 🙌 for their guidance along the way. These tools are incredibly efficient 🤯!",
184-
},
185-
{
186-
- name: "Jamie",
187-
- role: "Happy Customer",
188-
- avatarSrc: daBoiAvatar,
189-
- socialUrl: "#",
190-
- quote: "My cats love it!",
193+
+ },
194+
+ {
191195
+ name: "Billy Howell",
192196
+ role: "Entrepreneur",
193197
+ avatarSrc:
194198
+ "https://pbs.twimg.com/profile_images/1877734205561430016/jjpG4mS6_400x400.jpg",
195199
+ socialUrl: "https://twitter.com/billyjhowell",
196200
+ quote:
197201
+ "Congrats! I am loving Wasp & Open SaaS. It's really helped me, a self-taught coder increase my confidence. I feel like I've finally found the perfect, versatile stack for all my projects instead of trying out a new one each time.",
198-
},
202+
+ },
199203
+ {
200204
+ name: "Tim Skaggs",
201205
+ role: "Founder @ Antler US",
@@ -249,7 +253,7 @@
249253
+ "https://dev.to/wasp/our-web-framework-reached-9000-stars-on-github-9000-jij#comment-2dech",
250254
+ quote:
251255
+ "This is exactly the framework I've been dreaming of ever since I've been waiting to fully venture into the JS Backend Dev world. I believe Wasp will go above 50k stars this year. The documentation alone gives me the confidence that this is my permanent Nodejs framework and I'm staying with Wasp. Phenomenal work by the team... Please keep up your amazing spirits. Thank you",
252-
+ },
256+
},
253257
];
254258
-
255259
export const faqs = [
@@ -261,14 +265,14 @@
261265
+ question: "Why is this SaaS Template free and open-source?",
262266
+ answer:
263267
+ "We believe the best product is made when the community puts their heads together. We also believe a quality starting point for a web app should be free and available to everyone. Our hope is that together we can create the best SaaS template out there and bring our ideas to customers quickly.",
264-
},
268+
+ },
265269
+ {
266270
+ id: 2,
267271
+ question: "What's Wasp?",
268272
+ href: "https://wasp-lang.dev",
269273
+ answer:
270274
+ "It's the fastest way to develop full-stack React + NodeJS + Prisma apps and it's what gives this template superpowers. Wasp relies on React, NodeJS, and Prisma to define web components and server queries and actions. Wasp's secret sauce is its compiler which takes the client, server code, and config file and outputs the client app, server app and deployment code, supercharging the development experience. Combined with this template, you can build a SaaS app in record time.",
271-
+ },
275+
},
272276
];
273277
-
274278
export const footerNavigation = {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
--- template/app/src/payment/paymentProcessor.ts
22
+++ opensaas-sh/app/src/payment/paymentProcessor.ts
3-
@@ -27,9 +27,4 @@
3+
@@ -28,9 +28,4 @@
44
webhookMiddlewareConfigFn: MiddlewareConfigFn;
55
}
66

77
-/**
88
- * Choose which payment processor you'd like to use, then delete the
99
- * other payment processor code that you're not using from `/src/payment`
1010
- */
11-
-// export const paymentProcessor: PaymentProcessor = lemonSqueezyPaymentProcessor;
1211
export const paymentProcessor: PaymentProcessor = stripePaymentProcessor;
12+
-// export const paymentProcessor: PaymentProcessor = lemonSqueezyPaymentProcessor;

opensaas-sh/app_diff/src/payment/stripe/paymentDetails.ts.diff

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)