Skip to content

Instantly share code, notes, and snippets.

@callstack-bot
Created June 17, 2022 11:41
Show Gist options
  • Save callstack-bot/841a531bd350dec514c91e487f8b0daf to your computer and use it in GitHub Desktop.
Save callstack-bot/841a531bd350dec514c91e487f8b0daf to your computer and use it in GitHub Desktop.
// ...your imports
import { View, StyleSheet } from 'react-native';
import {
StripeProvider, CardField
} from '@stripe/stripe-react-native';
import { Button } from 'react-native-paper';
export default function App() {
return (
<StripeProvider
publishableKey="pk_test_51AROWSJX9HHJ5bycpEUP9dK39tXufyuWogSUdeweyZEty3LC7M8yc5d9NlQ96fRCVL0BlAu7Nqt4V7N5xZjJnrkp005fDiTMIr"
>
<View style={styles.container}>
<CardField
postalCodeEnabled={false}
autofocus
style={styles.cardField}
cardStyle={{
textColor: '#1c1c1c',
}}
/>
<Button>Pay</Button>
</View>
</StripeProvider>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
padding: 8,
},
cardField: {
height: 50,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment