Skip to content

Commit

Permalink
hbci4j 3.5.17, instant payment status support
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Geist committed Dec 3, 2019
1 parent b8f73a7 commit e183400
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,14 @@
@EqualsAndHashCode(callSuper = false)
public class PaymentStatusResponse extends AbstractResponse {

// 1: in Terminierung
//2: abgelehnt von erster Inkassostelle
//3: in Bearbeitung
//4: Creditoren-seitig verarbeitet, Buchung veranlasst
//5: R-Transaktion wurde veranlasst
//6: Auftrag fehlgeschagen
//7: Auftrag ausgeführt; Geld für den Zahlungsempfänger verfügbar
//8: Abgelehnt durch Zahlungsdienstleister des Zahlers
//9: Abgelehnt durch Zahlungsdienstleister des Zahlungsempfängers

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface OnlineBankingService {

LoadBalancesResponse loadBalances(TransactionRequest<LoadBalances> request);

PaymentResponse executePayment(TransactionRequest<AbstractPayment> paymentRequest);
PaymentResponse executePayment(TransactionRequest<? extends AbstractPayment> paymentRequest);

StrongCustomerAuthorisable getStrongCustomerAuthorisation();
}
2 changes: 1 addition & 1 deletion onlinebanking-hbci4java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependency>
<groupId>de.adorsys</groupId>
<artifactId>hbci4j-adorsys</artifactId>
<version>3.5.16</version>
<version>3.5.17</version>
</dependency>
<dependency>
<groupId>de.adorsys.multibanking</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public LoadBalancesResponse loadBalances(TransactionRequest<LoadBalances> reques
}

@Override
public PaymentResponse executePayment(TransactionRequest<AbstractPayment> request) {
public PaymentResponse executePayment(TransactionRequest<? extends AbstractPayment> request) {
HbciConsent hbciConsent = (HbciConsent) request.getBankApiConsentData();
try {
if (hbciConsent.getHbciTanSubmit() == null || hbciConsent.getStatus() == FINALISED) {
Expand All @@ -280,9 +280,9 @@ public PaymentResponse executePayment(TransactionRequest<AbstractPayment> reques

AbstractPaymentJob paymentJob = Optional.ofNullable(request.getTransaction())
.map(transaction -> (AbstractPaymentJob) createScaJob(request))
.orElse(new TanRequestJob(request));
.orElse(new TanRequestJob((TransactionRequest<TanRequest>)request));

PaymentResponse response = paymentJob.execute(hbciCallback);
PaymentResponse response = (PaymentResponse)paymentJob.execute(hbciCallback);
updateUpd(hbciCallback, response);

return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@

public abstract class AbstractPaymentJob<T extends AbstractPayment> extends ScaAwareJob<T, PaymentResponse> {

@Override
public PaymentResponse execute(HBCICallback hbciCallback) {
return super.execute(hbciCallback);
}

@Override
PaymentResponse createJobResponse(PinTanPassport passport, HbciTanSubmit tanSubmit,
List<HBCIMsgStatus> msgStatusList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.kapott.hbci.GV.AbstractSEPAGV;
import org.kapott.hbci.GV.GVMultiUebSEPA;
import org.kapott.hbci.GV.GVTermMultiUebSEPA;
import org.kapott.hbci.GV_Result.GVRTermUeb;
import org.kapott.hbci.GV_Result.GVRPayment;
import org.kapott.hbci.GV_Result.HBCIJobResult;
import org.kapott.hbci.passport.PinTanPassport;
import org.kapott.hbci.structures.Konto;
Expand Down Expand Up @@ -98,6 +98,6 @@ protected String getHbciJobName(AbstractTransaction.TransactionType transactionT

@Override
public String orderIdFromJobResult(HBCIJobResult paymentGV) {
return paymentGV instanceof GVRTermUeb ? ((GVRTermUeb) paymentGV).getOrderId() : null;
return paymentGV instanceof GVRPayment ? ((GVRPayment) paymentGV).getOrderId() : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
public class InstantPaymentStatusJob extends ScaAwareJob<PaymentStatusReqest, PaymentStatusResponse> {

private final TransactionRequest<PaymentStatusReqest> paymentStatusReqest;
private GVInstanstUebSEPAStatus paymentStatusHbciJob;

@Override
public AbstractHBCIJob createJobMessage(PinTanPassport passport) {
GVInstanstUebSEPAStatus paymentStatusHbciJob = new GVInstanstUebSEPAStatus(passport);
paymentStatusHbciJob = new GVInstanstUebSEPAStatus(passport);
paymentStatusHbciJob.setParam("my", getPsuKonto(passport));
paymentStatusHbciJob.setParam("orderid", paymentStatusReqest.getTransaction().getPaymentId());
return paymentStatusHbciJob;
Expand All @@ -57,6 +58,6 @@ String getHbciJobName(AbstractTransaction.TransactionType transactionType) {
@Override
public PaymentStatusResponse createJobResponse(PinTanPassport passport, HbciTanSubmit tanSubmit,
List<HBCIMsgStatus> msgStatusList) {
return null;
return new PaymentStatusResponse();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import lombok.extern.slf4j.Slf4j;
import org.kapott.hbci.GV.AbstractHBCIJob;
import org.kapott.hbci.GV.GVDauerSEPANew;
import org.kapott.hbci.GV_Result.GVRDauerNew;
import org.kapott.hbci.GV_Result.GVRPayment;
import org.kapott.hbci.GV_Result.HBCIJobResult;
import org.kapott.hbci.passport.PinTanPassport;
import org.kapott.hbci.structures.Konto;
Expand Down Expand Up @@ -98,6 +98,6 @@ protected String getHbciJobName(AbstractTransaction.TransactionType transactionT

@Override
public String orderIdFromJobResult(HBCIJobResult paymentGV) {
return ((GVRDauerNew) paymentGV).getOrderId();
return ((GVRPayment) paymentGV).getOrderId();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import de.adorsys.multibanking.domain.transaction.SinglePayment;
import lombok.RequiredArgsConstructor;
import org.kapott.hbci.GV.*;
import org.kapott.hbci.GV_Result.GVRTermUeb;
import org.kapott.hbci.GV_Result.GVRPayment;
import org.kapott.hbci.GV_Result.HBCIJobResult;
import org.kapott.hbci.passport.PinTanPassport;
import org.kapott.hbci.structures.Konto;
Expand Down Expand Up @@ -90,7 +90,7 @@ protected String getHbciJobName(AbstractTransaction.TransactionType transactionT

@Override
public String orderIdFromJobResult(HBCIJobResult paymentGV) {
return paymentGV instanceof GVRTermUeb ? ((GVRTermUeb) paymentGV).getOrderId() : null; // no order id for
return paymentGV instanceof GVRPayment ? ((GVRPayment) paymentGV).getOrderId() : null; // no order id for
// single payment
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import de.adorsys.multibanking.domain.request.TransactionRequest;
import de.adorsys.multibanking.domain.response.PaymentResponse;
import de.adorsys.multibanking.domain.transaction.AbstractPayment;
import de.adorsys.multibanking.domain.transaction.AbstractTransaction;
import de.adorsys.multibanking.domain.transaction.TanRequest;
import de.adorsys.multibanking.hbci.model.HbciTanSubmit;
import lombok.RequiredArgsConstructor;
import org.kapott.hbci.GV.AbstractHBCIJob;
Expand All @@ -30,12 +30,12 @@
import java.util.List;

@RequiredArgsConstructor
public class TanRequestJob extends AbstractPaymentJob<AbstractPayment> {
public class TanRequestJob extends AbstractPaymentJob<TanRequest> {

private final TransactionRequest<AbstractPayment> transactionRequest;
private final TransactionRequest<TanRequest> transactionRequest;

@Override
TransactionRequest<AbstractPayment> getTransactionRequest() {
TransactionRequest<TanRequest> getTransactionRequest() {
return transactionRequest;
}

Expand Down

0 comments on commit e183400

Please sign in to comment.