Skip to content

providers: mercadopago: Add support for Brazilian currency (BRL)#10

Open
GalaticStryder wants to merge 1 commit intozkp2p:mainfrom
GalaticStryder:hoff-mercado-pago-brl
Open

providers: mercadopago: Add support for Brazilian currency (BRL)#10
GalaticStryder wants to merge 1 commit intozkp2p:mainfrom
GalaticStryder:hoff-mercado-pago-brl

Conversation

@GalaticStryder
Copy link
Copy Markdown

Initial provider distinction between the two countries home page (for now).

@GalaticStryder
Copy link
Copy Markdown
Author

DO NOT MERGE - may need more updates / features Pix specific

@GalaticStryder GalaticStryder force-pushed the hoff-mercado-pago-brl branch 3 times, most recently from 5a3cf2b to 4fdbedd Compare May 10, 2025 17:20
@@ -1,5 +1,5 @@
{
"actionType": "transfer_mercado_pago",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's keep naming for AR the same. this breaks how the zkp2p UI interacts with peerauth

also, mercado pago br is a separate website entirely from ar, we should move the provider into a separate folder mercadopagobr

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's use the mercadopagobr folder structure

@0xSachinK 0xSachinK marked this pull request as draft September 15, 2025 06:39
@GalaticStryder GalaticStryder force-pushed the hoff-mercado-pago-brl branch 2 times, most recently from 26260f8 to 2ca2e87 Compare September 18, 2025 01:58
Initial provider support for the Brazilian version of mercadopago using
Pix.

Signed-off-by: Ícaro Hoff <icarohoff@gmail.com>
Copy link
Copy Markdown
Author

@GalaticStryder GalaticStryder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments, but I think this should be good to go.

"method": "GET",
"body": "",
"metadata": {
"platform": "mercadopagobr",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richardliang I've also updated the platform key here to match the folder name convention.

"internal": {
"actionLink": "https://www.mercadopago.com.br/money-out/transfer/",
"actionCompletedUrlRegex": "https://www.mercadopago.com.br/money-out/transfer/congrats\\?data=\\S+",
"injectedJavaScript": "(function(){const style=document.createElement('style');style.textContent='.zkp2p-icon{position:absolute;right:10px;top:50%;transform:translateY(-50%);width:24px;height:24px;background:#007AFF;border-radius:4px;cursor:pointer;z-index:9999;display:flex;align-items:center;justify-content:center;color:white;font-weight:bold;font-size:12px;}.zkp2p-dropdown{position:absolute;background:#FFF;border:1px solid #E0E0E0;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.15);z-index:99999;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,sans-serif;font-size:14px;color:#333;width:auto;min-width:250px;}.zkp2p-dropdown-item{padding:12px 16px;cursor:pointer;}.zkp2p-dropdown-item:hover{background:#F5F5F5;}.zkp2p-dropdown-item:active{background:#E8E8E8;}.zkp2p-dropdown-label{color:#666;font-size:12px;margin-bottom:4px;}.zkp2p-dropdown-value{font-weight:500;color:#333;font-size:16px;}.zkp2p-toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:#333;color:white;padding:10px 20px;border-radius:6px;z-index:999999;font-family:system-ui;}';document.head.appendChild(style);const copyToClipboard=function(text){const textArea=document.createElement('textarea');textArea.value=text;textArea.style.position='fixed';textArea.style.top='-9999px';document.body.appendChild(textArea);textArea.select();textArea.setSelectionRange(0,99999);document.execCommand('copy');document.body.removeChild(textArea);const toast=document.createElement('div');toast.className='zkp2p-toast';toast.textContent='Copied!';document.body.appendChild(toast);setTimeout(()=>toast.remove(),2000);};const createDropdown=function(input,label,value){const rect=input.getBoundingClientRect();const dropdown=document.createElement('div');dropdown.className='zkp2p-dropdown';dropdown.id='zkp2p-dropdown-'+Date.now();dropdown.style.position='absolute';dropdown.style.top=(rect.bottom+window.scrollY+4)+'px';dropdown.style.left=rect.left+'px';dropdown.style.display='block';const item=document.createElement('div');item.className='zkp2p-dropdown-item';item.innerHTML='<div class=\"zkp2p-dropdown-label\">'+label+'</div><div class=\"zkp2p-dropdown-value\">'+value+'</div>';item.addEventListener('click',function(){copyToClipboard(value);dropdown.remove();});dropdown.appendChild(item);document.body.appendChild(dropdown);setTimeout(()=>{document.addEventListener('click',function hideDropdown(e){if(!dropdown.contains(e.target)&&e.target!==input&&!e.target.classList.contains('zkp2p-icon')){dropdown.remove();document.removeEventListener('click',hideDropdown);}});},100);};const addIcon=function(input,label,value){const container=input.closest('.andes-amount-field__input-container')||input.parentElement;container.style.position='relative';const icon=document.createElement('div');icon.className='zkp2p-icon';icon.textContent='Z';icon.addEventListener('click',function(e){e.stopPropagation();const existing=document.querySelector('.zkp2p-dropdown');if(existing)existing.remove();createDropdown(input,label,value);});container.appendChild(icon);createDropdown(input,label,value);};const setupFields=function(){const cvuInput=document.querySelector('input[name=\"identification_account\"]');if(cvuInput&&!cvuInput.hasAttribute('data-zkp2p')){cvuInput.setAttribute('data-zkp2p','true');addIcon(cvuInput,'CVU for ZKP2P:','{{RECIPIENT_ID}}');}const amountInput=document.querySelector('#amount-field-input');if(amountInput&&!amountInput.hasAttribute('data-zkp2p')){amountInput.setAttribute('data-zkp2p','true');addIcon(amountInput,'Amount for ZKP2P:','{{AMOUNT}}');}};setTimeout(setupFields,1500);const observer=new MutationObserver(setupFields);observer.observe(document.body,{childList:true,subtree:true});})();"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This javascript injection is solely a copy of the argentinian version, not sure if this is correct for BR though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i would remove the mobile section entirely for now. we can revisit it when we launch our mobile app 👀

@GalaticStryder GalaticStryder marked this pull request as ready for review September 18, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants