-
Notifications
You must be signed in to change notification settings - Fork 159
Open
Description
Whenever I click on the button that triggers and opens the pop up where the credit card details are entered, I get this CORS error:
I don't know if it's specific to Stripe, but I get seem to find a workaround.
This is my implementation of the code:
const handleToken = async () => {
const response = await axios({
method: 'post',
url:
'https://cors-anywhere.herokuapp.com/https://accessmexico.herokuapp.com/charge',
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': 'true'
}
});
const { status } = response.data;
console.log('Response:', response.data);
if (status === 'success') {
toast('Success!', { type: 'success' });
} else {
toast('Something went wrong', { type: 'error' });
}
};<StripeCheckout
token={() => handleToken()}
stripeKey="pk_test_[key]"
amount={parseInt(cleanMonto) * 100}
name="Reservacion Access"
locale="auto"
currency="MXN"
label="Reservar"
/>Metadata
Metadata
Assignees
Labels
No labels
