2016-05-12 6 views
1

このプラグインをダウンロードしました。Magnetic Card Reader私の限られた経験のお陰で私は問題が発生しています。私はsquare 3.5mm card readerのプラグインを使用しています。作者によれば、3.5mmカードリーダーで動作すると仮定しています。私はこのコードを書類にしたがってカードリーダーを始めるために持っています。Phonegapカードリーダープラグイン

$scope.start = function() { 

     function cardReaderStart(cardReadSuccess, cardReadFailure) { 
      console.log("Card reader started!"); 
      window.plugins.CardReaderPlugin.start(cardReadSuccess, cardReadFailure); 
     } 

     // If OS is Android 
     function cardReadSuccess(response) { 
      console.log("Card number:" + response[0].card_number); 

      if (typeof response[0].expiry_month != 'undefined' && response[0].expiry_month != null) { 
       console.log("Expiry month:" + response[0].expiry_month); 
      } 

      if (typeof response[0].expiry_year != 'undefined' && response[0].expiry_year != null) { 
       console.log("Expiry month:" + response[0].expiry_year); 
      } 
     } 

     //If OS is iOS 
     function cardReadSuccess(response) { 
      console.log("Card number:" + response['card_number']); 

      if (typeof response[0].expiry_month != 'undefined' && response[0].expiry_month != null) { 
       console.log("Expiry month:" + response['expiry_month']); 
      } 

      if (typeof response[0].expiry_year != 'undefined' && response[0].expiry_year != null) { 
       console.log("Expiry month:" + response['expiry_year']); 
      } 
     } 

     function cardReadFailure() { 
      console.log('Please try again!'); 
     } 

    }; 

問題は、私が$ scope.startをクリックした後、正方形のカードリーダーでクレジットカードをスワイプしても何も起こりません。

私は何が間違っているのだろうか?あなたが他のカードリーダーのプラグインを知っていれば、私はそれを使うことができます。

ありがとう:)

+0

エラートレースはありますか? codeova.jsファイルはHTMLに含まれていますか? devicereadyイベント内で呼び出されたプラグインコード? – Gandhi

答えて

0

を、私は、このための作業のコードを書いていた、現在、それは完全に私はIOSのためにリリースするつもりすぐに、Androidのために働いている、Hereをクリックしてください。まだクエリがある場合は、クエリのために以下にコメントしてください。