providers: mercadopago: Add support for Brazilian currency (BRL)#10
providers: mercadopago: Add support for Brazilian currency (BRL)#10GalaticStryder wants to merge 1 commit intozkp2p:mainfrom
Conversation
|
DO NOT MERGE - may need more updates / features Pix specific |
5a3cf2b to
4fdbedd
Compare
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "actionType": "transfer_mercado_pago", | |||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Ok, let's use the mercadopagobr folder structure
26260f8 to
2ca2e87
Compare
Initial provider support for the Brazilian version of mercadopago using Pix. Signed-off-by: Ícaro Hoff <icarohoff@gmail.com>
2ca2e87 to
ea48618
Compare
GalaticStryder
left a comment
There was a problem hiding this comment.
See comments, but I think this should be good to go.
| "method": "GET", | ||
| "body": "", | ||
| "metadata": { | ||
| "platform": "mercadopagobr", |
There was a problem hiding this comment.
@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});})();" |
There was a problem hiding this comment.
This javascript injection is solely a copy of the argentinian version, not sure if this is correct for BR though.
There was a problem hiding this comment.
yeah i would remove the mobile section entirely for now. we can revisit it when we launch our mobile app 👀
Initial provider distinction between the two countries home page (for now).