diff --git a/CHANGELOG.md b/CHANGELOG.md index 60b496dc..26f03214 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Deprecated + +* Deprecated PIS / Unzer Bank Transfer payment type (`com.unzer.payment.paymenttypes.Pis`) + and the corresponding `PaymentTypeEnum.PIS` constant. This does **not** affect the separate + Open Banking payment type (`com.unzer.payment.paymenttypes.OpenBanking` / + `PaymentTypeEnum.OPEN_BANKING`), which remains fully supported. + ## [5.9.0](https://github.com/unzerdev/java-sdk/compare/5.8.2..5.9.0) ### Added diff --git a/src/main/java/com/unzer/payment/paymenttypes/PaymentTypeEnum.java b/src/main/java/com/unzer/payment/paymenttypes/PaymentTypeEnum.java index 641eaf86..504a1769 100644 --- a/src/main/java/com/unzer/payment/paymenttypes/PaymentTypeEnum.java +++ b/src/main/java/com/unzer/payment/paymenttypes/PaymentTypeEnum.java @@ -26,6 +26,7 @@ public enum PaymentTypeEnum { @Deprecated SEPA_DIRECT_DEBIT_SECURED("dds"), SOFORT("sft"), + @Deprecated PIS("pis"), ALIPAY("ali"), WECHATPAY("wcp"), diff --git a/src/main/java/com/unzer/payment/paymenttypes/Pis.java b/src/main/java/com/unzer/payment/paymenttypes/Pis.java index 710afeab..3f6e15ec 100644 --- a/src/main/java/com/unzer/payment/paymenttypes/Pis.java +++ b/src/main/java/com/unzer/payment/paymenttypes/Pis.java @@ -12,10 +12,12 @@ import java.util.Currency; /** - * Paypal business object + * Pis business object * * @author Unzer E-Com GmbH + * @deprecated PIS (Unzer Bank Transfer) payment type is no longer supported and will be removed in a future version. */ +@Deprecated public class Pis extends BasePaymentType { private String iban; diff --git a/src/test/java/com/unzer/payment/integration/paymenttypes/PisTest.java b/src/test/java/com/unzer/payment/integration/paymenttypes/PisTest.java deleted file mode 100644 index 5271461c..00000000 --- a/src/test/java/com/unzer/payment/integration/paymenttypes/PisTest.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.unzer.payment.integration.paymenttypes; - - -import com.unzer.payment.Charge; -import com.unzer.payment.Unzer; -import com.unzer.payment.business.AbstractPaymentTest; -import com.unzer.payment.paymenttypes.Pis; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.math.BigDecimal; -import java.util.Currency; - -import static com.unzer.payment.util.Types.unsafeUrl; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -class PisTest extends AbstractPaymentTest { - - @Test - void testCreatePis() { - Pis pis = new Pis(); - pis = getUnzer().createPaymentType(pis); - assertNotNull(pis.getId()); - } - - @Test - void testCreatePisWithIbanBic() { - Pis pis = new Pis("DE69545100670661762678", "SPFKAT2BXXX"); - pis = getUnzer().createPaymentType(pis); - assertNotNull(pis.getId()); - assertNotNull(pis.getIban()); - assertNotNull(pis.getBic()); - - Pis fetchedPis = (Pis) getUnzer().fetchPaymentType(pis.getId()); - assertNotNull(fetchedPis.getId()); - assertNotNull(fetchedPis.getIban()); - assertNotNull(fetchedPis.getBic()); - } - - @Test - @Disabled("Unspecified (Technical)") - public void testAuthorizeType() { - Unzer unzer = getUnzer(); - Pis pis = unzer.createPaymentType(new Pis()); - Charge charge = unzer.charge( - BigDecimal.ONE, - Currency.getInstance("EUR"), - pis.getId(), - unsafeUrl("https://www.meinShop.de") - ); - assertNotNull(charge); - assertNotNull(charge.getId()); - assertNotNull(charge.getRedirectUrl()); - } - - @Test - void testFetchPisType() { - Pis pis = getUnzer().createPaymentType(new Pis()); - assertNotNull(pis.getId()); - Pis fetchedPis = (Pis) getUnzer().fetchPaymentType(pis.getId()); - assertNotNull(fetchedPis.getId()); - } - - @Test - @Disabled("AHC-3615 PIS holder not in response when doing a POST/GET") - public void testFetchPisTypeWithHolderBicIban() { - Pis fetchedPis = (Pis) getUnzer().fetchPaymentType("s-pis-ivt4ibypi0zk"); - assertNotNull(fetchedPis.getId()); - assertNotNull(fetchedPis.getIban()); - assertNotNull(fetchedPis.getBic()); - assertNotNull(fetchedPis.getHolder()); - } -} diff --git a/src/test/java/com/unzer/payment/integration/paymenttypes/SofortTest.java b/src/test/java/com/unzer/payment/integration/paymenttypes/SofortTest.java deleted file mode 100644 index f1e3d809..00000000 --- a/src/test/java/com/unzer/payment/integration/paymenttypes/SofortTest.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.unzer.payment.integration.paymenttypes; - - -import com.unzer.payment.Charge; -import com.unzer.payment.business.AbstractPaymentTest; -import com.unzer.payment.paymenttypes.Sofort; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -import java.math.BigDecimal; -import java.util.Currency; - -import static com.unzer.payment.util.Types.unsafeUrl; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -class SofortTest extends AbstractPaymentTest { - - @Test - void testCreateSofortManatoryType() { - Sofort sofort = new Sofort(); - sofort = getUnzer().createPaymentType(sofort); - assertNotNull(sofort.getId()); - } - - @Test - @Disabled("does not work on PAPI") - public void testChargeSofortType() { - Sofort sofort = getUnzer().createPaymentType(new Sofort()); - Charge charge = sofort.charge(BigDecimal.ONE, Currency.getInstance("EUR"), unsafeUrl("https://www.unzer.com")); - assertNotNull(charge); - assertNotNull(charge.getId()); - assertNotNull(charge.getRedirectUrl()); - } - - @Test - void testFetchSofortType() { - Sofort sofort = getUnzer().createPaymentType(new Sofort()); - assertNotNull(sofort.getId()); - Sofort fetchedSofort = (Sofort) getUnzer().fetchPaymentType(sofort.getId()); - assertNotNull(fetchedSofort.getId()); - } -} diff --git a/src/test/resources/junit-platform.properties b/src/test/resources/junit-platform.properties index 07bf940e..b1329fb9 100644 --- a/src/test/resources/junit-platform.properties +++ b/src/test/resources/junit-platform.properties @@ -1,2 +1,5 @@ junit.jupiter.execution.parallel.enabled=true -junit.jupiter.execution.parallel.mode.default=concurrent \ No newline at end of file +# Test classes must not run concurrently: 12 of them share a WireMock server on the +# fixed port 8080 (@WireMockTest(httpPort = 8080)), so concurrent classes race to bind +# it and all but the first fail with "Failed to bind to /0.0.0.0:8080". +junit.jupiter.execution.parallel.mode.default=same_thread