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:
TheURL_Notifymust use HTTPS (e.g., start withhttps://). Unsecured URLs will be rejected, and transactions may be reversed. -
HTTP Response:
When receiving an HTTP request, your server must respond with headerHTTP 200 OKand body contentOK. 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:
-
Save your keys:
Save the private key and API certificate as files (e.g.,privateKey.pemandapiCertificate.pem). -
Open a terminal:
Navigate to the directory containing your key files. -
Convert the private key:
openssl pkcs8 -topk8 -inform PEM -outform PEM -in privateKey.pem -out privateKey_converted.pem -nocrypt -
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.
Quick Links
Explore the sections above for detailed guides, sample code, and advanced configuration options.