Skip to main content

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):

  1. Remove the event listener:
cleanup(); // Function returned from onRevupMessage
  1. Clear the container:
const container = document.getElementById('revup-container');
if (container) container.innerHTML = '';
  1. 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.