Hi, how can I change this code to take the amount of the single item from the database table?
I wish that when the “prenota subito” button is clicked, a payment page is generated for the single item.
this is the product link from the database:
https://isacco22.wixsite.com/sharmlowcost/priceQuote/viaggio-1
this is the code I entered on the page, but it doesn’t work
import wixPay from 'wix-pay';
import {createPaymentForProduct} from 'backend/BE_Collection';
export async function button6_click(event, itemData) {
let itemId = itemData._id;
let payment = await createPaymentForProduct(itemId);
await wixPay.startPayment((payment.id), {"termsAndConditionsLink": "https://www.wix.com/"});
}
I followed this guide:
please help me