Hello!
I want to use events (events.js) with Wix Billing but I can not get the data. It returns undefined data.
Here is my code: (in event.js)
export function wixBilling_onPriceQuoteSent(event) {
let data = {
"invoiceId": event.id.id,
"customerDetails": event.customer
}
console.log("CUSTOMER ID", event.customer.contactId)
return data;
}
When I try to console.log any data from the event it does not gives me anything.
(I’m checking console log from Site Events in settings)
Here what I see in Site Events:
"root":{
"insertId":"..........4Whurx..W8zfvvqQhtfZxQ"
"timestamp":"2021-06-08T20:19:53.133Z"
"labels":{"siteUrl":"https://www.exweiv.store/"
"revision":"5182"
"namespace":"Velo"
"tenantId":"ce84c366-36f1-4af9-8112-a86214475510"
"viewMode":"Site"
}
"sourceLocation":{"file":"backend/events.js"
"line":6
"column":47
}
"operation":{"id":"1623183592.2421748000609110256"
"producer":"backend"
}
"jsonPayload":{"message":"["Cannot read property 'contactId' of undefined"]"
}
"severity":"ERROR"
"receiveTimestamp":"2021-06-08T20:19:53.140Z"
}
Error is the orange message.
And this is the API that I’m trying to use : onPriceQuoteSent - Velo API Reference - Wix.com
Can anyone help me to solve this because I didn’t understand what’s going on?