From e127be8589e344e65b58cbe294af80458fd0711e Mon Sep 17 00:00:00 2001 From: Przemyslaw Poznienski Date: Wed, 4 Feb 2026 15:27:56 +0100 Subject: [PATCH 1/3] [COREP-5265] extend customer info --- .../com/pensio/api/PensioMerchantAPI.java | 24 +++++++ .../com/pensio/api/request/CustomerInfo.java | 20 ++++++ .../com/pensio/api/request/DeviceInfo.java | 32 +++++++++ .../pensio/api/request/GeolocationInfo.java | 68 +++++++++++++++++++ 4 files changed, 144 insertions(+) create mode 100644 src/main/java/com/pensio/api/request/DeviceInfo.java create mode 100644 src/main/java/com/pensio/api/request/GeolocationInfo.java diff --git a/src/main/java/com/pensio/api/PensioMerchantAPI.java b/src/main/java/com/pensio/api/PensioMerchantAPI.java index 5727a6f..5555492 100644 --- a/src/main/java/com/pensio/api/PensioMerchantAPI.java +++ b/src/main/java/com/pensio/api/PensioMerchantAPI.java @@ -606,6 +606,30 @@ private void setCustomerInfo(HashMap params, CustomerInfo custom addParam(params, String.format("%s[shipping_postal]",groupTag), customerInfo.getShippingAddress().getPostal()); addParam(params, String.format("%s[shipping_region]",groupTag), customerInfo.getShippingAddress().getRegion()); } + if(customerInfo.getDeviceInfo() != null) + { + DeviceInfo deviceInfo = customerInfo.getDeviceInfo(); + addParam(params, String.format("%s[device_id]", groupTag), deviceInfo.getDeviceId()); + addParam(params, String.format("%s[device_type]", groupTag), deviceInfo.getDeviceType()); + addParam(params, String.format("%s[operating_system]", groupTag), deviceInfo.getOperatingSystem()); + } + if(customerInfo.getGeolocationInfo() != null) + { + GeolocationInfo geoInfo = customerInfo.getGeolocationInfo(); + addParam(params, String.format("%s[country_code]", groupTag), geoInfo.getCountryCode()); + addParam(params, String.format("%s[country_name]", groupTag), geoInfo.getCountryName()); + addParam(params, String.format("%s[state]", groupTag), geoInfo.getState()); + addParam(params, String.format("%s[city]", groupTag), geoInfo.getCity()); + addParam(params, String.format("%s[zip_code]", groupTag), geoInfo.getZipCode()); + if(geoInfo.getLatitude() != null) + { + addParam(params, String.format("%s[latitude]", groupTag), String.valueOf(geoInfo.getLatitude())); + } + if(geoInfo.getLongitude() != null) + { + addParam(params, String.format("%s[longitude]", groupTag), String.valueOf(geoInfo.getLongitude())); + } + } } private void addOrderLines(String prepend, HashMap params, List orderLines) diff --git a/src/main/java/com/pensio/api/request/CustomerInfo.java b/src/main/java/com/pensio/api/request/CustomerInfo.java index 476174c..0edcfaa 100644 --- a/src/main/java/com/pensio/api/request/CustomerInfo.java +++ b/src/main/java/com/pensio/api/request/CustomerInfo.java @@ -21,6 +21,8 @@ public class CustomerInfo private CustomerInfoAddress billingAddress; private CustomerInfoAddress shippingAddress; private BrowserData browserData; + private DeviceInfo deviceInfo; + private GeolocationInfo geolocationInfo; public String getOrganisationNumber() { @@ -180,4 +182,22 @@ public String getOrganisationVatId() { public void setOrganisationVatId(String organisationVatId) { this.organisationVatId = organisationVatId; } + + public DeviceInfo getDeviceInfo() { + return deviceInfo; + } + + public CustomerInfo setDeviceInfo(DeviceInfo deviceInfo) { + this.deviceInfo = deviceInfo; + return this; + } + + public GeolocationInfo getGeolocationInfo() { + return geolocationInfo; + } + + public CustomerInfo setGeolocationInfo(GeolocationInfo geolocationInfo) { + this.geolocationInfo = geolocationInfo; + return this; + } } diff --git a/src/main/java/com/pensio/api/request/DeviceInfo.java b/src/main/java/com/pensio/api/request/DeviceInfo.java new file mode 100644 index 0000000..0c2453b --- /dev/null +++ b/src/main/java/com/pensio/api/request/DeviceInfo.java @@ -0,0 +1,32 @@ +package com.pensio.api.request; + +public class DeviceInfo { + + private String deviceId; + private String deviceType; + private String operatingSystem; + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getOperatingSystem() { + return operatingSystem; + } + + public void setOperatingSystem(String operatingSystem) { + this.operatingSystem = operatingSystem; + } +} diff --git a/src/main/java/com/pensio/api/request/GeolocationInfo.java b/src/main/java/com/pensio/api/request/GeolocationInfo.java new file mode 100644 index 0000000..8ac9825 --- /dev/null +++ b/src/main/java/com/pensio/api/request/GeolocationInfo.java @@ -0,0 +1,68 @@ +package com.pensio.api.request; + +public class GeolocationInfo { + + private String countryCode; + private String countryName; + private String state; + private String city; + private String zipCode; + private Double latitude; + private Double longitude; + + public String getCountryCode() { + return countryCode; + } + + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + public String getCountryName() { + return countryName; + } + + public void setCountryName(String countryName) { + this.countryName = countryName; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getZipCode() { + return zipCode; + } + + public void setZipCode(String zipCode) { + this.zipCode = zipCode; + } + + public Double getLatitude() { + return latitude; + } + + public void setLatitude(Double latitude) { + this.latitude = latitude; + } + + public Double getLongitude() { + return longitude; + } + + public void setLongitude(Double longitude) { + this.longitude = longitude; + } +} From bec915fc76799e1495c0686413838eff0df4b132 Mon Sep 17 00:00:00 2001 From: Przemyslaw Poznienski Date: Thu, 5 Feb 2026 12:10:24 +0100 Subject: [PATCH 2/3] [COREP-5265] update changelog --- CHANGELOG.md | 3 +++ build.gradle | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e49734d..043e29a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All notable changes to this project will be documented in this file. +## [3.1.7] +- Added `DeviceInfo` and `GeolocationInfo` to `CustomerInfo` for enhanced customer data in API requests + ## [3.1.6] - Update values for `SessionStatus` diff --git a/build.gradle b/build.gradle index 58ebe56..a664723 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ plugins { } group = 'com.altapay' -version = '3.1.6' +version = '3.1.7' repositories { mavenCentral() From 93dfb2092f98d608de07cf5350decd6ed49e8dc1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Poznienski Date: Thu, 5 Feb 2026 12:27:53 +0100 Subject: [PATCH 3/3] [COREP-5265] update readme --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index d0109c9..00ba211 100644 --- a/readme.md +++ b/readme.md @@ -49,12 +49,12 @@ For integrating Java projects with the AltaPay gateway. com.altapay sdk-java - 3.1.6 + 3.1.7 ### Gradle - implementation 'com.altapay:sdk-java:3.1.6' + implementation 'com.altapay:sdk-java:3.1.7' ## Changelog