Wix - Stripe API integration

Hello, I need some help if anyone has java-script knowledge.
I found this tutorial online
https://www.dudelemon.com/wix-code-stripe-recurring-tutorial
With this code you create a new customer, create card token and subscribe to a plan.
But I have tried many times, it’s not working 100%

The customer is created and then the card token is created aswell and when it tries to subscribe to the plan I get an error saying that this customer doesn’t have saved payment card. I can see that the card token is created, so I guess it’s just not saving it to the customer.

Since stripe API is written for the stripe js https://js.stripe.com/v3 and I can’t use it (call it) in wix-code, I tried to copy the stripe js and paste it to a new backend file, but it gives many errors.

I wanna do the following actions:

  1. Save card to a customer
  2. Retrieve (last 4 digits and exp date) and Update card with new info
  3. Activate subscription with Start date to choose when it will start
  4. Delete subscription
    does anyone can help me please?
    Thank you

See this example:

Stripe Payment Processing

Integrate the Stripe Payment processing system into a site. Three levels of user access are demonstrated: visitor, freemium (registered), and premium (paid).