WIX Pay API error

Hello. I am trying to create a customized payment page using the Wix Pay API. When I execute the code listed in the documentation (createPayment - Velo API Reference - Wix.com), the request to the server returns 200, but the X-Wix-Code-User-Error-Details header displays {“isUserError”:false,“code”:“UNKNOWN”}, and the payment page does not launch successfully. Could someone help me find the cause or a clue to solve this issue? I have set the button name and .jsw file name here on my end.

/************************** * Backend code - pay.jsw * **************************/

import wixPayBackend from 'wix-pay-backend';

export function createMyPayment() {
    return wixPayBackend.createPayment({ 
        items: [{ name: "Product Name", price: 9.99 }], 
        amount: 9.99 
    });
}

/********************

  • Client-side code * ********************/
import { createMyPayment } from 'backend/pay'; import wixPay from 'wix-pay';

export function myButton_click(event, $w) { 
    createMyPayment() .then((payment) => { 
        wixPay.startPayment(payment.id); 
    });
}

This seems fine as it’s reporting there’s no user error in this header.

Do you get an error message on your browser console?