Error Checkout Transparent Pagseguro - Magento

0

Good morning!

I installed PagSeguro's Transparent Checkout module in my Magento store, version 1.8.0.0, available at link .

I can not finish the purchase! Transparent checkout has already been authorized by PagSeguro, but when I get to the step-by-step of the request, an error is generated. The order goes to the backend, but the customer payment options do not appear.

The error is as follows:

AccordingtowhatIreadonGoogle,itseemstobeavalidationerrorfortheCPF.UnfortunatelyIfoundverylittledocumentationaboutitandIhavelittleexperienceinjavascript.

Thefileinquestion,checkout.js,hasthefollowingcode:

varIdeasaValidator=Class.create({initialize:function(a){this.paymentMethod="payment_form_"+a.paymentMethod},cpf:function(a){a.value=this._mcpf(a.value)},numeric:function(a){a.value=this._mnum(a.value)},upper:function(a){a.value=this._upper(a.value)},_mcpf:function(a){a=a.replace(/\D/g,"");a=a.replace(/(\d{3})(\d)/,"$1.$2");a=a.replace(/(\d{3})(\d)/,"$1.$2");a=a.replace(/(\d{3})(\d{1,2})$/,"$1-$2");return a},_mnum:function(a){a=a.replace(/\D/g,"");return a},_upper:function(a){a=a.replace(/\d/g,"");a=a.replace(/['~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\/]/gi,"");return a.replace(/[a-z]/g,function b(c){return c.toUpperCase()})}});String.prototype.isCPF=function(){var e=this;if(e==""){return true}if((e=e.replace(/[^\d]/g,"").split("")).length!=11){return false}if(new RegExp("^"+e[0]+"{11}$").test(e.join(""))){return false}for(var b=10,d=0,a=0;b>=2;d+=e[a++]*b--){}if(e[9]!=(((d%=11)<2)?0:11-d)){return false}for(var b=11,d=0,a=0;b>=2;d+=e[a++]*b--){}if(e[10]!=(((d%=11)<2)?0:11-d)){return false}return true};String.prototype.isCNPJ=function(){var f=this;if(f==""){return true}var a=[6,5,4,3,2,9,8,7,6,5,4,3,2];if((f=f.replace(/[^\d]/g,"").split("")).length!=14){return false}for(var d=0,e=0;d<12;e+=f[d]*a[++d]){}if(f[12]!=(((e%=11)<2)?0:11-e)){return false}for(var d=0,e=0;d<=12;e+=f[d]*a[d++]){}if(f[13]!=(((e%=11)<2)?0:11-e)){return false}return true};Validation.add("cpf",Translator.translate('CPF Inválido.'),function(a){return a.isCPF()});Validation.add("ideasa-validate-alpha","Somente letras",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z ]+$/.test(a)});Validation.add("validate-one-payment-brand",Translator.translate('Por favor, selecione uma opção de pagamento: Cartão de Crédito, Débito ou Boleto.'),function(b,d){var a=$(d).readAttribute("data-method");var c=$$("#payment_form_"+a+" span.select").length;return(c>0)});var IdeasaToggleToolTip=Class.create({initialize:function(a){this.tip=$("ideasa-payment-"+a+"-tool-tip")},insert:function(a){if(this.tip){this.tip.setStyle({left:(Event.pointerX(a)-100)+"px",top:(Event.pointerY(a)-300)+"px"});this.tip.toggle()}Event.stop(a)}});$$('[name="payment[method]"]').invoke("observe","click",function(){$$(".ideasa input[type=radio]").each(function(a){a.setAttribute("name","")});$$(".ideasa .ideasa-parcelas select").each(function(a){a.setAttribute("name","")});$$(".select").each(function(a){a.removeClassName("select")});$$(".divPagForm").invoke("hide");if(element.checked){$$("input[name=payment[selected]]").each(function(a){$(a).removeClassName("validate-one-payment-brand");if($(a).readAttribute("data-method")==element.id){$(a).addClassName("validate-one-payment-brand")}})}if(isUrlTelevendas){ideasa.review()}});ideasa.review=function(){var a=Form.serialize("co-payment-form");ideasa.updateReview(a)};ideasa.updateReview=function(a){$("loadingmask").show();$("form-items").innerHTML="";new Ajax.Request(urlTelev,{method:"post",parameters:a,onComplete:function(b){$("loadingmask").hide();$("form-items").innerHTML=b.responseText}})};

The error starts from: Validation.add("cpf",Translator.translate("CPF Inválido.") .

I'm not sure what to do. I would like to count on your help!

    
asked by anonymous 04.02.2016 / 07:46

0 answers