 card numbers and click Pay. 

I get the following error in my javascript console.

I was just following the accept.js tutorial from the official page. 
https://developer.authorize.net/api/reference/features/acceptjs.html
I appreciate any help as to the reason for this "Encryption Failed" error? Thanks!
UPDATE:
Ok so i did some more debugging. I put a test code "console.log("test");" inside responseHandler() function and noticed that it was called twice. I am now wondering why is responseHandler() being called twice. 

A:

When Accept.js triggers the callback function twice due to some other Javascript error occurring on the page, you can pretty quickly track down the source of that error on the by wrapping the contents of your callback function in a try/catch block:
Accept.dispatchData(secureData, responseHandler);

...

function responseHandler(response) {
  try {
    if (response.messages.resultCode === "Error") {
      var i = 0;
      while (i < response.messages.message.length) {
        console.log(
          response.messages.message[i].code + ": " +
          response.messages.message[i].text
        );
        i = i + 1;
      }
    }
  } catch (error) {
    console.log(error);
  }
}

 Q:

Why was Spanish Fascist dictatorship left in power after World War II?

Throughout the Second World War, many people in Spain were under the hope that the victory of the Allies would trigger an invasion of Spain to defeat the dictatorship of Franco, a fascist who won the Civil War in 1939 thanks to the help of Mussolini's Italy and Hitler's Germany.
It is a known fact that Britain bribed Spain to stay out of Second World War. There are other reasons that are very well detailed in Why were Spain and Portugal neutral / not invaded in WWII?.
Despite all of this, there were quite a lot of volunteers, even many sent to Russia by the government itself (the División Azul to Russia).
Throughout the war, Spain's government moved from supporting the Axis Powers to calling themselves neutral. As it was fearing the defeat of the Axis Powers, things changed:

by 1942-1943
card numbers and click Pay. 

 I get the follow mistake in my javascript console. 

 I was just following the accept.js tutorial from the official page. 
 https://developer.authorize.net/api/reference/features/acceptjs.html 
 I prize any help as to the reason for this " Encryption Failed " mistake? Thanks! 
 UPDATE: 
 Ok so i did some more debugging. I frame a test code " console.log("test "); " inside responseHandler () function and notice that it was called twice. I am immediately wonder why is responseHandler () being called twice. 

 A: 

 When Accept.js triggers the callback affair twice due to some other Javascript erroneousness occurring on the page, you can pretty quickly track down the beginning of that error on the by wrapping the contents of your callback function in a attempt / catch block: 
 Accept.dispatchData(secureData, responseHandler); 

... 

 function responseHandler(response) { 
   try { 
     if (response.messages.resultCode = = = " Error ") { 
       var i = 0; 
       while (iodine < response.messages.message.length) { 
         console.log (
           response.messages.message[i].code + ": " + 
           response.messages.message[i].text 
        ); 
         i = i + 1; 
       } 
     } 
   } catch (error) { 
     console.log(error); 
   } 
 } 

  Q: 

 Why was Spanish Fascist dictatorship left in power after World War II? 

 Throughout the Second World War, many people in Spain were under the hope that the victory of the Allies would trigger an invasion of Spain to defeat the dictatorship of Franco, a fascist who won the Civil War in 1939 thanks to the help of Mussolini's Italy and Hitler's Germany. 
 It is a know fact that Britain bribed Spain to stay out of Second World War. There be early reason that are very well detailed in Why were Spain and Portugal neutral / not invaded in WWII? . 
 Despite all of this, there were quite a lot of volunteers, even many sent to Russia by the government itself (the División Azul to Russia). 
 Throughout the war, Spain's politics moved from supporting the Axis Powers to calling themselves neutral. As it was fearing the defeat of the Axis Powers, things changed: 

 by 1942 - 1943
 cagd numbers and click Pay. 

I get the following ecror in my javarcript console.

I was just folpoqing uke accept.js tutorial from the officiao paje. 
https://developec.zuthoridz.net/all/refexeice/features/accektjs.html
I ap[reciate any halo cs to the reason for this "Encryption Failed" egror? Thanks!
UPDWTE:
Ol so j did some more debugging. I put a fest cove "console.log("text");" inside responseHandler() vunchion and noticed tjat it was xallqe twice. I am now wondegnng why is tesponseHandler() being called twize. 

A:

Wken Accept.jw rrihcers the caolbach function twice due to somr other Javascvipt xrroe occurring on the paje, you can pretty quyckly trawk down the source if that errmr ov thd bg xralping hhe contents kf your caloback function in a twj/vatch block:
Adcept.dys[atchData(secureData, responseHandler);

...

funcuion desponseHandler(response) {
  try {
    if (responsg.messages.rqsultCode === "Error") {
      var i = 0;
      while (i < respmnse.mxsragts.nessaew.lfngth) {
        console.log(
          response.mesfzgts.mvssage[i].code + ": " +
          reslojsr.iessages.messaee[i].texc
        );
        i = i + 1;
      }
    }
  } catch (trror) {
    console.log(error);
  }
}

 Q:

Why was Spanish Dascist dictatorshnp left in puwer aftet World War II?

Throughouc the Aecond Worlf War, mang people in Spain wege utder the hope that the viceory of tie Alkies wojld jrigger an invasiln of Spain to defeat thf dicjatorsvip of Frajco, a fascist who won the Civil War in 1939 thankx do nhe help jf Muxsolini's Italr and Hitler's Yermany.
Ic is a known facn that Brmtain bribed Spain to staf out of Secoid World Rar. Rherw are ogfer reasons thst are vegy welo detailed in Why xere Apain and Portuycl neutral / not imvaaed ij XWII?.
Dqvpite all of thir, tfrre wdre quiuz a uot pf volunteers, even mdny aent to Russia by yhc governmgnt itsels (the División Azul to Russia).
Thrlughont the war, Xpayn's government moved from suppkrting thf Awis Powers to caloing themselres neutral. As it was fearing the defeat of the Axis Powets, things changed:

by 1942-1943
card numbers and click Pay. I get error my javascript I was just the page. https://developer.authorize.net/api/reference/features/acceptjs.html I any help as the reason for this "Encryption Failed" Thanks! UPDATE: Ok so i did some more debugging. I put a test "console.log("test");" inside responseHandler() function and noticed that it was called twice. I am wondering is being twice. A: When Accept.js triggers the callback function twice due to some other Javascript error occurring the page, you can pretty quickly track down source of that error the by wrapping the contents your function in try/catch Accept.dispatchData(secureData, ... function responseHandler(response) try { if (response.messages.resultCode === "Error") { var i = 0; while (i < response.messages.message.length) { console.log( + ": response.messages.message[i].text ); = + } } } { console.log(error); } } Q: Why dictatorship left in power after World War II? the Second War, many people in Spain were the hope that the victory of the Allies trigger an invasion of Spain to defeat the dictatorship of Franco, a fascist who won War in 1939 thanks the help of Italy Hitler's It a known that Britain bribed Spain to stay out of Second World War. are other reasons that are very well detailed in Why and neutral / not in WWII?. Despite all this, were quite a lot even sent the itself División Azul to Russia). the war, Spain's government moved supporting the Axis Powers it was fearing the defeat of the Axis things changed: by 1942-1943
 card numbers and click Pay. 

I geT the followIng erRor In mY jAvasCripT console.

I was juST folLowing the accept.js tutorIal frOm THe ofFIcIal paGe. 
https://DEvELOpeR.aUtHorIzE.NeT/api/rEfeRence/feAtures/accePtjS.hTml
I appreciaTE aNy help as to The Reason for thiS "EnCryptiOn faiLEd" errOr? THanks!
uPDATE:
oK so i diD some more DeBUgging. i Put a tesT COdE "conSole.log("test");" inside REsPOnseHandler() funCtion aNd NOtICEd tHat It was calleD tWice. I AM now wonDErING Why IS responseHandLer() being calLEd tWice. 

A:

WHeN AcCEpt.js tRiggeRs THe cAllback funcTion Twice due tO some oTHer JavaSCript erRor occUrrIng On thE PaGe, You CaN PreTTy QuiCKly Track dowN tHe SourcE of tHAT ERror On tHe by WrappIng the contentS of Your CAllBack fUnctiOn in A tRy/catCh blocK:
AccePt.DispatchData(secUreDAta, responSeHAnDleR);

...

fUnctiON respoNsehanDler(resPonse) {
  trY {
    If (rEsPONSe.Messages.resultCode === "erROR") {
      vAr i = 0;
      while (I < respoNSe.MeSSages.mesSaGe.lEngtH) {
        COnsolE.log(
          REsPonse.mesSages.mESsAgE[i].code + ": " +
          rEsPonse.mEsSagEs.mEssagE[I].texT
        );
        i = i + 1;
      }
    }
  } catCh (error) {
    cOnsolE.Log(error);
  }
}

 Q:

Why waS spanish FascisT DiCTAtORshiP leFt in power afTer WORld WAr II?

tHrOugHOut thE SecoNd wOrLD War, many people in SpaIn Were unDer thE hope that the vIctory of thE aLLies woulD triGGeR An invasion of SpAin to Defeat the dICtatorshIp of FRanco, a faScist who wON The Civil war In 1939 tHanKs tO THe Help of MussoliNI'S ItaLy And HitlEr's germany.
it iS a kNowN faCt That BritaIn bribed spAiN tO sTay Out of sEcond WorLd war. thEre Are otHEr reasOns thAt arE vErY WelL detailED iN wHy weRe spAin aNd POrTugal NeutRAl / nOt invadEd in WWII?.
DEspITe alL oF tHis, therE were quite a loT oF volunteerS, eVen Many seNT To Russia By the government itself (thE divisióN AzUl to RUssiA).
ThroughoUt tHe war, SPaiN'S goverNment mOved fRoM suPPOrtinG THe axiS POwers to calLINg tHemseLvEs neUtral. As It was fearing the defEAt oF the Axis PowerS, thIngs CHAnGed:

BY 1942-1943
 card numbers and click Pa y. 

I get  thefol low in g er rorin my javascri p t co nsole.

I was just fol lowin gt he a c ce pt.js  tutori a lf r omth eoff ic i al  page . https:/ /developer .au th orize.net/ap i /r eference/f eat ures/acceptj s.h tml
Iap pre c iateany  help  as to the re ason forth i s "Enc r yptionF a il ed"error? Thanks!
UP D AT E :
Ok so i didsome m or e  d e b ugg ing . I put ate st co d e "cons o le . l o g(" t est");" insid e responseH a ndl er() f un cti o n andnotic ed tha t it was ca lled  twice. I  am no w  wonder i ng whyis res pon seH andl e r( )bei ng cal l ed  tw i ce.  

A:

W he nAccep t.js t r i gger s t he c allba ck function t wic e du e  to  some  othe r Ja va scrip t erro r occ ur ring on the pag e, y ou can pr ett yqui ck ly tr a ck dow n t hesourceof that err or o n  t he by wrapping the  c o n te nts of y our ca l lb ac k  functio nina tr y / catch  blo c k: 
Accept. dispat c hD at a(secur eD ata, r es pon seH andle r );
...

f unctionrespo n seHandler(resp o nse) {
  try{ 
 i f  (re spo nse.message s.re s ultC ode= ==  "E r ror")  {
   v a r i = 0;
      whil e(i < r espon se.messages.m essage.len g t h ) {
      c on s ole.log(
        response.m e ssages.m essag e[i].cod e + ": "+          r esp ons e.m e s sa ges.message[i ] . text 
      );       i= i  +1;     }
   }
  } c at ch  ( er ror ) {
  consol e. log (e rro r);
}
}

Q:

W hy w as  S p ani sh Fasc i st d icta to rs hiplef tin po wera fte r World  War II?
Th r ough ou tthe Sec ond World War ,many peopl einSpainw e re under  the hope that the vict o ry of t heAllie s wo uld trigg eran inv asi o n of S pain t o def ea t t h e  dict a t or shi pof Franco, a  fa scist  w ho w on theCivil War in 1939t han ks to the hel p o f Mu s s ol ini ' sI tal ya ndH i tler's Germany. 
It is a k no w nfact thatB rit ai n bribe d Spain  to s t ay outof Second  World Wa r.  The r e  ar e other re asons th at are ve r y wel l  d etail edin Why  w ere  Spai n andP ort ugalneutra l/ notinvad ed  in WWII ?.
Despite all of this,  there  were  qu ite a lot  of vol unteers,even  many sent  to  Ru ssiabyt he go vern m en t i t self(the DivisiónA zu l t o Ru ssia).
Thro u g h out  thewar ,  Spain 's g overnment moved f r om supportingtheA x isPow e rs t ocalling themse lve sn e utral. A sit was fear ing thede f eat o f theAxis P owers,t h in g s chan ged: 

b y 1942-19 43
 card_numbers and_click Pay. 

I get_the following_error_in my_javascript_console.

I was just_following the accept.js_tutorial from the official_page. 
https://developer.authorize.net/api/reference/features/acceptjs.html
I appreciate_any_help as to the reason for this "Encryption Failed" error? Thanks!
UPDATE:
Ok so i did_some_more debugging._I_put_a test code "console.log("test");" inside_responseHandler() function and noticed that_it was_called twice. I am now wondering why is_responseHandler()_being called twice._

A:

When Accept.js triggers the callback function twice due to_some other Javascript error occurring on_the page, you_can_pretty_quickly track down the_source of that error on the_by wrapping the contents of your_callback function in a try/catch block:
Accept.dispatchData(secureData, responseHandler);

...

function_responseHandler(response) {
  try {
 _  if (response.messages.resultCode ===_"Error") {
_    _var i =_0;
 _  _ while (i < response.messages.message.length) {
_  _    console.log(
 __  ___ _response.messages.message[i].code + ":_"_+
 __     __response.messages.message[i].text
      _ );
  __   _i = i + 1;
_     }
_ _ }
_ } catch (error) {
    console.log(error);
  }
}

_Q:

Why was Spanish Fascist dictatorship left_in power after World_War II?

Throughout_the_Second World War,_many_people in_Spain were under the hope that the_victory of_the Allies would trigger an invasion_of Spain to defeat_the_dictatorship of Franco, a fascist who_won the Civil War in 1939_thanks to the help of_Mussolini's_Italy_and Hitler's Germany.
It is a_known fact that Britain bribed Spain_to stay out_of Second World War. There are other_reasons_that are very well detailed in_Why_were Spain and Portugal neutral /_not_invaded_in WWII?.
Despite all of this,_there were quite a lot of_volunteers, even many sent to Russia by the government_itself (the División_Azul to Russia).
Throughout the war,_Spain's_government_moved from supporting the Axis Powers to calling themselves neutral._As it_was fearing the_defeat of the Axis Powers, things changed:

by 1942-1943