Search in sources :

Example 1 with OBWriteInternationalScheduledResponse5Data

use of uk.org.openbanking.datamodel.payment.OBWriteInternationalScheduledResponse5Data in project openbanking-aspsp by OpenBankingToolkit.

the class InternationalScheduledPaymentsApiController method responseEntity.

private OBWriteInternationalScheduledResponse5 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 OBWriteInternationalScheduledResponse5().data(new OBWriteInternationalScheduledResponse5Data().internationalScheduledPaymentId(frPaymentSubmission.getId()).initiation(toOBWriteInternationalScheduled3DataInitiation(initiation)).creationDateTime(frInternationalScheduledConsent.getCreated()).statusUpdateDateTime(frInternationalScheduledConsent.getStatusUpdate()).consentId(frInternationalScheduledConsent.getId()).status(toOBWriteInternationalScheduledResponse5DataStatus(frInternationalScheduledConsent.getStatus())).exchangeRateInformation(toOBWriteInternationalConsentResponse5DataExchangeRateInformation(frInternationalScheduledConsent.getCalculatedExchangeRate())).expectedExecutionDateTime(frInternationalScheduledConsent.getInitiation().getRequestedExecutionDateTime()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteInternationalResponse4DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetInternationalScheduledPayment())).meta(new Meta());
}
Also used : Meta(uk.org.openbanking.datamodel.account.Meta) 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) OBWriteInternationalScheduledResponse5(uk.org.openbanking.datamodel.payment.OBWriteInternationalScheduledResponse5) OBWriteInternationalScheduledResponse5Data(uk.org.openbanking.datamodel.payment.OBWriteInternationalScheduledResponse5Data)

Aggregations

FRWriteInternationalScheduledDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalScheduledDataInitiation)1 FRInternationalResponseDataRefund (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRInternationalResponseDataRefund)1 FRReadRefundAccount (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount)1 Meta (uk.org.openbanking.datamodel.account.Meta)1 OBWriteInternationalScheduledResponse5 (uk.org.openbanking.datamodel.payment.OBWriteInternationalScheduledResponse5)1 OBWriteInternationalScheduledResponse5Data (uk.org.openbanking.datamodel.payment.OBWriteInternationalScheduledResponse5Data)1