From 34f86bdc34960056421b62b19d7413f680be78a1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Poznienski Date: Fri, 12 Jun 2026 12:43:36 +0200 Subject: [PATCH 1/2] [COREP-5148] expose CardType --- CHANGELOG.md | 3 ++ build.gradle | 2 +- readme.md | 4 +-- src/main/resources/xsd/APIResponse.xsd | 9 ++++++ ...hantApi_ParsePostBackXmlResponseTests.java | 28 +++++++++++++++++++ 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a90e9af..ae8b703 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.17] +- Added optional `Type` element (`CardType`: `CREDIT`, `DEBIT`, `CHARGE_CARD`) to `CardInformation` in API responses, exposing the card type derived from the BIN interchange group. + ## [3.1.16] - Added identifier attribute on `MethodConfig` in `/getTerminals`. Fix content of `MethodConfig` to support different configuration (unbounded), based on the gateway response. diff --git a/build.gradle b/build.gradle index c19fec3..d73b3a8 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ plugins { } group = 'com.altapay' -version = '3.1.16' +version = '3.1.17' repositories { mavenCentral() diff --git a/readme.md b/readme.md index f7d4193..205ad8d 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.16 + 3.1.17 ### Gradle - implementation 'com.altapay:sdk-java:3.1.16' + implementation 'com.altapay:sdk-java:3.1.17' ## Changelog diff --git a/src/main/resources/xsd/APIResponse.xsd b/src/main/resources/xsd/APIResponse.xsd index b0075d9..5590c77 100644 --- a/src/main/resources/xsd/APIResponse.xsd +++ b/src/main/resources/xsd/APIResponse.xsd @@ -806,6 +806,14 @@ + + + + + + + + @@ -833,6 +841,7 @@ + diff --git a/src/test/java/com/pensio/api/MerchantApi_ParsePostBackXmlResponseTests.java b/src/test/java/com/pensio/api/MerchantApi_ParsePostBackXmlResponseTests.java index 6a91919..861fe2a 100644 --- a/src/test/java/com/pensio/api/MerchantApi_ParsePostBackXmlResponseTests.java +++ b/src/test/java/com/pensio/api/MerchantApi_ParsePostBackXmlResponseTests.java @@ -80,4 +80,32 @@ void ParsePostBackXmlResponse_ReadECommerceWithout3dSecurePaymentSource() throws APIResponse response = api.parsePostBackXMLParameter(xmlResponse); Assertions.assertEquals("eCommerce_without3ds", response.getBody().getTransactions().getTransaction().get(0).getPaymentSource()); } + + @Test + void parseCardInformationType_credit() throws PensioAPIException, IOException, URISyntaxException { + String xmlResponse = readFile("com/pensio/api/txt/CardTypeCredit.xml"); + APIResponse response = api.parsePostBackXMLParameter(xmlResponse); + + com.pensio.api.generated.CardType type = response.getBody() + .getTransactions() + .getTransaction() + .get(0) + .getCardInformation() + .getType(); + Assertions.assertEquals(com.pensio.api.generated.CardType.CREDIT, type); + } + + @Test + void parseCardInformationType_absentReturnsNull() throws PensioAPIException, IOException, URISyntaxException { + String xmlResponse = readFile("com/pensio/api/txt/CardInformationNoType.xml"); + APIResponse response = api.parsePostBackXMLParameter(xmlResponse); + + com.pensio.api.generated.CardType type = response.getBody() + .getTransactions() + .getTransaction() + .get(0) + .getCardInformation() + .getType(); + Assertions.assertNull(type); + } } From 864f175cf5fce9fb7a497620fd3786f4e4e310b2 Mon Sep 17 00:00:00 2001 From: Przemyslaw Poznienski Date: Mon, 15 Jun 2026 14:06:02 +0200 Subject: [PATCH 2/2] [COREP-5148] fix --- .../pensio/api/txt/CardInformationNoType.xml | 113 +++++++++++++++++ .../com/pensio/api/txt/CardTypeCredit.xml | 114 ++++++++++++++++++ 2 files changed, 227 insertions(+) create mode 100644 src/test/resources/com/pensio/api/txt/CardInformationNoType.xml create mode 100644 src/test/resources/com/pensio/api/txt/CardTypeCredit.xml diff --git a/src/test/resources/com/pensio/api/txt/CardInformationNoType.xml b/src/test/resources/com/pensio/api/txt/CardInformationNoType.xml new file mode 100644 index 0000000..7b009d1 --- /dev/null +++ b/src/test/resources/com/pensio/api/txt/CardInformationNoType.xml @@ -0,0 +1,113 @@ + + +
+ 2017-07-05T11:50:45+02:00 + API/reservationOfFixedAmount3DSecureVerification + 0 + +
+ + Failed + TestAcquirer[pan=0466 or amount=4660] + Card Declined + true + + + 20341981 + 17794956-9bb6-4854-9712-bce5931e6e3a + paymentAndCapture + Expired + + 2017 + 01 + + 2685df5ccacc32330848ba7626d329a166585996 + 414000******0466 + false + + false + 2685df5ccacc32330848ba7626d329a166585996 + 414000******0466 + + 2017 + 1 + + GB + 0466 + Visa + + Not_Attempted + Merchant + Not_Attempted + 61c62b85fb8ed03518c524891a92cd515cb64c32 + 1bf7ddd2-d335-42c6-b5ab-0a6f4faff22d + Caxton FX + Caxton FX Test Terminal + 3dsecure_failed + NONE + 826 + GBP + 826 + GBP + 0.00 + 0.00 + 0.00 + 0.00 + 0.00 + 0.00 + 2017-07-05 11:50:41 + 2017-07-05 11:50:45 + CreditCard + Visa + + true + true + true + true + + P + Postal codes match for international transaction. Street address not verified due to incompatible formats + + + + Mozilla/5.0 + 31.221.7.34 + + + + + + + + + + GB + BillingAddress + + + + + + + + +
+ +
+ + + + + + + + + + +
+
+ +
+
+ +
diff --git a/src/test/resources/com/pensio/api/txt/CardTypeCredit.xml b/src/test/resources/com/pensio/api/txt/CardTypeCredit.xml new file mode 100644 index 0000000..915f34d --- /dev/null +++ b/src/test/resources/com/pensio/api/txt/CardTypeCredit.xml @@ -0,0 +1,114 @@ + + +
+ 2017-07-05T11:50:45+02:00 + API/reservationOfFixedAmount3DSecureVerification + 0 + +
+ + Failed + TestAcquirer[pan=0466 or amount=4660] + Card Declined + true + + + 20341981 + 17794956-9bb6-4854-9712-bce5931e6e3a + paymentAndCapture + Expired + + 2017 + 01 + + 2685df5ccacc32330848ba7626d329a166585996 + 414000******0466 + false + + false + 2685df5ccacc32330848ba7626d329a166585996 + 414000******0466 + + 2017 + 1 + + GB + 0466 + Visa + CREDIT + + Not_Attempted + Merchant + Not_Attempted + 61c62b85fb8ed03518c524891a92cd515cb64c32 + 1bf7ddd2-d335-42c6-b5ab-0a6f4faff22d + Caxton FX + Caxton FX Test Terminal + 3dsecure_failed + NONE + 826 + GBP + 826 + GBP + 0.00 + 0.00 + 0.00 + 0.00 + 0.00 + 0.00 + 2017-07-05 11:50:41 + 2017-07-05 11:50:45 + CreditCard + Visa + + true + true + true + true + + P + Postal codes match for international transaction. Street address not verified due to incompatible formats + + + + Mozilla/5.0 + 31.221.7.34 + + + + + + + + + + GB + BillingAddress + + + + + + + + +
+ +
+ + + + + + + + + + +
+
+ +
+
+ +