ZoneCoinを統合 あらゆる場所で

あらゆるウェブサイト、CMS、マーケットプレイスでZoneCoin決済を受け入れるためのユニバーサルJavaScript SDK。コピーして貼り付けるだけで完了。

🔵 WordPress
🟣 WooCommerce
🟠 Magento 2
🟢 Shopify
🔴 PrestaShop
🟡 VirtueMart
🔶 HikaShop
🟤 J2Store
🩵 PhocaCart
🌐 あらゆるウェブサイト

⚡ クイックスタート

3つの簡単なステップでZoneCoin決済を開始 — サーバーサイドのコードは不要です。

1
APIキーを取得
加盟店として登録し、ZoneCoinダッシュボードからAPIキーを生成してください。
2
SDKを追加
ウェブサイトにZoneCoin SDKスクリプトを追加 — HTMLたった1行です。
3
決済を受付
SDKを初期化して、即座にZoneCoin決済の受付を開始できます。

📦 ユニバーサルSDK

ZoneCoin SDKは基盤技術に関係なく、あらゆるウェブサイトで動作します。スクリプトを読み込み、認証情報で初期化し、決済フォームやボタンを作成してください。

1. SDKを読み込む

HTML<script src="https://zonecoin.zonenations.com/media/com_zonecoin/js/zonecoin-sdk.js"></script>

2. 初期化

JavaScriptZoneCoinSDK.init({ apiUrl: 'https://zonecoin.zonenations.com/api/index.php/v1/zonecoin', apiKey: 'YOUR_PUBLIC_API_KEY', merchant: 'your-merchant-id', currency: 'EUR', theme: 'dark', sandbox: true });

3. 決済を作成

JavaScriptZoneCoinSDK.pay({ amount: 100, description: 'Premium subscription', ref: 'order_12345', isFiat: true, callback: 'https://your-site.com/webhook/zonecoin' }).then(result => { console.log('Payment TX:', result.txId); });

4. 決済ボタン

HTML + JS<div id="zc-pay-btn"></div> <script> ZoneCoinSDK.createPayButton('#zc-pay-btn', { amount: 49.99, description: 'Digital artwork', label: 'Pay with ZoneCoin ⚡' }); </script>

5. イベント

JavaScriptZoneCoinSDK.on('success', (data) => { // { txId, amount, ref, amountFiat, rate } window.location.href = '/thank-you?tx=' + data.txId; }); ZoneCoinSDK.on('error', (err) => alert(err.message)); ZoneCoinSDK.on('cancel', () => console.log('Cancelled'));

🔵 WordPress / WooCommerce

テーマにSDKをエンキューし、オプションでWooCommerce決済ゲートウェイを作成してカート完全統合を実現します。

functions.php

PHPadd_action('wp_enqueue_scripts', function() { wp_enqueue_script('zonecoin-sdk', 'https://zonecoin.zonenations.com/media/com_zonecoin/js/zonecoin-sdk.js', [], '1.0.0', true ); wp_add_inline_script('zonecoin-sdk', " ZoneCoinSDK.init({ apiUrl: '" . esc_js(get_option('zc_api_url')) . "', apiKey: '" . esc_js(get_option('zc_api_key')) . "', merchant: '" . esc_js(get_option('zc_merchant')) . "', currency: 'EUR', sandbox: false }); "); });

WooCommerce Gateway

PHPclass WC_ZoneCoin_Gateway extends WC_Payment_Gateway { public function __construct() { $this->id = 'zonecoin'; $this->method_title = 'ZoneCoin'; $this->has_fields = false; $this->init_form_fields(); $this->init_settings(); } public function process_payment($order_id) { $order = wc_get_order($order_id); return ['result' => 'success', 'redirect' => $order->get_checkout_payment_url(true)]; } }

🟠 Magento 2

レイアウトXML経由でSDKスクリプトを追加し、カスタムRequireJS決済レンダラーモジュールを作成します。

checkout_index_index.xml

XML<head> <script src="https://zonecoin.zonenations.com/media/com_zonecoin/js/zonecoin-sdk.js" src_type="url" /> </head>

view/frontend/web/js/view/payment/method-renderer/zonecoin.js

JavaScriptdefine(['ZoneCoinSDK', 'Magento_Checkout/js/model/quote'], function(ZC, quote) { return Component.extend({ placeOrder: function() { ZoneCoinSDK.pay({ amount: quote.totals().grand_total, ref: quote.getQuoteId(), isFiat: true }).then(r => this.afterPlaceOrder(r)); } }); });

🟢 Shopify

LiquidテンプレートとShopifyチェックアウト拡張機能を使用してZoneCoin決済を埋め込みます。

Liquid + JS<script src="https://zonecoin.zonenations.com/media/com_zonecoin/js/zonecoin-sdk.js"></script> <script> ZoneCoinSDK.init({ apiUrl: 'https://your-joomla.com/api/index.php/v1/zonecoin', apiKey: '{{ settings.zc_api_key }}', merchant: '{{ settings.zc_merchant }}', currency: '{{ shop.currency }}' }); ZoneCoinSDK.createPayButton('#zc-pay', { amount: {{ checkout.total_price | money_without_currency }}, ref: '{{ checkout.order_id }}' }); </script> <div id="zc-pay"></div>

🔴 PrestaShop

hookPaymentOptions統合ポイントを使用してPrestaShop決済モジュールを作成します。

PHP (Module)class ZoneCoinPayment extends PaymentModule { public function hookPaymentOptions($params) { $option = new PaymentOption(); $option->setModuleName($this->name) ->setCallToActionText('Pay with ZoneCoin ⚡') ->setAdditionalInformation( '<div id="zc-presta-pay"></div> <script src="https://zonecoin.zonenations.com/media/com_zonecoin/js/zonecoin-sdk.js"></script>' ); return [$option]; } }

🟡 VirtueMart

ZoneCoin SDKを読み込み、チェックアウト時に決済を処理するVirtueMart決済プラグイン(vmpayment)を作成します。

Plugin: vmpayment_zonecoin.php

PHPclass plgVmPaymentZonecoin extends vmPSPlugin { public function __construct(&$subject, $config) { parent::__construct($subject, $config); $this->_loggable = true; $this->tableFields = array_keys($this->getTableSQLFields()); } function plgVmConfirmedOrder($cart, $order) { $method = $this->getVmPluginMethod($order['details']['BT']->virtuemart_paymentmethod_id); if (!$method) return null; $doc = \Joomla\CMS\Factory::getApplication()->getDocument(); $doc->addScript('https://zonecoin.zonenations.com/media/com_zonecoin/js/zonecoin-sdk.js'); $doc->addScriptDeclaration(" ZoneCoinSDK.init({ apiUrl: '" . $method->zc_api_url . "', apiKey: '" . $method->zc_api_key . "', merchant: '" . $method->zc_merchant . "', currency: '" . $method->payment_currency . "' }); ZoneCoinSDK.pay({ amount: " . $order['details']['BT']->order_total . ", ref: 'VM-" . $order['details']['BT']->order_number . "', isFiat: true }).then(data => { window.location.href = 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginResponseReceived&pm=" . $order['details']['BT']->virtuemart_paymentmethod_id . "'; }); "); } function plgVmOnPaymentResponseReceived(&$html) { // Verify webhook callback, update order status return true; } }

🔶 HikaShop

onAfterOrderConfirmイベントとWebhook通知でZoneCoinを統合するHikaShop決済プラグインを構築します。

Plugin: hikashoppayment_zonecoin.php

PHPclass plgHikashoppaymentZonecoin extends hikashopPaymentPlugin { var $accepted_currencies = array('EUR','USD','GBP','CHF'); var $multiple = true; var $name = 'zonecoin'; function onAfterOrderConfirm(&$order, &$methods, $method_id) { parent::onAfterOrderConfirm($order, $methods, $method_id); $method = $this->getPaymentMethod($method_id); if (!$method) return false; $amount = round($order->order_full_price, 2); $orderRef = $order->order_number; $apiUrl = $method->payment_params->zc_api_url; $apiKey = $method->payment_params->zc_api_key; $merchant = $method->payment_params->zc_merchant; $html = '<div id="zc-hika-pay"></div> <script src="https://zonecoin.zonenations.com/media/com_zonecoin/js/zonecoin-sdk.js"></script> <script> ZoneCoinSDK.init({ apiUrl:"' . $apiUrl . '", apiKey:"' . $apiKey . '", merchant:"' . $merchant . '" }); ZoneCoinSDK.createPayButton("#zc-hika-pay", { amount:' . $amount . ', ref:"HIKA-' . $orderRef . '", isFiat:true }); </script>'; $this->showPage('end', $html); return true; } function onPaymentNotification(&$statuses) { // Webhook handler: verify HMAC, update order status $this->modifyOrder($order_id, 'confirmed'); return true; } }

🟤 J2Store

_prePaymentフックを使用してZoneCoinチェックアウトフローを組み込むJ2Store決済プラグインを開発します。

Plugin: j2store_payment_zonecoin.php

PHPclass plgJ2StorePayment_zonecoin extends J2StorePaymentPlugin { var $_element = 'payment_zonecoin'; function _prePayment($data) { $vars = new \stdClass(); $order = F0FTable::getAnInstance('Order', 'J2StoreTable'); $order->load(array('order_id' => $data['order_id'])); $vars->order_id = $data['order_id']; $vars->amount = $order->order_total; $vars->currency = $order->currency_code; $html = '<div id="zc-j2-pay"></div> <script src="https://zonecoin.zonenations.com/media/com_zonecoin/js/zonecoin-sdk.js"></script> <script> ZoneCoinSDK.init({ apiUrl: "' . $this->params->get('zc_api_url') . '", apiKey: "' . $this->params->get('zc_api_key') . '", merchant: "' . $this->params->get('zc_merchant') . '" }); ZoneCoinSDK.pay({ amount: ' . $vars->amount . ', ref: "J2-' . $vars->order_id . '", isFiat: true }).then(data => { window.location.href = "index.php?option=com_j2store&view=checkout&task=confirmPayment&orderpayment_type=payment_zonecoin&paction=process"; }); </script>'; return $html; } function _postPayment($data) { // Verify webhook + update order to "Confirmed" $order = F0FTable::getAnInstance('Order', 'J2StoreTable'); $order->load(array('order_id' => $data['order_id'])); $order->order_state_id = 1; // Confirmed $order->store(); } }

🩵 PhocaCart

シームレスなZoneCoin決済のためにonPCPafterCheckoutConfirmにフックするPhocaCart決済プラグインを作成します。

Plugin: phocacartpayment_zonecoin.php

PHPclass plgPhocacartpaymentZonecoin extends \JPlugin { public function onPCPafterCheckoutConfirm($order, $params) { $amount = $order->total->brutto; $orderId = $order->id; $apiUrl = $this->params->get('zc_api_url'); $apiKey = $this->params->get('zc_api_key'); $merchant = $this->params->get('zc_merchant'); $html = '<div id="zc-phoca-pay"></div> <script src="https://zonecoin.zonenations.com/media/com_zonecoin/js/zonecoin-sdk.js"></script> <script> ZoneCoinSDK.init({ apiUrl:"' . $apiUrl . '", apiKey:"' . $apiKey . '", merchant:"' . $merchant . '" }); ZoneCoinSDK.createPayButton("#zc-phoca-pay", { amount: ' . $amount . ', ref: "PHOCA-' . $orderId . '", isFiat: true }); </script>'; return $html; } public function onPCPafterPaymentNotification($order, $params) { // Verify HMAC webhook signature, mark order paid $order->status_id = 1; // Confirmed return true; } }

🔌 REST API エンドポイント

すべてのSDK呼び出しはREST APIと通信します。任意のサーバーサイド言語からこれらのエンドポイントを直接呼び出すこともできます。

認証

HTTPAuthorization: Bearer YOUR_API_KEY X-ZoneCoin-Timestamp: 1719500000 X-ZoneCoin-Nonce: a1b2c3d4e5f6 X-ZoneCoin-Signature: HMAC-SHA256(timestamp+nonce+body, secret)
GET/rate現在のZoneCoin為替レート
GET/balance/{wallet}ウォレット残高
POST/pay決済リクエストの作成
POST/transferウォレット間送金
GET/tx/{id}取引詳細
POST/webhook/registerWebhook URLの登録
GET/tokenomicsトークン供給量と市場データ
GET/nft/{id}NFTメタデータと所有権

Webhookペイロード

JSON{ "event": "payment.completed", "txId": "zc_tx_a1b2c3d4e5", "amount": 100.00, "currency": "ZC", "amountFiat": 35.50, "fiatCurrency": "EUR", "ref": "order_12345", "merchant": "your-merchant-id", "timestamp": 1719500123, "signature": "hmac_sha256_of_payload" }

🛡️ セキュリティ

🔐
HMAC-SHA256
すべてのリクエストはHMAC-SHA256で署名され、改ざんを防止します。
⏱️
Nonce + タイムスタンプ
一意のNonceと5分間のタイムスタンプウィンドウによるリプレイ保護。
🚦
レート制限
トークンバケットアルゴリズム:APIキーあたり60リクエスト/分、バースト最大120。

📦 すぐに使えるプラグイン

最も人気のあるEコマースプラットフォーム向けの事前構築済み決済プラグインをダウンロードします。インストールし、APIキーを設定すれば、すぐにZoneCoinを受け付けられます。

📋
WooCommerce
WordPress 6+ / WooCommerce 8+
⬇ Download
📋
PrestaShop
PrestaShop 8+
⬇ Download
📋
VirtueMart
Joomla 6+ / VirtueMart 4+
⬇ Download
📋
HikaShop
Joomla 6+ / HikaShop 5+
⬇ Download
📋
J2Store
Joomla 6+ / J2Store 4+
⬇ Download
📋
PhocaCart
Joomla 6+ / PhocaCart 4+
⬇ Download
📋
Magento 2
Magento 2.4+
⬇ Download
📋
Shopify
Shopify / Custom Storefront
⬇ Download

🎮 プラットフォーム&メタバースSDK

ゲームエンジン、仮想世界、メタバースプラットフォーム向けのすぐに使えるSDK。プロジェクトに組み込むだけでZoneCoin決済を受け付けられます。

🎮
OpenSimulator
OpenSim 0.9.2+ / .NET 6+
⬇ Download SDK
🎮
Second Life
Second Life LSL
⬇ Download SDK
🎮
Unity
Unity 2021.3+ / .NET Std 2.1
⬇ Download SDK
🎮
Unreal Engine
Unreal Engine 5.1+
⬇ Download SDK
🎮
Godot 4
Godot 4.0+
⬇ Download SDK
🎮
Minecraft
Spigot/Paper 1.20+ / Java 17+
⬇ Download SDK
🎮
Roblox
Roblox Studio / Luau
⬇ Download SDK
🎮
VRChat
VRChat SDK3 / UdonSharp 1.0+
⬇ Download SDK
🎮
Decentraland
Decentraland SDK 7 / Node 18+
⬇ Download SDK
🎮
The Sandbox
The Sandbox Game Maker
⬇ Download SDK

統合の準備はできましたか?

5分以内にウェブサイトでZoneCoin決済の受付を開始できます。SDKがすべてを処理します。