-
Notifications
You must be signed in to change notification settings - Fork 301
Embedded components #2193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gimenete-stripe
wants to merge
24
commits into
master
Choose a base branch
from
gimenete/embedded-components
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Embedded components #2193
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
db0fa9f
Embedded components
gimenete-stripe 070f198
Make react-native-webview optional and load it dynamically
gimenete-stripe e4f2e69
Extract types from @stripe/connect-js
gimenete-stripe c32af78
Custom font
gimenete-stripe 8f4d601
Use a modal for the onboarding component
gimenete-stripe 9f32ca6
Merge branch 'master' into gimenete/embedded-components
gimenete-stripe 5ea7e9b
Update podfile.lcok
gimenete-stripe e62cd98
Hide "overrides" from public interface
gimenete-stripe 7d03d7a
Change initialization API. Add toggles to switch appearance and locale
gimenete-stripe 29f09f9
Remove some alerts
gimenete-stripe e2a597b
Implement secure webviews
gimenete-stripe c8654e2
Implement secure webviews
gimenete-stripe f1acd01
Merge branch 'master' into gimenete/embedded-components
gimenete-stripe 91f52cc
Add endpoint to server
gimenete-stripe 8e58819
Improvements for Android
gimenete-stripe a6e2c87
Extract callback
gimenete-stripe 146b31c
Trying to fix deep linking on Android
gimenete-stripe 3120ef3
Native navigation bar
gimenete-stripe ef8630a
Native navigation bar
gimenete-stripe 2001d48
Small changes
gimenete-stripe 3066e48
Remember previous screen
gimenete-stripe f41b48e
Merge branch 'master' into gimenete/embedded-components
gimenete-stripe 6f9688b
Apply suggestions from code review
gimenete-stripe c3c69f9
Make onCloseButtonPress a constant
gimenete-stripe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { ConnectAccountOnboarding } from '@stripe/stripe-react-native'; | ||
| import ConnectScreen from './ConnectScreen'; | ||
|
|
||
| export default function ConnectAccountOnboardingScreen() { | ||
| return ( | ||
| <ConnectScreen> | ||
| <ConnectAccountOnboarding | ||
| onExit={() => { | ||
| console.log('ConnectAccountOnboarding onExit'); | ||
| }} | ||
| /> | ||
| </ConnectScreen> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { ConnectPayments } from '@stripe/stripe-react-native'; | ||
| import ConnectScreen from './ConnectScreen'; | ||
|
|
||
| export default function ConnectPaymentsListScreen() { | ||
| return ( | ||
| <ConnectScreen> | ||
| <ConnectPayments /> | ||
| </ConnectScreen> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { ConnectPayouts } from '@stripe/stripe-react-native'; | ||
| import ConnectScreen from './ConnectScreen'; | ||
|
|
||
| export default function ConnectPayoutsListScreen() { | ||
| return ( | ||
| <ConnectScreen> | ||
| <ConnectPayouts /> | ||
| </ConnectScreen> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import { ConnectComponentsProvider } from '@stripe/stripe-react-native'; | ||
| import { useEffect, useState } from 'react'; | ||
| import { fetchPublishableKey } from '../helpers'; | ||
| import { ActivityIndicator, StyleSheet } from 'react-native'; | ||
| import { API_URL } from '../Config'; | ||
|
|
||
| interface Props { | ||
| children?: React.ReactNode; | ||
| } | ||
|
|
||
| const ConnectScreen: React.FC<Props> = ({ children }) => { | ||
| const [publishableKey, setPublishableKey] = useState<string | null>(null); | ||
|
|
||
| useEffect(() => { | ||
| fetchPublishableKey().then((pk) => { | ||
| if (pk) { | ||
| setPublishableKey(pk); | ||
| } | ||
| }); | ||
| }, []); | ||
|
|
||
| return !publishableKey ? ( | ||
| <ActivityIndicator size="large" style={StyleSheet.absoluteFill} /> | ||
| ) : ( | ||
| <ConnectComponentsProvider | ||
| publishableKey={publishableKey} | ||
| fetchClientSecret={fetchClientSecret} | ||
| > | ||
| {children} | ||
| </ConnectComponentsProvider> | ||
| ); | ||
| }; | ||
|
|
||
| export default ConnectScreen; | ||
|
|
||
| const fetchClientSecret = async () => { | ||
| // TODO: use a different endpoint | ||
| const response = await fetch(`${API_URL}/create-payment-intent`, { | ||
| method: 'POST', | ||
| headers: { | ||
| 'Content-Type': 'application/json', | ||
| }, | ||
| body: JSON.stringify({ | ||
| currency: 'usd', | ||
| }), | ||
| }); | ||
| const json = await response.json(); | ||
| const { clientSecret } = json; | ||
|
|
||
| return clientSecret; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3144,7 +3144,7 @@ inherits@2, [email protected], inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: | |
| resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" | ||
| integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== | ||
|
|
||
| invariant@^2.2.4: | ||
| invariant@2.2.4, invariant@^2.2.4: | ||
| version "2.2.4" | ||
| resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" | ||
| integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== | ||
|
|
@@ -4379,6 +4379,14 @@ react-native-test-app@^4.2.1: | |
| semver "^7.3.5" | ||
| uuid "^11.0.0" | ||
|
|
||
| react-native-webview@^13.16.0: | ||
| version "13.16.0" | ||
| resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-13.16.0.tgz#c995148f944a7eaf12389f0e6d5c6f5e6a775686" | ||
| integrity sha512-Nh13xKZWW35C0dbOskD7OX01nQQavOzHbCw9XoZmar4eXCo7AvrYJ0jlUfRVVIJzqINxHlpECYLdmAdFsl9xDA== | ||
| dependencies: | ||
| escape-string-regexp "^4.0.0" | ||
| invariant "2.2.4" | ||
|
|
||
| react-native@^0.78.0: | ||
| version "0.78.0" | ||
| resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.78.0.tgz#3e76252c8f8f35e5b7e07f9d8aee775aa8a315a7" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.