From 9ced895772ebecb2fa330ae2eecd42060abf2a7b Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Wed, 29 Nov 2023 18:15:14 +0000 Subject: WIP --- src/components/LallansIssue.astro | 4 +- src/components/PayPalButtons.astro | 150 ------------------------- src/components/ProductPayPalButtons.astro | 150 +++++++++++++++++++++++++ src/components/Scotsoun.astro | 4 +- src/components/SubscriptionPayPalButtons.astro | 112 ++++++++++++++++++ src/pages/[locale]/created-subscription.astro | 7 ++ src/pages/[locale]/index.astro | 4 + 7 files changed, 277 insertions(+), 154 deletions(-) delete mode 100644 src/components/PayPalButtons.astro create mode 100644 src/components/ProductPayPalButtons.astro create mode 100644 src/components/SubscriptionPayPalButtons.astro create mode 100644 src/pages/[locale]/created-subscription.astro (limited to 'src') diff --git a/src/components/LallansIssue.astro b/src/components/LallansIssue.astro index c8bc6eb..9fe686a 100644 --- a/src/components/LallansIssue.astro +++ b/src/components/LallansIssue.astro @@ -7,7 +7,7 @@ import type LallansIssue from '$types/LallansIssue'; import { Image } from 'astro:assets'; import LallansIssueContributions from './LallansIssueContributions.astro'; import LallansIssueContributors from './LallansIssueContributors.astro'; -import PayPalButtons from './PayPalButtons.astro'; +import ProductPayPalButtons from './ProductPayPalButtons.astro'; interface Props { issue: LallansIssue; @@ -27,7 +27,7 @@ const t = translate(locale);
- -
- - - diff --git a/src/components/ProductPayPalButtons.astro b/src/components/ProductPayPalButtons.astro new file mode 100644 index 0000000..952e6a8 --- /dev/null +++ b/src/components/ProductPayPalButtons.astro @@ -0,0 +1,150 @@ +--- +import env from '$lib/env'; +import type Price from '$types/Price'; + +interface Props { + successPageUrl: string; + productDescription: string; + shortDescription: string; + totalPrice: Price; +} + +const { successPageUrl, productDescription, shortDescription, totalPrice } = Astro.props; + +const PAYPAL_CLIENT_ID = + env.ENVIRONMENT === 'prod' ? env.PAYPAL_LIVE_CLIENT_ID : env.PAYPAL_SANDBOX_CLIENT_ID; +--- + + +
+
+ + diff --git a/src/components/Scotsoun.astro b/src/components/Scotsoun.astro index bbf9730..8252e71 100644 --- a/src/components/Scotsoun.astro +++ b/src/components/Scotsoun.astro @@ -4,7 +4,7 @@ import translate from '$i18n/translate'; import tSite from '$i18n/translations/site'; import tComponent from '$i18n/translations/components/scotsoun'; import type Scotsoun from '$types/Scotsoun'; -import PayPalButtons from './PayPalButtons.astro'; +import ProductPayPalButtons from './ProductPayPalButtons.astro'; import relativePath from '$lib/relativePath'; import { getLocaleFromPathOrThrow } from '$lib/getLocaleFromPath'; @@ -27,7 +27,7 @@ const t = translate(locale);
- +
+ + + diff --git a/src/pages/[locale]/created-subscription.astro b/src/pages/[locale]/created-subscription.astro new file mode 100644 index 0000000..f913932 --- /dev/null +++ b/src/pages/[locale]/created-subscription.astro @@ -0,0 +1,7 @@ +--- +import Page from '$layouts'; +--- + + +

TODO

+ diff --git a/src/pages/[locale]/index.astro b/src/pages/[locale]/index.astro index c67ded0..e5ba6b7 100644 --- a/src/pages/[locale]/index.astro +++ b/src/pages/[locale]/index.astro @@ -64,6 +64,10 @@ const mostRecentNewsItem = await getMostRecentNewsItem(locale);

+ +