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());
}
Aggregations