CORVID doc Discrepancy : How to call events

I’m referring specifically below event from wix-pay-backend

https://www.wix.com/corvid/reference/wix-pay-backend.Events.html#onPaymentUpdate : This link says we need to add “wixPay_onPaymentUpdate” inside “events.js” file, which is a regular javascript file.

whereas
https://support.wix.com/en/article/corvid-tutorial-processing-payments : Says we need to add same code inside “events.jsw” , which is a web module.

event.js works fine for me(but not events.jsw), but I’m not able to call any other web module from there and not sure how secure it is mentioning the code inside javascript file, as it will get exposed to the client (please correct if otherwise).

Yes it is a typo error as it should be in the events.js backend file and not in a events.jsw backend file.

It is correctly stated in the API Reference.
Examples

An event fired when a payment transaction status is changed

// Place this code in the events.js file
// of your site's Backend section.

export function wixPay_onPaymentUpdate(event) {
  let paymentId = event.payment.id;
  let newTransactionStatus = event.status;
}

This had already been noticed and was supposed to have been changed awhile back now, so thank you for pointing it out that it has yet to be corrected.

@brett-haralson

Thanks for .

I’m failing to call my other functions(web module) from events.js file, any clue why?

Also, could you out some light on how secured is it? Comparing to .jsw(web modules)

Events are in the backend and are secure - as long as you use them correctly.

See the Security Considerations article for details on proper security practices.

Thanks for confirming.