class Xs2aToSpiPaymentMapper {

    public SpiPayment mapToSpiPayment(PisCommonPaymentResponse commonPaymentResponse) {
        SpiPaymentInfo spiPaymentInfo = new SpiPaymentInfo(commonPaymentResponse.getPaymentProduct());
        spiPaymentInfo.setPaymentId(commonPaymentResponse.getExternalId());
        spiPaymentInfo.setPaymentType(commonPaymentResponse.getPaymentType());
        spiPaymentInfo.setStatus(commonPaymentResponse.getTransactionStatus());
        spiPaymentInfo.setPaymentData(commonPaymentResponse.getPaymentData());
        spiPaymentInfo.setPsuDataList(xs2aToSpiPsuDataMapper.mapToSpiPsuDataList(commonPaymentResponse.getPsuData()));
        spiPaymentInfo.setStatusChangeTimestamp(commonPaymentResponse.getStatusChangeTimestamp());
        spiPaymentInfo.setCreationTimestamp(commonPaymentResponse.getCreationTimestamp());
        spiPaymentInfo.setInstanceId(commonPaymentResponse.getInstanceId());
        return spiPaymentInfo;
    }

}