Java SDK

Welcome to the Java SDK documentation! Here you'll find everything you need to get started, including installation steps, configuration options, code samples, and advanced settings.

Requirements

  • Public IP Address:
    All requests must be sent from a public IP address.

  • Secure Notification URL:
    The URL_Notify must use HTTPS (e.g., start with https://). Unsecured URLs will be rejected, and transactions may be reversed.

  • HTTP Response:
    When receiving an HTTP request, your server must respond with header HTTP 200 OK and body content OK. Any other response will be treated as an error.

SSL Key Conversion

The SSL keys provided by myPOS are not directly compatible with the Java SDK. You need to convert them using the OpenSSL toolkit:

  1. Save your keys:
    Save the private key and API certificate as files (e.g., privateKey.pem and apiCertificate.pem).

  2. Open a terminal:
    Navigate to the directory containing your key files.

  3. Convert the private key:

    openssl pkcs8 -topk8 -inform PEM -outform PEM -in privateKey.pem -out privateKey_converted.pem -nocrypt
    
  4. Extract the public key:

    openssl x509 -pubkey -noout -in apiCertificate.pem > publicKey.pem
    

Note: Ensure there are no extra lines or spaces before or after the ----- in your certificate files.

JSON Support

If you plan to use JSON for communication, add the Jackson library as a dependency in your project.

Explore the sections above for detailed guides, sample code, and advanced configuration options.