Not been able to get custom payments using wix pay api

This is what I have in the back end

import wixPay from “wix-pay-backend”;

export function cratepaymentforproduct (q, n) {
return wixPay.createPayment({
items: [{name: n, price: 30, quatity: q}],
amount: 30*q
});

};

This is the code on the page for the payment button

export function button1_click(event)
{
cratepaymentforproduct($w(“#input3”).value,$w(“#text37”).text).then(payment=> [{]({
wixPay.startPayment(payment.id);
});
})
[wixPay.startPayment(payment.id);]({
wixPay.startPayment(payment.id);
});
})
[});]({
wixPay.startPayment(payment.id);
});
})
[}]({
wixPay.startPayment(payment.id);
});
})

This is the error that is occurring

  1. WixPayBackend.createPayment: Total amount should be the sum of the item amounts

  2. WixPayBackend.createPayment: can’t create payment, details: Total amount should be the sum of the item amounts

Is there any way around this? or should we consider some other platform?

Check the Wix Pay Backend API and the createPayment function and change your code to suit it as you need to put in the total sum as mentioned in your error.
https://www.wix.com/corvid/reference/wix-pay-backend.html#createPayment

Also make sure spelling is correct too.

quatity is missing an n for quantity

cratepaymentforproduct is missing the e for createPayment…

Thanks the ‘n’ was missing lol