Go SDK
Cliente Go de biblioteca padrão com quatro métodos API, assinatura, verificação de callbacks e exemplo de consulta somente leitura.
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/basicExemplo 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) }
_ = orderDownload ZIP
Baixar Go SDK ZIPuugate-go-sdk.zip