Menu
Feedback
Start here
Tutorials
Developer portal

Known Issues
Support Rules
Troubleshooting

Frequently Asked Questions
Announcements
Tutorials
Tutorials
Explore in-depth tutorials for operating your VTEX store.
Tutorials
Payments
Payment Settings
How to set up FingerPrint for PayU
How to set up FingerPrint for PayU

Device Fingerprint is an identifier that acts in payment processing to improve fraud risk analysis.

By collecting non-sensitive data, Device Fingerprint identifies and analyzes the security level of the device used to perform a given transaction. It also analyzes transactions previously performed with that device.

Each store must have only one Device Fingerprint registered. Check if you have already registered the Device Fingerprint in another connector, before proceeding with the steps below.

This article will explain how to associate the Device Fingerprint feature with the PayU affiliation.

The settings documented in this article take place in an environment that is external to VTEX, therefore they may be outdated.

  1. Login on http://www.google.com/tagmanager/ for the stored to be set up;
  2. Enter the tags section to set up the device session id;
  3. Crete an “HTML Personalized” product with the following image:
    {"base64":"  ","img":{"width":971,"height":508,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":57524,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_1.png"}}
  4. In the HTML field of the setup, find the HTML code that calls the code to send information to PayU:

<script src="/arquivos/md5.js"></script>
<script>
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i].trim();
if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
}
return "";
}
function microtime(get_as_float) {
var now = new Date().getTime() / 1000;
var s = parseInt(now, 10);
return (get_as_float) ? now : (Math.round((now - s) * 1000) / 1000) + ' ' + s;
}
vtexjs.checkout.getOrderForm().done(function(orderForm){ // hala el valor de userProfileId
var uid = getCookie('VtexIdclientAutCookie') + orderForm.userProfileId;
var deviceSessionId = CryptoJS.MD5(uid+microtime());
console.log("dsid: "+deviceSessionId);
window.vtex.deviceFingerprint = deviceSessionId;
console.log("fingerprint: "+window.vtex.deviceFingerprint);
document.getElementById('gtm').innerHTML = '<p style={{ background: "url(https" }}></p>'+'<img src="https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_11.png">';
document.getElementById('maf').innerHTML = '<object type="application/x-shockwave-flash" data="https://maf.pagosonline.net/ws/fp/fp.swf?id='+deviceSessionId+'80200" width="1" height="1" id="thm_fp"><param name="movie" value="https://maf.pagosonline.net/ws/fp/fp.swf?id='+deviceSessionId+'80200" /></object>';
var pol_script = document.createElement('script');
pol_script.type = 'text/javascript';
pol_script.src = 'https://maf.pagosonline.net/ws/fp/check.js?id='+deviceSessionId+'80200';
document.getElementById("gtm").appendChild(pol_script);
}); // JavaScript Document
</script>
<div id="gtm"></div>
<div id="maf"></div>

{"base64":"  ","img":{"width":871,"height":436,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":44064,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_2.png"}}

It is then necessary to continue on to advanced set up in accordance with the following image:

{"base64":"  ","img":{"width":912,"height":490,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":22276,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_3.png"}}

To set up the event, follow these steps:

  1. Click on the tab More:
    {"base64":"  ","img":{"width":956,"height":167,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":13473,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_4.png"}}
  2. Create a personalized event:
    {"base64":"  ","img":{"width":1025,"height":366,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":23758,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_5.png"}}
  3. Fill it in as follows:
    {"base64":"  ","img":{"width":1031,"height":538,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":30543,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_6.png"}}
  4. We save the event and subsequently save the tag (tag):
    {"base64":"  ","img":{"width":942,"height":611,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":71638,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_7.png"}}
  5. Once the tag has been saved, it is necessary to publish it:
    {"base64":"  ","img":{"width":1337,"height":456,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":80215,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_8.png"}}

Once the tag has been set up, it is necessary to save the JS captured from the code. This is saved in the VTEX file manager. To do this, follow these steps:

  • Accessing the VTEX panel in the CMS menu >> Layout >> File Manager >> .js File Management >> Add.

{"base64":"  ","img":{"width":1874,"height":509,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":61294,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_9.png"}}

Attachment: md5.js

Validation

To validate it, it is necessary to enter the store and to complete the purchase process. When we arrive at the payment method, we validate the JS execution:

  1. Right click on the purchase button
  2. Select Inspect Element
  3. Search for the word MAF

If the result is found, it means that the setup is correct and that Fingerprint is working properly. For example:

{"base64":"  ","img":{"width":983,"height":401,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":193499,"url":"https://raw.githubusercontent.com/vtexdocs/help-center-content/refs/heads/main/docs/en/tutorials/Payments/Payment%20Settings/how-to-set-up-fingerprint-for-payu_10.png"}}

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page
Still got questions?
Ask the community
Find solutions and share ideas in the VTEX community.
Join our community
Request support from VTEX
For personalized assistance, contact our experts.
Open a support ticket
GithubDeveloper portalCommunityFeedback