Created
August 13, 2014 02:52
-
-
Save matsubo/ff92820490db6ab00d99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Sample Page</title> | |
<meta name="author" content="Yuki Matsukura"> | |
</head> | |
<body> | |
<form> | |
<button id="customButton">Open</button> | |
</form> | |
<div id="message"></div> | |
<script src="http://0.0.0.0:3000/assets/v1/checkout.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js"></script> | |
<script> | |
// SPIKE Checkoutのインスタンスを生成する | |
var handler = SpikeCheckout.configure({ | |
key: "pk_test_WTBJorIdHmQtCkgBBx9n6W1a", | |
token: function(token, args) { | |
}, | |
opened: function(e) { | |
console.debug("Window opened event."); | |
}, | |
closed: function(e) { | |
console.debug("Window closed event."); | |
} | |
}); | |
// カード情報を入力するオーバーレイを開く処理 | |
document.getElementById("customButton").addEventListener("click", function(e) { | |
handler.open({ | |
name: "オンラインショップ", | |
amount: 900, | |
currency: "JPY", | |
email: "foo@example.com", | |
}); | |
e.preventDefault(); | |
}); | |
</script> | |
<script> | |
// DOM instance returned from prototype | |
console.info($('message')); | |
setTimeout(function() { | |
console.info('fire'); | |
// $ is replaced by jquery object | |
console.info($('message')); | |
$('message').innerHTML = 'text from prototype'; | |
}, 3000); | |
</script> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment