Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = 'com.altapay'
version = '3.1.6'
version = '3.1.7'

repositories {
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ For integrating Java projects with the AltaPay gateway.
<dependency>
<groupId>com.altapay</groupId>
<artifactId>sdk-java</artifactId>
<version>3.1.6</version>
<version>3.1.7</version>
</dependency>

### Gradle

implementation 'com.altapay:sdk-java:3.1.6'
implementation 'com.altapay:sdk-java:3.1.7'

## Changelog

Expand Down
24 changes: 24 additions & 0 deletions src/main/java/com/pensio/api/PensioMerchantAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,30 @@ private void setCustomerInfo(HashMap<String, String> 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<String, String> params, List<OrderLine> orderLines)
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/pensio/api/request/CustomerInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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;
}
}
32 changes: 32 additions & 0 deletions src/main/java/com/pensio/api/request/DeviceInfo.java
Original file line number Diff line number Diff line change
@@ -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;
}
}
68 changes: 68 additions & 0 deletions src/main/java/com/pensio/api/request/GeolocationInfo.java
Original file line number Diff line number Diff line change
@@ -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;
}
}