Search in sources :

Example 1 with OBWriteInternationalStandingOrderResponse7Data

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

Aggregations

FRWriteInternationalStandingOrderDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalStandingOrderDataInitiation)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 OBWriteInternationalStandingOrderResponse7 (uk.org.openbanking.datamodel.payment.OBWriteInternationalStandingOrderResponse7)1 OBWriteInternationalStandingOrderResponse7Data (uk.org.openbanking.datamodel.payment.OBWriteInternationalStandingOrderResponse7Data)1