Search in sources :

Example 1 with FRWriteDomesticDataInitiation

use of com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticDataInitiation in project openbanking-aspsp by OpenBankingToolkit.

the class DomesticPaymentsApiController method responseEntity.

private OBWriteDomesticResponse4 responseEntity(FRDomesticPaymentSubmission frPaymentSubmission, FRDomesticConsent frDomesticConsent) {
    FRReadRefundAccount readRefundAccount = frDomesticConsent.getDomesticConsent().getData().getReadRefundAccount();
    FRWriteDomesticDataInitiation initiation = frPaymentSubmission.getDomesticPayment().getData().getInitiation();
    Optional<FRDomesticResponseDataRefund> refund = frDomesticResponseDataRefund(readRefundAccount, initiation);
    return new OBWriteDomesticResponse4().data(new OBWriteDomesticResponse4Data().domesticPaymentId(frPaymentSubmission.getId()).initiation(toOBWriteDomestic2DataInitiation(frDomesticConsent.getDomesticConsent().getData().getInitiation())).creationDateTime(frDomesticConsent.getCreated()).statusUpdateDateTime(frDomesticConsent.getStatusUpdate()).status(toOBWriteDomesticResponse4DataStatus(frDomesticConsent.getStatus())).consentId(frDomesticConsent.getId()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteDomesticResponse4DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetDomesticPayment())).meta(new Meta());
}
Also used : OBWriteDomesticResponse4Data(uk.org.openbanking.datamodel.payment.OBWriteDomesticResponse4Data) Meta(uk.org.openbanking.datamodel.account.Meta) FRWriteDomesticDataInitiation(com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticDataInitiation) OBWriteDomesticResponse4(uk.org.openbanking.datamodel.payment.OBWriteDomesticResponse4) FRReadRefundAccount(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount) FRDomesticResponseDataRefund(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRDomesticResponseDataRefund)

Example 2 with FRWriteDomesticDataInitiation

use of com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticDataInitiation in project openbanking-aspsp by OpenBankingToolkit.

the class DomesticPaymentsApiController method responseEntity.

private OBWriteDomesticResponse5 responseEntity(FRDomesticPaymentSubmission frPaymentSubmission, FRDomesticConsent frDomesticConsent) {
    FRReadRefundAccount readRefundAccount = frDomesticConsent.getDomesticConsent().getData().getReadRefundAccount();
    FRWriteDomesticDataInitiation initiation = frPaymentSubmission.getDomesticPayment().getData().getInitiation();
    Optional<FRDomesticResponseDataRefund> refund = frDomesticResponseDataRefund(readRefundAccount, initiation);
    return new OBWriteDomesticResponse5().data(new OBWriteDomesticResponse5Data().domesticPaymentId(frPaymentSubmission.getId()).initiation(toOBWriteDomestic2DataInitiation(frDomesticConsent.getDomesticConsent().getData().getInitiation())).creationDateTime(frDomesticConsent.getCreated()).statusUpdateDateTime(frDomesticConsent.getStatusUpdate()).status(toOBWriteDomesticResponse5DataStatus(frDomesticConsent.getStatus())).consentId(frDomesticConsent.getId()).debtor(toOBCashAccountDebtor4(frDomesticConsent.getDomesticConsent().getData().getInitiation().getDebtorAccount())).refund(refund.map(FRResponseDataRefundConverter::toOBWriteDomesticResponse5DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetDomesticPayment())).meta(new Meta());
}
Also used : Meta(uk.org.openbanking.datamodel.account.Meta) FRWriteDomesticDataInitiation(com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticDataInitiation) OBWriteDomesticResponse5(uk.org.openbanking.datamodel.payment.OBWriteDomesticResponse5) OBWriteDomesticResponse5Data(uk.org.openbanking.datamodel.payment.OBWriteDomesticResponse5Data) FRReadRefundAccount(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount) FRDomesticResponseDataRefund(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRDomesticResponseDataRefund)

Aggregations

FRWriteDomesticDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticDataInitiation)2 FRDomesticResponseDataRefund (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRDomesticResponseDataRefund)2 FRReadRefundAccount (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount)2 Meta (uk.org.openbanking.datamodel.account.Meta)2 OBWriteDomesticResponse4 (uk.org.openbanking.datamodel.payment.OBWriteDomesticResponse4)1 OBWriteDomesticResponse4Data (uk.org.openbanking.datamodel.payment.OBWriteDomesticResponse4Data)1 OBWriteDomesticResponse5 (uk.org.openbanking.datamodel.payment.OBWriteDomesticResponse5)1 OBWriteDomesticResponse5Data (uk.org.openbanking.datamodel.payment.OBWriteDomesticResponse5Data)1