Há quatro SDKs: Node.js, Java, PHP e Go, com parâmetros API, assinaturas, corpos JSON e verificação de callbacks consistentes.
Baixe o ZIP da sua linguagem. Cada pacote inclui instruções de instalação, cliente, ferramentas de assinatura e exemplos.
Destaques
- Inclui createPayinOrder, getPayinOrder, createExclusiveBinding e createPayoutOrder.
- A assinatura da solicitação corresponde à implementação da assinatura do comerciante-openapi do servidor.
- A verificação de retorno de chamada oferece suporte à verificação direta da string body da solicitação bruta.
- Exemplo de recarga: configuração, verificação de callbacks e crédito transacional sem duplicação
Instalação
npm install ./uugate-nodejs-sdk
Exemplo rápido
import { UUGateClient } from 'uugate-openapi-sdk';
const client = new UUGateClient({
baseUrl: 'https://api.uugate.com',
merchantUid: process.env.UUGATE_MERCHANT_UID,
apiKey: process.env.UUGATE_API_KEY,
});
const order = await client.createPayinOrder({
chainCode: 'TRON',
tokenSymbol: 'USDT',
merchantOrderNo: 'M202604170001',
amount: '100.00',
notifyUrl: 'https://merchant.example.com/api/uugate/payin-notify',
});
Destaques
- Inclui createPayinOrder, getPayinOrder, createExclusiveBinding e createPayoutOrder.
- O sucesso retorna o JSON de negócio original. Trate separadamente erros JSON e recusas HTTP com corpo vazio.
- Verifique callbacks com a API Key do pedido original e os bytes originais do corpo.
Instalação
cd uugate-java-sdk
javac -encoding UTF-8 -d build src/uugate/UUGateClient.java examples/Example.java
java -cp build Example
Exemplo rápido
import uugate.UUGateClient;
import java.util.Map;
UUGateClient client = new UUGateClient("https://api.uugate.com",
System.getenv("UUGATE_MERCHANT_UID"), System.getenv("UUGATE_API_KEY"));
String order = client.createPayinOrder(Map.of(
"chainCode", "TRON", "tokenSymbol", "USDT",
"merchantOrderNo", "M202604170001", "amount", "100.00",
"notifyUrl", "https://merchant.example.com/api/uugate/payin-notify"));
Destaques
- Suporta descoberta automática Laravel para ServiceProvider e Façade.
- Suporta o envio de quatro solicitações OpenAPI por meio de UUGateClient ou Façade.
- Inclui verificação apiKey para retornos de chamada de pagamento e pagamento.
Instalação
composer config repositories.uugate-sdk path ./uugate-php-laravel-sdk
composer require uugate/openapi-laravel-sdk:*@dev
Exemplo rápido
use UUGate\OpenApi\Facades\UUGate;
$order = UUGate::createPayinOrder([
'chainCode' => 'TRON',
'tokenSymbol' => 'USDT',
'merchantOrderNo' => 'M202604170001',
'amount' => '100.00',
'notifyUrl' => 'https://merchant.example.com/api/uugate/payin-notify',
]);
Destaques
- Inclui CreatePayinOrder, GetPayinOrder, CreateExclusiveBinding e CreatePayoutOrder
- O sucesso retorna o JSON de negócio original. Trate separadamente erros JSON e recusas HTTP com corpo vazio.
- Verifique callbacks com a API Key do pedido original e os bytes originais do corpo.
Instalação
cd uugate-go-sdk
go test ./...
go run ./examples/basic
Exemplo rápido
import (
"context"
"os"
uugate "uugate.local/openapi"
)
client, err := uugate.NewClient("https://api.uugate.com",
os.Getenv("UUGATE_MERCHANT_UID"), os.Getenv("UUGATE_API_KEY"))
if err != nil { panic(err) }
order, err := client.CreatePayinOrder(context.Background(), map[string]any{
"chainCode": "TRON", "tokenSymbol": "USDT",
"merchantOrderNo": "M202604170001", "amount": "100.00",
"notifyUrl": "https://merchant.example.com/api/uugate/payin-notify",
})
if err != nil { panic(err) }
_ = order