> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: onPaymentUpdate(event: PaymentUpdateEvent) # Method package: wixPayBackend # Method menu location: wixPayBackend --> Events --> onPaymentUpdate # Method Link: https://dev.wix.com/docs/velo/apis/wix-pay-backend/events/on-payment-update.md # Method Description: An event that fires when a payment's transaction status is changed. The `onPaymentUpdate()` event handler runs when a payment's transaction status has changed. The received `PaymentUpdateEvent` object contains information about the payment transaction. > **Note:** Backend events don't work when previewing your site. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## An event fired when a payment transaction status is changed ```javascript // 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; } /* Full event object: * { * "payment": { * "id": "8b3c1a90-c09e-4cd7-ae9d-9801151d8ad9", * "amount": 15.99, * "currency": "USD", * "items": [ * { * "name": "Baseball Bat", * "quantity": 1, * "price": 15.99 * } * ] * }, * "userInfo": { * "firstName": "Mike", * "lastName": "Trout", * "countryCode": "USA", * "phone": null, * "email": "mike.trout@email.com" * }, * "status": "Successful", * "transactionId": "83f1830a-c74e-4abe-894d-3ee388b7e985" * } */ ``` ---