Install and configure the official UQPAY Java SDK to integrate payment, banking, and card issuance APIs.
The UQPAY Java SDK provides typed access to the UQPAY API, including automatic OAuth2 authentication, webhook verification, PGP-based authorization decision, and a sandbox simulator.
GitHub
com.uqpay.sdk:uqpay-sdk-java
The SDK requires Java 11 or higher, with Maven 3.6+ or Gradle 7+.
The SDK handles OAuth2 authentication automatically. It fetches an access token using your clientId and apiKey, caches it, and refreshes it before expiry. You do not need to manage tokens manually.
All list methods return a paginated response with getData(), getTotalPages(), and getTotalItems():
ListCardsRequest req = new ListCardsRequest();req.setPageNumber(1);req.setPageSize(50);ListCardsResponse page = client.issuing().getCards().list(req);System.out.println(page.getData()); // List<Card>System.out.println(page.getTotalPages()); // total number of pagesSystem.out.println(page.getTotalItems()); // total number of items
Handle real-time card transaction authorization decisions. UQPAY sends PGP-encrypted transactions to your endpoint; the SDK decrypts them, calls your handler, and returns an encrypted response.
import com.uqpay.sdk.v2.issuing.AuthDecisionService;import com.uqpay.sdk.v2.issuing.model.AuthDecisionConfig;import com.uqpay.sdk.v2.issuing.model.AuthDecisionRequest;import com.uqpay.sdk.v2.issuing.model.AuthDecisionResponse;// Configure PGP keys (once at startup)AuthDecisionConfig config = new AuthDecisionConfig( "./keys/my-private.asc", System.getenv("PGP_PASSPHRASE"), "./keys/uqpay-public.asc");AuthDecisionService authDecision = client.issuing().getAuthDecision();authDecision.configure(config);// Handle a decision requestAuthDecisionHandler handler = (AuthDecisionRequest tx) -> { if (tx.getBillingAmount() > 10000) { return AuthDecisionResponse.decline(tx.getTransactionId(), "51"); } return AuthDecisionResponse.approve(tx.getTransactionId());};// In your HTTP handler, pass the raw encrypted body string:String encryptedResponse = authDecision.processRequest(requestBodyString, handler);response.getWriter().write(encryptedResponse);