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.8]
- Updated `APIResponse.xsd` to include `DeviceId`, replaced `DeviceInfo` and `GeolocationInfo` in `CustomerInfo` with `DeviceId` retrieved from `BrowserData`

## [3.1.8]
- Updated `APIResponse.xsd` to include `DeviceInfo` and `GeolocationInfo`

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.8'
version = '3.1.9'

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.8</version>
<version>3.1.9</version>
</dependency>

### Gradle

implementation 'com.altapay:sdk-java:3.1.8'
implementation 'com.altapay:sdk-java:3.1.9'

## Changelog

Expand Down
25 changes: 1 addition & 24 deletions src/main/java/com/pensio/api/PensioMerchantAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -606,30 +606,7 @@ 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()));
}
}
addParam(params, String.format("%s[device_id]", groupTag), customerInfo.getDeviceId());
}

private void addOrderLines(String prepend, HashMap<String, String> params, List<OrderLine> orderLines)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/pensio/api/PensioProcessorAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ public void addCustomerInfoParams(PaymentReservationRequest paymentRequest, Hash
addParam(params, "customer_info[billing_postal]", billingAddress.getPostal());
addParam(params, "customer_info[billing_country]", billingAddress.getCountry());

addParam(params, "customer_info[device_id]", customerInfo.getDeviceId());

BrowserData browserData = customerInfo.getBrowserData();
addParam(params, "customer_info[client_time_zone]", browserData.getTimeZone());
addParam(params, "customer_info[client_javascript_enabled]", browserData.getJavascriptEnabled());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/pensio/api/request/BrowserData.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class BrowserData {
private String userAgent;
private String accept;
private String acceptLanguage;

public String getTimeZone() {
return timeZone;
}
Expand Down Expand Up @@ -92,4 +91,5 @@ public String getAcceptLanguage() {
public void setAcceptLanguage(String acceptLanguage) {
this.acceptLanguage = acceptLanguage;
}

}
26 changes: 8 additions & 18 deletions src/main/java/com/pensio/api/request/CustomerInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public class CustomerInfo
private CustomerInfoAddress billingAddress;
private CustomerInfoAddress shippingAddress;
private BrowserData browserData;
private DeviceInfo deviceInfo;
private GeolocationInfo geolocationInfo;
private String deviceId;

public String getOrganisationNumber()
{
Expand Down Expand Up @@ -183,21 +182,12 @@ 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 String getDeviceId() {
return deviceId;
}

public CustomerInfo setGeolocationInfo(GeolocationInfo geolocationInfo) {
this.geolocationInfo = geolocationInfo;
return this;
}
public CustomerInfo setDeviceId(String deviceId) {
this.deviceId = deviceId;
return this;
}
}
32 changes: 0 additions & 32 deletions src/main/java/com/pensio/api/request/DeviceInfo.java

This file was deleted.

68 changes: 0 additions & 68 deletions src/main/java/com/pensio/api/request/GeolocationInfo.java

This file was deleted.

21 changes: 0 additions & 21 deletions src/main/resources/xsd/APIResponse.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -721,28 +721,7 @@
<xs:element name="BillingAddress" type="CustomerInfoAddress" maxOccurs="1" minOccurs="0"/>
<xs:element name="ShippingAddress" type="CustomerInfoAddress" maxOccurs="1" minOccurs="0"/>
<xs:element name="RegisteredAddress" type="CustomerInfoAddress" maxOccurs="1" minOccurs="0"/>
<xs:element name="DeviceInfo" type="DeviceInfo" maxOccurs="1" minOccurs="0"/>
<xs:element name="GeolocationInfo" type="GeolocationInfo" maxOccurs="1" minOccurs="0"/>
</xs:all>
</xs:complexType>

<xs:complexType name="DeviceInfo">
<xs:all>
<xs:element name="DeviceId" type="xs:string" maxOccurs="1" minOccurs="0"/>
<xs:element name="DeviceType" type="xs:string" maxOccurs="1" minOccurs="0"/>
<xs:element name="OperatingSystem" type="xs:string" maxOccurs="1" minOccurs="0"/>
</xs:all>
</xs:complexType>

<xs:complexType name="GeolocationInfo">
<xs:all>
<xs:element name="CountryCode" type="xs:string" maxOccurs="1" minOccurs="0"/>
<xs:element name="CountryName" type="xs:string" maxOccurs="1" minOccurs="0"/>
<xs:element name="State" type="xs:string" maxOccurs="1" minOccurs="0"/>
<xs:element name="City" type="xs:string" maxOccurs="1" minOccurs="0"/>
<xs:element name="ZipCode" type="xs:string" maxOccurs="1" minOccurs="0"/>
<xs:element name="Latitude" type="xs:double" maxOccurs="1" minOccurs="0"/>
<xs:element name="Longitude" type="xs:double" maxOccurs="1" minOccurs="0"/>
</xs:all>
</xs:complexType>

Expand Down