How to connect Stripe API through Velo?

Question:
How can I connect the Stripe API through Velo to verify documents?

Product:
Wix Studio Editor

What are you trying to achieve:
I am trying to create a button that will allow Stripe to open a window and return whether the documents have been verified or not. All the information is listed in their documentation that I have listed

What have you already tried:
Verify your users’ identity documents | Stripe Documentation

Calling Backend Code from the Frontend (wix.com)

Additional information:
I am using backend web modules.

Any help would be massively appreciated!

I’d appreciate any support as this is vital to the site I’m working on. I’ve been unable to translate the Stripe code from basic HTML + JS to Velo, as well as their React version. I also made sure to install the Stripe API through Wix’s npm solution

  1. Tutorial: Processing Payments
  2. Wix Code - Stripe - #102 by amaurysautour
  3. Verify your users’ identity documents | Stripe Documentation
  4. stripe - npm
  5. Search results for 'stripe integration' - Wix Studio Community forum

EXAMPLE for HTML-Component…

<!DOCTYPE html>
<html>
<head>
  <title>Verify Identity</title>
  <script src="https://js.stripe.com/v3/"></script>
</head>
<body>
  <button id="verify-button">Verify Identity</button>
  <div id="result"></div>

  <script>
    // Stripe.js loaded asynchronously
    var stripe;
    var verifyButton = document.getElementById('verify-button');
    var resultDiv = document.getElementById('result');

    document.addEventListener("DOMContentLoaded", function() {
      stripe = Stripe('pk_test_your_publishable_key');
    });

    verifyButton.addEventListener('click', function() {
      // Example: Creating a verification session
      fetch('https://api.stripe.com/v1/identity/verification_sessions', {
        method: 'POST',
        headers: {
          'Authorization': 'Bearer sk_test_your_secret_key',
          'Content-Type': 'application/x-www-form-urlencoded',
        },
        body: 'type=document&options[document_types][]=passport&options[document_types][]=id_card',
      })
      .then(function(response) {
        return response.json();
      })
      .then(function(session) {
        resultDiv.innerHTML = 'Verification session created: ' + session.id;
      })
      .catch(function(error) {
        console.error('Error:', error);
        resultDiv.innerHTML = 'Error: ' + error.message;
      });
    });
  </script>
</body>
</html>

You can find so much informations about STRIPE and how to integrate it onto your Wix-Website.