Skip to content
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

feat: GA customer sheet #1762

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

**Features**

- `CustomerSheet` is now generally available!
- If you were using `CustomerSheetBeta`, change that to `CustomerSheet`.
- If you were using `CustomerSheetBeta.CustomerSheet`, change that to `CustomerSheet.Component`

## 0.39.0 - 2024-10-15

**Features**
Expand Down
10 changes: 5 additions & 5 deletions example/src/screens/CustomerSheetScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Alert, Image, StyleSheet, Switch, Text, View } from 'react-native';
import { CustomerSheetBeta } from '@stripe/stripe-react-native';
import { CustomerSheet } from '@stripe/stripe-react-native';
import { PaymentSheet } from '@stripe/stripe-react-native';
import Button from '../components/Button';
import PaymentScreen from '../components/PaymentScreen';
Expand Down Expand Up @@ -64,7 +64,7 @@ export default function CustomerSheetScreen() {
address: address,
};

const { error } = await CustomerSheetBeta.initialize({
const { error } = await CustomerSheet.initialize({
setupIntentClientSecret,
customerEphemeralKeySecret,
customerId,
Expand All @@ -87,7 +87,7 @@ export default function CustomerSheetScreen() {
error: retrievalError,
paymentOption,
paymentMethod,
} = await CustomerSheetBeta.retrievePaymentOptionSelection();
} = await CustomerSheet.retrievePaymentOptionSelection();
if (retrievalError) {
Alert.alert(retrievalError.code, retrievalError.localizedMessage);
}
Expand All @@ -107,7 +107,7 @@ export default function CustomerSheetScreen() {
setCustomerSheetVisible(true);
} else {
const { error, paymentOption, paymentMethod } =
await CustomerSheetBeta.present();
await CustomerSheet.present();
if (error) {
Alert.alert(error.code, error.localizedMessage);
}
Expand Down Expand Up @@ -136,7 +136,7 @@ export default function CustomerSheetScreen() {
}}
/>
{useComponent && customerAdapter && (
<CustomerSheetBeta.CustomerSheet
<CustomerSheet.Component
visible={customerSheetVisible}
setupIntentClientSecret={setupIntent}
customerEphemeralKeySecret={ephemeralKeySecret}
Expand Down
6 changes: 3 additions & 3 deletions src/components/CustomerSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export type Props = {
* @returns JSX.Element
* @category ReactComponents
*/
function CustomerSheet({
function Component({
visible,
presentationStyle,
animationStyle,
Expand Down Expand Up @@ -319,8 +319,8 @@ function CustomerSheet({
/**
* The Customer Sheet is a prebuilt UI component that lets your customers manage their saved payment methods.
*/
export const CustomerSheetBeta = {
CustomerSheet,
export const CustomerSheet = {
Component,
initialize,
present,
retrievePaymentOptionSelection,
Expand Down
Loading