use of uk.org.openbanking.datamodel.payment.OBWriteInternationalResponse5Data in project openbanking-aspsp by OpenBankingToolkit.
the class InternationalPaymentsApiController method responseEntity.
private OBWriteInternationalResponse5 responseEntity(FRInternationalPaymentSubmission frPaymentSubmission, FRInternationalConsent frInternationalConsent) {
FRReadRefundAccount readRefundAccount = frInternationalConsent.getInternationalConsent().getData().getReadRefundAccount();
FRWriteInternationalDataInitiation initiation = frPaymentSubmission.getInternationalPayment().getData().getInitiation();
Optional<FRInternationalResponseDataRefund> refund = frInternationalResponseDataRefund(readRefundAccount, initiation);
return new OBWriteInternationalResponse5().data(new OBWriteInternationalResponse5Data().internationalPaymentId(frPaymentSubmission.getId()).initiation(toOBWriteInternational3DataInitiation(frPaymentSubmission.getInternationalPayment().getData().getInitiation())).creationDateTime(frInternationalConsent.getCreated()).statusUpdateDateTime(frInternationalConsent.getStatusUpdate()).status(toOBWriteInternationalResponse5DataStatus(frInternationalConsent.getStatus())).consentId(frInternationalConsent.getId()).debtor(toOBCashAccountDebtor4(frInternationalConsent.getInitiation().getDebtorAccount())).exchangeRateInformation(toOBWriteInternationalConsentResponse6DataExchangeRateInformation(frInternationalConsent.getCalculatedExchangeRate())).refund(refund.map(FRResponseDataRefundConverter::toOBWriteInternationalResponse5DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetInternationalPayment())).meta(new Meta());
}
Aggregations