Skip to content

Instantly share code, notes, and snippets.

@matsubo
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsubo/0bc17084b8d4d209d2f4 to your computer and use it in GitHub Desktop.
Save matsubo/0bc17084b8d4d209d2f4 to your computer and use it in GitHub Desktop.
<!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="https://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js"></script>
<script src="http://0.0.0.0:3000/assets/v1/checkout.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>
$('message').innerHTML = 'text from prototype';
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment