Search in sources :

Example 1 with OBWriteInternationalScheduledResponse6Data

use of uk.org.openbanking.datamodel.payment.OBWriteInternationalScheduledResponse6Data 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)

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 OBWriteInternationalScheduledResponse6 (uk.org.openbanking.datamodel.payment.OBWriteInternationalScheduledResponse6)1 OBWriteInternationalScheduledResponse6Data (uk.org.openbanking.datamodel.payment.OBWriteInternationalScheduledResponse6Data)1