destroy
Disconnects the Messenger and removes its iframe and listeners. Call it when the page no longer needs wallet payments.
Function
messenger.destroy()
Parameters
This function takes no parameters.
Returns
This function does not return a value.
Usage
const messenger = new paytheory.PayTheoryMessenger({
apiKey: 'your-api-key'
});
// Use the Messenger
await messenger.initialize();
// ...process wallet transactions
// Clean up when done
messenger.destroy();
Notes
destroyremoves every listener added withon, closes the channel and removes the iframe from the page.- A destroyed Messenger can't be used again. Create a new
PayTheoryMessengerinstead.