March 28, 2024
cancel
Showing results for 
Search instead for 
Did you mean: 
Help

add onload callback to marqeta.js config

Barieli
New Contributor

Hello, I am using marqeta.js  how can I add onload callback to embedded pan iframe

1 REPLY 1

Eric_Chi
Marqetan
Hi! When the client application first calls the Bootstrap method to display the PAN. It passes in a configuration object. In that configuration object the application can pass in a field called callbackEvents . This field can take two keys, one is onSuccess (successful load of iframe) and the other onFailure. Here is a link to our public docs.
An Example here:
"callbackEvents": {
    "onSuccess": () => {
      console.log("Success!");
    },
    "onFailure": error => {
      console.error(error);
    }
  }

 Hope that helps!