Created
August 12, 2014 11:22
-
-
Save matsubo/cddbb1bf8e6237989fae to your computer and use it in GitHub Desktop.
This file contains hidden or 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="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: "[email protected]", | |
}); | |
e.preventDefault(); | |
}); | |
</script> | |
<script> | |
// properties are directly passed to `create` method | |
var Person = Class.create({ | |
initialize: function(name) { | |
this.name = name; | |
}, | |
say: function(message) { | |
return this.name + ': ' + message; | |
} | |
}); | |
var Pirate = Class.create(Person, { | |
// redefine the speak method | |
say: function($super, message) { | |
return $super(message) + ', yarr!'; | |
} | |
}); | |
var john = new Pirate('Long John'); | |
console.info(john); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment