Skip to content

Commit a56329a

Browse files
Merge pull request #70 from AltaPay/COREP-5265-extend-requests-of-setup-session-with-new-parameters
[COREP-5265] extend customer info
2 parents 6d9d87f + 93dfb20 commit a56329a

7 files changed

Lines changed: 150 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [3.1.7]
5+
- Added `DeviceInfo` and `GeolocationInfo` to `CustomerInfo` for enhanced customer data in API requests
6+
47
## [3.1.6]
58
- Update values for `SessionStatus`
69

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
}
1010

1111
group = 'com.altapay'
12-
version = '3.1.6'
12+
version = '3.1.7'
1313

1414
repositories {
1515
mavenCentral()

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ For integrating Java projects with the AltaPay gateway.
4949
<dependency>
5050
<groupId>com.altapay</groupId>
5151
<artifactId>sdk-java</artifactId>
52-
<version>3.1.6</version>
52+
<version>3.1.7</version>
5353
</dependency>
5454
5555
### Gradle
5656
57-
implementation 'com.altapay:sdk-java:3.1.6'
57+
implementation 'com.altapay:sdk-java:3.1.7'
5858
5959
## Changelog
6060

src/main/java/com/pensio/api/PensioMerchantAPI.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,30 @@ private void setCustomerInfo(HashMap<String, String> params, CustomerInfo custom
606606
addParam(params, String.format("%s[shipping_postal]",groupTag), customerInfo.getShippingAddress().getPostal());
607607
addParam(params, String.format("%s[shipping_region]",groupTag), customerInfo.getShippingAddress().getRegion());
608608
}
609+
if(customerInfo.getDeviceInfo() != null)
610+
{
611+
DeviceInfo deviceInfo = customerInfo.getDeviceInfo();
612+
addParam(params, String.format("%s[device_id]", groupTag), deviceInfo.getDeviceId());
613+
addParam(params, String.format("%s[device_type]", groupTag), deviceInfo.getDeviceType());
614+
addParam(params, String.format("%s[operating_system]", groupTag), deviceInfo.getOperatingSystem());
615+
}
616+
if(customerInfo.getGeolocationInfo() != null)
617+
{
618+
GeolocationInfo geoInfo = customerInfo.getGeolocationInfo();
619+
addParam(params, String.format("%s[country_code]", groupTag), geoInfo.getCountryCode());
620+
addParam(params, String.format("%s[country_name]", groupTag), geoInfo.getCountryName());
621+
addParam(params, String.format("%s[state]", groupTag), geoInfo.getState());
622+
addParam(params, String.format("%s[city]", groupTag), geoInfo.getCity());
623+
addParam(params, String.format("%s[zip_code]", groupTag), geoInfo.getZipCode());
624+
if(geoInfo.getLatitude() != null)
625+
{
626+
addParam(params, String.format("%s[latitude]", groupTag), String.valueOf(geoInfo.getLatitude()));
627+
}
628+
if(geoInfo.getLongitude() != null)
629+
{
630+
addParam(params, String.format("%s[longitude]", groupTag), String.valueOf(geoInfo.getLongitude()));
631+
}
632+
}
609633
}
610634

611635
private void addOrderLines(String prepend, HashMap<String, String> params, List<OrderLine> orderLines)

src/main/java/com/pensio/api/request/CustomerInfo.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class CustomerInfo
2121
private CustomerInfoAddress billingAddress;
2222
private CustomerInfoAddress shippingAddress;
2323
private BrowserData browserData;
24+
private DeviceInfo deviceInfo;
25+
private GeolocationInfo geolocationInfo;
2426

2527
public String getOrganisationNumber()
2628
{
@@ -180,4 +182,22 @@ public String getOrganisationVatId() {
180182
public void setOrganisationVatId(String organisationVatId) {
181183
this.organisationVatId = organisationVatId;
182184
}
185+
186+
public DeviceInfo getDeviceInfo() {
187+
return deviceInfo;
188+
}
189+
190+
public CustomerInfo setDeviceInfo(DeviceInfo deviceInfo) {
191+
this.deviceInfo = deviceInfo;
192+
return this;
193+
}
194+
195+
public GeolocationInfo getGeolocationInfo() {
196+
return geolocationInfo;
197+
}
198+
199+
public CustomerInfo setGeolocationInfo(GeolocationInfo geolocationInfo) {
200+
this.geolocationInfo = geolocationInfo;
201+
return this;
202+
}
183203
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.pensio.api.request;
2+
3+
public class DeviceInfo {
4+
5+
private String deviceId;
6+
private String deviceType;
7+
private String operatingSystem;
8+
9+
public String getDeviceId() {
10+
return deviceId;
11+
}
12+
13+
public void setDeviceId(String deviceId) {
14+
this.deviceId = deviceId;
15+
}
16+
17+
public String getDeviceType() {
18+
return deviceType;
19+
}
20+
21+
public void setDeviceType(String deviceType) {
22+
this.deviceType = deviceType;
23+
}
24+
25+
public String getOperatingSystem() {
26+
return operatingSystem;
27+
}
28+
29+
public void setOperatingSystem(String operatingSystem) {
30+
this.operatingSystem = operatingSystem;
31+
}
32+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
package com.pensio.api.request;
2+
3+
public class GeolocationInfo {
4+
5+
private String countryCode;
6+
private String countryName;
7+
private String state;
8+
private String city;
9+
private String zipCode;
10+
private Double latitude;
11+
private Double longitude;
12+
13+
public String getCountryCode() {
14+
return countryCode;
15+
}
16+
17+
public void setCountryCode(String countryCode) {
18+
this.countryCode = countryCode;
19+
}
20+
21+
public String getCountryName() {
22+
return countryName;
23+
}
24+
25+
public void setCountryName(String countryName) {
26+
this.countryName = countryName;
27+
}
28+
29+
public String getState() {
30+
return state;
31+
}
32+
33+
public void setState(String state) {
34+
this.state = state;
35+
}
36+
37+
public String getCity() {
38+
return city;
39+
}
40+
41+
public void setCity(String city) {
42+
this.city = city;
43+
}
44+
45+
public String getZipCode() {
46+
return zipCode;
47+
}
48+
49+
public void setZipCode(String zipCode) {
50+
this.zipCode = zipCode;
51+
}
52+
53+
public Double getLatitude() {
54+
return latitude;
55+
}
56+
57+
public void setLatitude(Double latitude) {
58+
this.latitude = latitude;
59+
}
60+
61+
public Double getLongitude() {
62+
return longitude;
63+
}
64+
65+
public void setLongitude(Double longitude) {
66+
this.longitude = longitude;
67+
}
68+
}

0 commit comments

Comments
 (0)