Checkout
KOMOJU Checkout is a fully customizable Javascript widget for your website or HTML5 enabled applications. Using this widget you can easily integrate every payment method supported by KOMOJU with only a few lines of code.
Example
Test the widget below using one of the test cards from the API documentation.
Getting Started (using HTML)
Simply copy and paste the following code into your application to start making payments with KOMOJU:
<form action="/charge" method="POST">
<script
src="https://cdn.komoju.com/javascripts/komoju.js" class="komoju-button"
data-key="pk_xFgfa1AVyOWN8ahjoN0g"
data-amount="1000"
data-endpoint="https://komoju.com"
data-currency="JPY"
data-label="Demo Item"
data-locale="en"
data-title="komoju sticker"
data-web-money="true"
data-konbini="true"
data-bank-transfer="true"
data-pay-easy="true"
data-bit-cash="true"
data-net-cash="true">
</script>
</form>
After submitting a payment, the widget will send a POST request to the path defined in action
. With the form code above the endpoint at /charge
on your website will receive a post request with a parameter komoju_token
when payment details are submitted. You can use this token to create a purchase in KOMOJU (for more information on tokens see the documentation).
Parameters
Required
Parameter | Description |
---|---|
data-key | Publishable Key |
Optional
Parameter | Description | Default |
---|---|---|
data-amount | Payment amount | |
data-endpoint | Endpoint URL | "https://komoju.com" |
data-currency | Currency (USD, JPY, etc.) | "JPY" |
data-label | Payment button text | "Pay" |
data-panel-label | Checkout form button's text | "Pay {{amount}}" |
data-locale | Locale ("en" or "ja" supported) | "auto" |
data-title | Company name or title of website | |
data-credit-card | Enable Credit Card | true |
data-web-money | Enable WebMoney | false |
data-konbini | Enable Konbini | false |
data-bank-transfer | Enable Bank Transfer | false |
data-pay-easy | Enable PayEasy | false |
data-bit-cash | Enable BitCash | false |
data-net-cash | Enable NetCash | false |
Getting Started (using JavaScript)
Please use the following code as a reference:
<script src="https://cdn.komoju.com/javascripts/komoju.js"></script>
<button id="customButton">Pay</button>
<script>
var handler = Komoju.checkout.configure({
key: "your_publishable_key",
token: function(token) {
// token variable is Token object.
// token.id is token for payment API.
}
});
document.getElementById("customButton").addEventListener("click", function(e) {
handler.open({
amount: 1000,
endpoint: "https://komoju.com",
locale: "ja",
currency: "JPY",
title: "Title",
webMoney: true,
konbini: true,
bankTransfer: true,
payEasy: true,
bitCash: true,
netCash: true
});
e.preventDefault();
});
</script>
Parameters
Required
Parameter | Description |
---|---|
key | Publishable Key |
token | Callback after succeed Token API |
Optional
Parameter | Description | Default |
---|---|---|
amount | Payment amount | |
endpoint | Endpoint URL | "https://komoju.com" |
currency | Currency | "JPY" |
label | Payment button text | "Pay" |
panelLabel | Checkout form button's text | "Pay {{amount}}" |
locale | Locale ("en" or "ja" supported) | "auto" |
title | Company name or title of website | |
creditCard | Enable Credit Card | true |
webMoney | Enable WebMoney | false |
konbini | Enable Konbini | false |
bankTransfer | Enable Bank Transfer | false |
payEasy | Enable PayEasy | false |
bitCash | Enable BitCash | false |
netCash | Enable NetCash | false |
SSL
All communications between KOMOJU Checkout and the KOMOJU API are encrypted with SSL. To minimize the possibility of man-in-the-middle attacks, we recommend that websites using KOMOJU Checkout also use SSL.