This works: *********************************************************
import wixPay from ‘wix-pay-backend’;
export function createPaymentForProduct() {
return wixPay.createPayment({
amount: 60.00,
items: [{ name: ‘Test Purchase’, price: 60.00 }],
} );
}
I’d like this to work but need some syntax help: ********************
import wixPay from ‘wix-pay-backend’;
export function createPaymentForProduct() {
if new Date() >1/1/2022 then VarAmt = 200.00;
if new Date() >2/1/2022 then VarAmt = 150.00;
if new Date() >3/1/2022 then VarAmt = 100.00;
if new Date() >4/1/2022 then VarAmt = 50.00;
return wixPay.createPayment({
amount: VarAmt,
items: [{ name: 'Test Purchase', price: VarAmt}],
} );
}
Any thoughts?