API 使用說明

 註冊會員
                            
<?php
    $url = "https://usdt.online/api/1.0/?sub=signup";
	$ch = curl_init();
	$data = array(
		"email" => "[email protected]", //信箱
		"name" => "王大明",	 //姓名
		"address" => "TJKSrpBEiMQCrSNRnyKZAZUVuP4euVNjj7",	  //錢包地址(為了安全輸入後即無法再修改)
		"password" => "P@SSWORD", //密碼
		"phone" => "+886905592999"
	);
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
	curl_setopt($ch, CURLOPT_HEADER, false);
	curl_setopt($ch, CURLOPT_NOBODY, false);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	$curl_result = json_decode(curl_exec($ch), true);
	curl_close($ch);
	print_r($curl_result);
?>
                            
                        
資料回傳
                        
Array (
    [status] => 1
    [msg] => 已經註冊成功,請於三日內驗證信箱,驗證完成帳號功能才會正常開通,未驗證者,時間到期後自動刪除。
    [uid] => 64xxxxxxxcxxa
    [api_key] => 7ca01dbe-xxxx-xxxx-xxxx-0ae47f9cb71d
)
                        
                    
 取得 API_KEY(需註冊會員)
                            
<?php
	$url = "https://usdt.online/api/1.0/?sub=get_api_key";
	$ch = curl_init();
	$data = array(
		"email" => "[email protected]",
		"password" => "P@SSWORD"
	);
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
	curl_setopt($ch, CURLOPT_HEADER, false);
	curl_setopt($ch, CURLOPT_NOBODY, false);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	$curl_result = json_decode(curl_exec($ch), true);
	curl_close($ch);
	print_r($curl_result);
?>
                            
                        
資料回傳
                            
Array (
    [status] => 1
    [msg] => OK
    [uid] => 64xxxxxxxcxxa
    [api_key] => 7ca01dbe-xxxx-xxxx-xxxx-0ae47f9cb71d
)
                            
                        
 建立購物頁(若有自有購物車系統則此為非必要項目)(需註冊會員)
                            
<?php
    $url = "https://usdt.online/api/1.0/?sub=create_order";
    $ch = curl_init();
    $data = array(
        "uid" => "64xxxxxxxcxxa", //UID
        "api_key" => "7ca01dbe-xxxx-xxxx-xxxx-0ae47f9cb71d",	//API_KEY
        "product_name" => "USDT.ONLINE 示範購物頁", //商品名稱
        "product_description" => "示範購物說明", //商品描述
        "amt" => 100.1
    );
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_NOBODY, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    $curl_result = json_decode(curl_exec($ch), true);
    curl_close($ch);
    print_r($curl_result);
?>
                            
                        
資料回傳
                            
Array (
    [status] => 1
    [msg] => 您的購買頁面已經建立完成。
    [data] => Array
        (
            [url] => https://usdt.online/order/oxxxxM
        )
)
                            
                        
 建立付款地址
                            
<?php
    $url = "https://usdt.online/api/1.0/?sub=create_transaction";
    $ch = curl_init();

    $data = array(
            "uid" => "64xxxxxxxcxxa",
            "api_key" => "7ca01dbe-xxxx-xxxx-xxxx-0ae47f9cb71d",
            "amt" => "7.5", //單位USD
            "merchantorderno" => time(), //商家自訂單號
            "product_name" => "測試商品",
            "product_description" => "商品描述",
            "name" => "小英", //購買者
            "email" => "[email protected]", //購買者信箱
            "return_url" => "https://xxx.test", //回導頁面
            "notify_url" => "https://xxx.test", //程式幕後接收網址
    );
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_NOBODY, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    $curl_result = json_decode(curl_exec($ch), true);
    curl_close($ch);
    print_r($curl_result);
?>
                            
                        
資料回傳
                            
Array
(
    [status] => 1
    [msg] => 您的付款頁面已經建立完成。
    [data] => Array
        (
            [pid] => ZxxxM-xxxxxxxxxx08 #usdt.online 產生的訂單號
            [amt] => 7.5 #應付款金額
            [address] => TJKSrpBEiMQCrSNRnyKZAZUVuP4euVNjj7 #給購買者付款的USDT TRC20 地址
            #QRCode PNG 圖檔(base64 格式)
            [png] => data:image/png;base64,iVBORw0KGgoAAAANSUhEU......過長省略.....SuQmCC
            #如果沒有自己的付款頁面,可以直接轉到 usdt.online 設計的通用付款頁面
            [url] => https://usdt.online/transaction/ZxxxM-xxxxxxxxxx08
            [expire_time] => yyyy-mm-dd hh:ii:ss #付款期限
        )

)
                            
                        
 查詢付款狀態
                            
<?php

	$url = "https://usdt.online/api/1.0/?sub=transaction_status";
	$ch = curl_init();
	$data = array(
		"transaction_id" => "34a10b7f-xxxx-xxxx-xxxx-779aee7ca094",
	);
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
	curl_setopt($ch, CURLOPT_HEADER, false);
	curl_setopt($ch, CURLOPT_NOBODY, false);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	$curl_result = json_decode(curl_exec($ch), true);
	curl_close($ch);
	print_r($curl_result);
?>
                            
                        
資料回傳
                            
Array
(
    [status] => 1
    [data] => Array
        (
            #若沒有輸入 return_url 則預設為 #
            [url] => #
            [address] => TJKSrpBEiMQCrSNRnyKZAZUVuP4euVNjj7 #付款地址
            [status] => unpid #是否已經付款 unpaid 或 paid
            [amt] => 7.5 #付款金額
            [expire_time] => yyyy-mm-dd hh:ii:ss #付款期限
        )

)
                            
                        
settings
Material UI Configurator

See our dashboard options.


Sidebar Colors
Sidenav Type

Choose between 2 different sidenav types.

USDT.Online 為 USDT 代收網站,收款後當日到帳。

Navbar Fixed

Light / Dark

Free Download View documentation
Star
Thank you for sharing!
Tweet Share