use of uk.org.openbanking.datamodel.payment.OBWriteInternationalStandingOrderResponse6Data in project openbanking-aspsp by OpenBankingToolkit.
the class InternationalStandingOrdersApiController method responseEntity.
private OBWriteInternationalStandingOrderResponse6 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 OBWriteInternationalStandingOrderResponse6().data(new OBWriteInternationalStandingOrderResponse6Data().internationalStandingOrderId(frPaymentSubmission.getId()).initiation(toOBWriteInternationalStandingOrder4DataInitiation(initiation)).creationDateTime(frInternationalStandingOrderConsent.getCreated()).statusUpdateDateTime(frInternationalStandingOrderConsent.getStatusUpdate()).status(toOBWriteInternationalStandingOrderResponse6DataStatus(frInternationalStandingOrderConsent.getStatus())).consentId(frInternationalStandingOrderConsent.getId()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteInternationalResponse4DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetInternationalStandingOrder())).meta(new Meta());
}
Aggregations