Please help!! Stripe Integration

I have been trying to integrate stripe for 7 hours in a row now using 4+ different code and i keep getting this in my stripe dashboard. I am suppose to launch today and it’s necessary to have thi sintegration since i created a salesfunnel where people can immediately buy from. This is th error message i get.
Does anybody know how i can solve this? Everything is more than welcome!!

this is the code that i used: https://www.vorbly.com/Vorbly-Code/WIX-STRIPE-INTEGRATION—AUTHORIZE-PAYMENTS

Since I cannot see the actual code that you are using on your site I would suggest you hire a Wix Code Expert from the Arena to help you debug your code.

Else post your code here so that someone from the community can help you.

this is the exact code:
PAGECODE
import wixWindow from “wix-window”;
$w.onReady(function () {
$w(“#BookNow”).onClick((event, $w) => {
var amm = $w(“#amount”).text
var data = {
amount: $w(“#amount”).text,
itemName: $w(“product”).text,
description: $w(“#description”).text
}
wixWindow.openLightbox(“Payment”, data)
});
});

LIGHTBOX CODE
import { createToken, encodeCard } from “public/stripeAPI.js”;
import { charge } from “backend/stripeProxy”;
import wixWindow from “wix-window”;
import wixData from “wix-data”;

var pmtdata;
$w.onReady(function () {
$w(“#SubmitButton”).onClick((event, $w) => {
payNow();
});
pmtdata = wixWindow.lightbox.getContext();
changeState(pmtdata.amount, pmtdata.description);
$w(“#SubmitButton”).label = “Pay " + pmtdata.amount + “$”;
});
var payment;
function payNow() {
var accepted = false;
createToken(encodeCard(createCard())).then((token) => {
charge(token, payment).then((chargeResponse) => {
if (chargeResponse.id !== undefined) {
$w(”#errortext").show();
$w(“#errortext”).text = “Sucessful Payment”;
accepted = true;
var item = {
“amount”: pmtdata.amount,
“productName”: pmtdata.itemName,
“productDesc”: pmtdata.description,
“stripeChargeId”: chargeResponse.id
}
wixData.insert(“Payments”, item)
}
});
});
setTimeout(function () {
if (!accepted) {
$w(“#errortext”).show();
$w(“#errortext”).text = “Payment Declined”;
}
}, 3200);
}

function createCard() {
return {
“name”: $w(“#cardname”).value,
“number”: $w(“#cardnum”).value,
“cvc”: $w(“#cvc”).value,
“exp_year”: $w(“#year”).value,
“exp_month”: $w(“#month”).value
};
}

function changeState(x, y) {
payment = {
“amount”: (x * 100),
“currency”: “USD”,
“description”: y,
“capture”: “false”
}
}

BACKENDCODE:
// stripeProxy.jsw //
import { fetch } from “wix-fetch”;
export async function charge(token, payment) {
const cart = payment;
const apiKey = " Secret Key ";
const response = await fetch(“https://api.stripe.com/v1/charges”, {
method: “post”,
headers: {
“Content-Type”: “application/x-www-form-urlencoded”,
“Authorization”: "Bearer " + apiKey
},
body: encodeBody(token, cart)
});
if (response.status >= 200 && response.status < 300) {
return await response.json();
}
return await response.text();
}
function encodeBody(token, cart) {
let encoded = “”;
for (let [k, v] of Object.entries(cart)) {
encoded = encoded.concat(k, “=”, encodeURI(v), “&”);
}
encoded = encoded.concat(“source=”, encodeURI(token));
return encoded;
}

PUBLIC CODE:
// stripeAPI.js //
import { fetch } from “wix-fetch”;
export async function createToken(card) {
const apiKey = " Publishable Key ";
const response = await fetch(“https://api.stripe.com/v1/tokens”, {
method: “post”,
headers: {
“Content-Type”: “application/x-www-form-urlencoded”,
“Authorization”: "Bearer " + apiKey
},
body: card
});
if (response.status >= 200 && response.status < 300) {
const json = await response.json();
return json.id;
}
const responseText = await response.text();
console.log(responseText);
return response.status;
}
export function encodeCard(card) {
let encoded = “”;
for (let [k, v] of Object.entries(card)) {
encoded = encoded.concat(“card[”, k, “]=”, encodeURI(v), “&”);
}
return encoded.substr(0, encoded.length - 1);
}