MyGate

Widget Mode

Steps

  • Identify the screen where address input/verification is needed
    • This is where the control is handed of to mygate address SDK (as shown below)
  • Add couple of lines JS code (sample shown below)
    • This will be used to load and trigger the SDK

Widget View

Sample Code

<script type="text/javascript"
data-reference-id = "partner_req_data"
data-redirect-url = "http://partner.example.com/verifiedAddress"
data-access-key= "mavb-partner-1a1"
(function() {
var params = document.querySelector('script[data-reference-id][data-redirect-url][data-access-key]');
var id = params.getAttribute('data-reference-id');
var url= params.getAttribute('data-redirect-url');
var access_key = params.getAttribute('data-access-key');
function mavb_cb() {
var mavb_url = "http://mavb.mygate.com/home?reference_id="
+ encodeURIComponent(id) + "&redirect_url=" + encodeURIComponent(url)
+ "&access_key=" + encodeURIComponent(access_key);
window.location.href = mavb_url;
}
var button = document.createElement('button');
button.id = 'mavb-button';
button.onclick = mavb_cb;
button.innerHTML = 'Auto Fill My Address';
document.body.append(button);
})();
</script>
Suggestions, contact, support and error reporting: [email protected]