Firstly, include a reference to payframe.js on your page.Instantiate the payframe and set mwCallback (which is the callback function that runs after the payframe has completed its action), before deploying the payframe. After the customer has entered their card details, call the submitPayframe function. The submitPayframe function will perform the action set by the method parameter, getPayframeToken by default. After the payframe has successfully completed the chosen action (addCard or getPayframeToken), it will call mwCallback. The results of the action will be returned as parameters to the mwCallback function.getPayframeToken will return the token status, the payframeToken, and the payframeKey, in that order; addCard will return the cardID. The returned values will also be set as properties of the payframe. The payframeToken and payframeKey can be submitted with a processCard or processAuth request. A cardID can be submitted with a processCard or processAuth request. If the payframe's validation fails or there was an error processing the payframe's action, the response code and message for the error will be set as properties of the payframe. Modified at 2026-07-17 02:43:46