Cors Policy blocked

Hi flutterwave,
ravepay.co/v3/checkout/initialize’ from origin ‘https://checkout-v3-ui-prod.f4b-flutterwave.com’ has been
blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
{“status”:“error”,“message”:“Authorization required”,“data”:null}

this my code:

 $('#pay').click(function makePayment() {
                FlutterwaveCheckout({
                    public_key: "{{public_key}}",
                    tx_ref: "{{ payment.transaction_id }}",
                    amount: parseFloat('{{ order.get_cart_total_price }}'),
                    currency: "{{currency}}",
                    redirect_url: "http://127.0.0.1:8000/receive_payment/",
                    customer: {
                        email: "{{request.user.email}}",
                        phone_number: "{{ request.user.profile.phone_number }}",
                        name: "{{ request.user.get_full_name }}",
                    },
                    customizations: {
                        title: "HOOYIA MARKET",
                        description: "Payment on HooYia easy life",
                        logo: "https://www.logolynx.com/images/logolynx/22/2239ca38f5505fbfce7e55bbc0604386.jpeg",
                    },
                });
            });

I’m getting this error when trying to lunch inline flutterwave

please need help

Hi @Donald_Programmeur

Thank you for choosing Flutterwave.

The errors are as a result of your implementation being served locally.

Here are a few ways to prevent this error.

  1. if you are making use of an html file do not serve it . simply open the file on browser via the full file path. for example file:///Usr/johndoe/Document/inline/index.html
  2. if you do need to serve your files i would recommend using services like Gitpod or Github Codespaces that are more suitable development environments.

Regards

Hi @Abraham_Olaobaju
thank you
I hosted the app and it working well

thanks

1 Like