Skip to content

Commit e28dad5

Browse files
Merge pull request #72 from blacksky-algorithms/stripe
add stripe checkout and support page
2 parents 0b53598 + 23bc656 commit e28dad5

16 files changed

Lines changed: 717 additions & 173 deletions

.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ GEOLOCATION_DEV_URL=
4646

4747
# live-events web worker URL
4848
LIVE_EVENTS_DEV_URL=
49+
50+
# Stripe
51+
EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY=
52+
EXPO_PUBLIC_STRIPE_API_URL=

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ ENV EXPO_PUBLIC_GROWTHBOOK_API_HOST=${EXPO_PUBLIC_GROWTHBOOK_API_HOST:-${EXPO_PU
6060
ARG EXPO_PUBLIC_GROWTHBOOK_CLIENT_KEY
6161
ENV EXPO_PUBLIC_GROWTHBOOK_CLIENT_KEY=${EXPO_PUBLIC_GROWTHBOOK_CLIENT_KEY:-sdk-7gkUkGy9wguUjyFe}
6262

63+
#
64+
# Stripe
65+
#
66+
ARG EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY
67+
ENV EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY=$EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY
68+
ARG EXPO_PUBLIC_STRIPE_API_URL
69+
ENV EXPO_PUBLIC_STRIPE_API_URL=$EXPO_PUBLIC_STRIPE_API_URL
70+
6371
#
6472
# Copy everything into the container
6573
#
@@ -88,6 +96,8 @@ RUN \. "$NVM_DIR/nvm.sh" && \
8896
echo "EXPO_PUBLIC_METRICS_API_HOST=$EXPO_PUBLIC_METRICS_API_HOST" >> .env && \
8997
echo "EXPO_PUBLIC_GROWTHBOOK_API_HOST=$EXPO_PUBLIC_GROWTHBOOK_API_HOST" >> .env && \
9098
echo "EXPO_PUBLIC_GROWTHBOOK_CLIENT_KEY=$EXPO_PUBLIC_GROWTHBOOK_CLIENT_KEY" >> .env && \
99+
echo "EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY=$EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY" >> .env && \
100+
echo "EXPO_PUBLIC_STRIPE_API_URL=$EXPO_PUBLIC_STRIPE_API_URL" >> .env && \
91101
npm install --global yarn && \
92102
yarn && \
93103
yarn intl:build 2>&1 | tee i18n.log && \

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@
106106
"@react-navigation/native": "^7.1.26",
107107
"@react-navigation/native-stack": "^7.9.0",
108108
"@sentry/react-native": "~6.20.0",
109+
"@stripe/react-stripe-js": "^6.1.0",
110+
"@stripe/stripe-js": "^9.0.1",
109111
"@tanstack/query-async-storage-persister": "^5.25.0",
110112
"@tanstack/react-query": "5.25.0",
111113
"@tanstack/react-query-persist-client": "^5.25.0",

src/Navigation.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import {ProfileScreen} from '#/view/screens/Profile'
6868
import {ProfileFeedLikedByScreen} from '#/view/screens/ProfileFeedLikedBy'
6969
import {StorybookScreen} from '#/view/screens/Storybook'
7070
import {SupportScreen} from '#/view/screens/Support'
71+
import {SupportReturnScreen} from '#/view/screens/SupportReturn'
7172
import {TermsOfServiceScreen} from '#/view/screens/TermsOfService'
7273
import {BottomBar} from '#/view/shell/bottom-bar/BottomBar'
7374
import {createNativeStackNavigatorWithAuth} from '#/view/shell/createNativeStackNavigatorWithAuth'
@@ -334,6 +335,11 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) {
334335
getComponent={() => SupportScreen}
335336
options={{title: title(msg`Support`)}}
336337
/>
338+
<Stack.Screen
339+
name="SupportReturn"
340+
getComponent={() => SupportReturnScreen}
341+
options={{title: title(msg`Support`)}}
342+
/>
337343
<Stack.Screen
338344
name="PrivacyPolicy"
339345
getComponent={() => PrivacyPolicyScreen}

src/env/common.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,15 @@ export const LIVE_EVENTS_PROD_URL = `https://live-events.workers.bsky.app`
142142
export const LIVE_EVENTS_URL = IS_DEV
143143
? (LIVE_EVENTS_DEV_URL ?? LIVE_EVENTS_PROD_URL)
144144
: LIVE_EVENTS_PROD_URL
145+
146+
/**
147+
* Stripe publishable key for embedded checkout
148+
*/
149+
export const STRIPE_PUBLISHABLE_KEY: string =
150+
process.env.EXPO_PUBLIC_STRIPE_PUBLISHABLE_KEY || ''
151+
152+
/**
153+
* Stripe API URL for creating checkout sessions
154+
*/
155+
export const STRIPE_API_URL: string =
156+
process.env.EXPO_PUBLIC_STRIPE_API_URL || ''

src/lib/routes/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export type CommonNavigatorParams = {
3838
SharedPreferencesTester: undefined
3939
Log: undefined
4040
Support: undefined
41+
SupportReturn: {session_id?: string}
4142
PrivacyPolicy: undefined
4243
TermsOfService: undefined
4344
CommunityGuidelines: undefined

0 commit comments

Comments
 (0)