Search in sources :

Example 1 with FRReadRefundAccount

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

the class DomesticScheduledPaymentsApiController method responseEntity.

private OBWriteDomesticScheduledResponse4 responseEntity(FRDomesticScheduledPaymentSubmission frPaymentSubmission, FRDomesticScheduledConsent frDomesticScheduledConsent) {
    FRReadRefundAccount readRefundAccount = frDomesticScheduledConsent.getDomesticScheduledConsent().getData().getReadRefundAccount();
    FRWriteDomesticScheduledDataInitiation initiation = frPaymentSubmission.getDomesticScheduledPayment().getData().getInitiation();
    Optional<FRDomesticResponseDataRefund> refund = frDomesticResponseDataRefund(readRefundAccount, initiation);
    return new OBWriteDomesticScheduledResponse4().data(new OBWriteDomesticScheduledResponse4Data().domesticScheduledPaymentId(frPaymentSubmission.getId()).initiation(toOBWriteDomesticScheduled2DataInitiation(frDomesticScheduledConsent.getInitiation())).creationDateTime(frDomesticScheduledConsent.getCreated()).statusUpdateDateTime(frDomesticScheduledConsent.getStatusUpdate()).status(toOBWriteDomesticScheduledResponse4DataStatus(frDomesticScheduledConsent.getStatus())).consentId(frDomesticScheduledConsent.getId()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteDomesticResponse4DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetDomesticScheduledPayment())).meta(new Meta());
}
Also used : OBWriteDomesticScheduledResponse4Data(uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse4Data) Meta(uk.org.openbanking.datamodel.account.Meta) FRWriteDomesticScheduledDataInitiation(com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticScheduledDataInitiation) FRReadRefundAccount(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount) OBWriteDomesticScheduledResponse4(uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse4) FRDomesticResponseDataRefund(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRDomesticResponseDataRefund)

Example 2 with FRReadRefundAccount

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

the class InternationalPaymentsApiController method responseEntity.

private OBWriteInternationalResponse5 responseEntity(FRInternationalPaymentSubmission frPaymentSubmission, FRInternationalConsent frInternationalConsent) {
    FRReadRefundAccount readRefundAccount = frInternationalConsent.getInternationalConsent().getData().getReadRefundAccount();
    FRWriteInternationalDataInitiation initiation = frPaymentSubmission.getInternationalPayment().getData().getInitiation();
    Optional<FRInternationalResponseDataRefund> refund = frInternationalResponseDataRefund(readRefundAccount, initiation);
    return new OBWriteInternationalResponse5().data(new OBWriteInternationalResponse5Data().internationalPaymentId(frPaymentSubmission.getId()).initiation(toOBWriteInternational3DataInitiation(frPaymentSubmission.getInternationalPayment().getData().getInitiation())).creationDateTime(frInternationalConsent.getCreated()).statusUpdateDateTime(frInternationalConsent.getStatusUpdate()).status(toOBWriteInternationalResponse5DataStatus(frInternationalConsent.getStatus())).consentId(frInternationalConsent.getId()).debtor(toOBCashAccountDebtor4(frInternationalConsent.getInitiation().getDebtorAccount())).exchangeRateInformation(toOBWriteInternationalConsentResponse6DataExchangeRateInformation(frInternationalConsent.getCalculatedExchangeRate())).refund(refund.map(FRResponseDataRefundConverter::toOBWriteInternationalResponse5DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetInternationalPayment())).meta(new Meta());
}
Also used : Meta(uk.org.openbanking.datamodel.account.Meta) OBWriteInternationalResponse5(uk.org.openbanking.datamodel.payment.OBWriteInternationalResponse5) FRReadRefundAccount(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount) FRInternationalResponseDataRefund(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRInternationalResponseDataRefund) FRWriteInternationalDataInitiation(com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalDataInitiation) OBWriteInternationalResponse5Data(uk.org.openbanking.datamodel.payment.OBWriteInternationalResponse5Data)

Example 3 with FRReadRefundAccount

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

the class InternationalScheduledPaymentsApiController method responseEntity.

private OBWriteInternationalScheduledResponse6 responseEntity(FRInternationalScheduledPaymentSubmission frPaymentSubmission, FRInternationalScheduledConsent frInternationalScheduledConsent) {
    FRReadRefundAccount readRefundAccount = frInternationalScheduledConsent.getInternationalScheduledConsent().getData().getReadRefundAccount();
    FRWriteInternationalScheduledDataInitiation initiation = frPaymentSubmission.getInternationalScheduledPayment().getData().getInitiation();
    Optional<FRInternationalResponseDataRefund> refund = frInternationalResponseDataRefund(readRefundAccount, initiation);
    return new OBWriteInternationalScheduledResponse6().data(new OBWriteInternationalScheduledResponse6Data().internationalScheduledPaymentId(frPaymentSubmission.getId()).initiation(toOBWriteInternationalScheduled3DataInitiation(frPaymentSubmission.getInternationalScheduledPayment().getData().getInitiation())).creationDateTime(frInternationalScheduledConsent.getCreated()).statusUpdateDateTime(frInternationalScheduledConsent.getStatusUpdate()).consentId(frInternationalScheduledConsent.getId()).status(toOBWriteInternationalScheduledResponse6DataStatus(frInternationalScheduledConsent.getStatus())).exchangeRateInformation(toOBWriteInternationalConsentResponse6DataExchangeRateInformation(frInternationalScheduledConsent.getCalculatedExchangeRate())).debtor(toOBCashAccountDebtor4(frInternationalScheduledConsent.getInitiation().getDebtorAccount())).expectedExecutionDateTime(frInternationalScheduledConsent.getInitiation().getRequestedExecutionDateTime()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteInternationalResponse5DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetInternationalScheduledPayment())).meta(new Meta());
}
Also used : Meta(uk.org.openbanking.datamodel.account.Meta) OBWriteInternationalScheduledResponse6Data(uk.org.openbanking.datamodel.payment.OBWriteInternationalScheduledResponse6Data) FRWriteInternationalScheduledDataInitiation(com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalScheduledDataInitiation) FRReadRefundAccount(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount) FRInternationalResponseDataRefund(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRInternationalResponseDataRefund) OBWriteInternationalScheduledResponse6(uk.org.openbanking.datamodel.payment.OBWriteInternationalScheduledResponse6)

Example 4 with FRReadRefundAccount

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

the class InternationalStandingOrdersApiController method responseEntity.

private OBWriteInternationalStandingOrderResponse7 responseEntity(FRInternationalStandingOrderPaymentSubmission frPaymentSubmission, FRInternationalStandingOrderConsent frInternationalStandingOrderConsent) {
    FRReadRefundAccount readRefundAccount = frInternationalStandingOrderConsent.getInternationalStandingOrderConsent().getData().getReadRefundAccount();
    FRWriteInternationalStandingOrderDataInitiation initiation = frPaymentSubmission.getInternationalStandingOrder().getData().getInitiation();
    Optional<FRInternationalResponseDataRefund> refund = frInternationalResponseDataRefund(readRefundAccount, initiation);
    return new OBWriteInternationalStandingOrderResponse7().data(new OBWriteInternationalStandingOrderResponse7Data().internationalStandingOrderId(frPaymentSubmission.getId()).initiation(toOBWriteInternationalStandingOrderConsentResponse7DataInitiation(frPaymentSubmission.getInternationalStandingOrder().getData().getInitiation())).creationDateTime(frInternationalStandingOrderConsent.getCreated()).statusUpdateDateTime(frInternationalStandingOrderConsent.getStatusUpdate()).status(toOBWriteInternationalStandingOrderResponse7DataStatus(frInternationalStandingOrderConsent.getStatus())).debtor(toOBCashAccountDebtor4(frInternationalStandingOrderConsent.getInitiation().getDebtorAccount())).consentId(frInternationalStandingOrderConsent.getId()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteInternationalStandingOrderResponse7DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetInternationalStandingOrder())).meta(new Meta());
}
Also used : Meta(uk.org.openbanking.datamodel.account.Meta) OBWriteInternationalStandingOrderResponse7(uk.org.openbanking.datamodel.payment.OBWriteInternationalStandingOrderResponse7) OBWriteInternationalStandingOrderResponse7Data(uk.org.openbanking.datamodel.payment.OBWriteInternationalStandingOrderResponse7Data) FRReadRefundAccount(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount) FRInternationalResponseDataRefund(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRInternationalResponseDataRefund) FRWriteInternationalStandingOrderDataInitiation(com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalStandingOrderDataInitiation)

Example 5 with FRReadRefundAccount

use of com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount 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)

Aggregations

FRReadRefundAccount (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount)12 Meta (uk.org.openbanking.datamodel.account.Meta)12 FRDomesticResponseDataRefund (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRDomesticResponseDataRefund)6 FRInternationalResponseDataRefund (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRInternationalResponseDataRefund)6 FRWriteDomesticDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticDataInitiation)2 FRWriteDomesticScheduledDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticScheduledDataInitiation)2 FRWriteDomesticStandingOrderDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticStandingOrderDataInitiation)2 FRWriteInternationalDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalDataInitiation)2 FRWriteInternationalScheduledDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalScheduledDataInitiation)2 FRWriteInternationalStandingOrderDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalStandingOrderDataInitiation)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 OBWriteDomesticScheduledResponse4 (uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse4)1 OBWriteDomesticScheduledResponse4Data (uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse4Data)1 OBWriteDomesticScheduledResponse5 (uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse5)1 OBWriteDomesticScheduledResponse5Data (uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse5Data)1 OBWriteDomesticStandingOrderResponse5 (uk.org.openbanking.datamodel.payment.OBWriteDomesticStandingOrderResponse5)1 OBWriteDomesticStandingOrderResponse5Data (uk.org.openbanking.datamodel.payment.OBWriteDomesticStandingOrderResponse5Data)1