I am building a simple piece of code on the backend in order to distribute coupons post checkout depending on the cart value. My function for mailing and generating codes is working well. However I don’t understand why my onOrderPaid() and onNewOrder are just unresponsive.
import { myBackendFunction } from ‘backend/couponmail.js’ ;
export async function wixStores_onOrderPaid ( event ){
let firstname = event . buyerInfo . firstName ;
let lastname = event . buyerInfo . lastName ;
let email = event . buyerInfo . email ;
let amount = event . totals . total ;
if ( amount >= 4000 ){
myBackendFunction ( firstname , lastname , email );
}
}
This is my events.js file in the backend. myBackendFunction() works perfectly well and does the work but I need help with onOrderPaid() urgently.