Additional Methods
Get Available APMs
Query which APMs are available for the current merchant and session:
const availableApms = await revup.getApmsAvailable();
// Returns: ['apple_pay', 'google_pay', 'paypal', 'stripe_link']
This method can be called before or after init().
Cleanup and Re-initialization
When re-rendering (e.g., new order, page navigation):
- Remove the event listener:
cleanup(); // Function returned from onRevupMessage
- Clear the container:
const container = document.getElementById('revup-container');
if (container) container.innerHTML = '';
- Create a new instance and initialize:
const revup = new Revup(newConfig);
await revup.init({ containerId: 'revup-container', ... });
Important
Do not reuse the same Revup instance for different orders. Create a fresh instance per checkout session.