Hi,
Trying to disable the user information on wix Pay API
its not working for me
can someone help please?
my code:
//Client Code//
import wixPay from ‘wix-pay’;
import {createMyPayment} from ‘backend/pay’;
export function repeater1_itemReady($item, itemData, index) {
let itemId = itemData._id;
$item(‘#button71’).onClick( async () => {
let payment = await createMyPayment(itemId,{skipUserInfoPage: true });
await wixPay.startPayment(payment.id)
.then( (result) => {
if (result.status === “Successful”) {
// handle payment success
} else if (result.status === “Failed”) {
// handle payment failure
} else if (result.status === “Pending”) {
// handle payment pending
} else if (result.status === “Cancelled”) {
// handle user closing payment panel
}
} );
});
}
//Backend Code//
import wixData from ‘wix-data’;
import wixPay from ‘wix-pay-backend’;
export async function createMyPayment(productId) {
return wixData.get(“paymentdb”, productId)
.then( (product) => {
return wixPay.createPayment( {
items: [{
name: product.name,
price: product.price
}],
amount: product.price,
} );
} );
}