Open fimbres opened 4 months ago
Some Code:
const openPaymentSheet = async () => {
const { error } = await presentPaymentSheet();
if (error) {
Alert.alert(`Error code: ${error.code}`, error.message);
} else {
Alert.alert('Success', 'Your order is confirmed!');
}
};
const initializePaymentSheet = async () => {
setStatus('loading');
const data = await createCheckout(userData?.stripeCustomerId!, userData?.stripeEphemeralKey!, totalPrice);
const { error } = await initPaymentSheet({
merchantDisplayName: "Paycon México",
customerId: data?.customer,
customerEphemeralKeySecret: data?.ephemeralKey,
paymentIntentClientSecret: data?.paymentIntent!,
allowsDelayedPaymentMethods: false,
defaultBillingDetails: {
name: userData?.name,
},
returnURL: 'paycon://home/checkout'
});
if (error) {
setStatus('error');
}
else {
setStatus('success');
}
};
useEffect(() => {
initializePaymentSheet();
}, []);
<AppButton variant='primary' disabled={status === 'loading'} onPressIn={openPaymentSheet}>Realizar Compra</AppButton>
Describe the bug When I open the payment sheet in my react native with expo app it opens with loading state, then it closes and an error appears saying: Expired API Key provided: ek_testYW*******r1xQ.
Fun fact 1: I don't know what does 'ek' at the start of the key even means, cause for example I think pk means public key or sk means secret key. And any of my current keys ends with 'r1xQ', so I don't know where that key came from.
Fun fact 2: It was working and suddenly after doing a couple changes in my implementation to change the appearance of the sheet. It began to crash.
To Reproduce Steps to reproduce the behavior:
Expected behavior be able to open the sheet again, and complete a payment.
Screenshots If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.