ドキュメントのサンプルコードを使用してWeb APIをテストしようとしています。私は正常に任意のエラーを生成するとAPPを呼び出すことができますが、私は私のスクリプトに難しいコーディングしているドルの額は正しい以上に渡っていません。それは2桁のようです。正方形の売り場が正しいドルの金額を読み取っていない
すなわち$ 500は私が値のテキストフィールドの値だけでなく、ハードコーディングを使用してみましたが$ 5
に変換されます。毎回同じ結果。私は自分のWebフォーム上のボタンをクリックしたときに
私はコードを呼び出す:
<!--- Square CC Processing --->
<script>
document.getElementById("do_square_payment_btn").onclick = function (e) {
e.preventDefault();
var amount = $('#payment_amount_mobile').val();
//var amountFixed = amount.toFixed(2);
console.log("Amount being passed in on square button click " + amount);
var dataParameter = {
"amount_money": {
"amount" : '5000' ,
"currency_code" : "USD"
},
"callback_url" : "https://jaydien.ezservicetrax.com", // Replace this value with your application's callback URL
"client_id" : "sq0idp-CHLAPYt9s1L594ZZZysDSQ", // Replace this value with your application's ID
"version": "1.3",
"notes": "Computer Service",
"options" : {
"supported_tender_types" : ["CREDIT_CARD"] //,"CASH","OTHER","SQUARE_GIFT_CARD","CARD_ON_FILE"
}
};
console.log(amount);
console.log("Square button clicked");
console.log("square-commerce-v1://payment/create?data=" + encodeURIComponent(JSON.stringify(dataParameter)));
location.href = "square-commerce-v1://payment/create?data=" + encodeURIComponent(JSON.stringify(dataParameter));
};
//window.location = "square-commerce-v1://payment/create?data=" + encodeURIComponent(JSON.stringify(dataParameter));
</script>
は私が間違って何をしているのですか?
............. Java? –