use of com.mirakl.client.mmp.domain.shop.document.MiraklShopDocument in project mirakl-hyperwallet-connector by paypal.
the class MiraklBusinessStakeholderDocumentDownloadExtractServiceImpl method populateMiraklShopBusinessStakeholderDocuments.
protected KYCDocumentBusinessStakeHolderInfoModel populateMiraklShopBusinessStakeholderDocuments(final KYCDocumentBusinessStakeHolderInfoModel kycBusinessStakeHolderInfoModel) {
final MiraklGetShopDocumentsRequest getShopBusinessStakeholderDocumentsRequest = new MiraklGetShopDocumentsRequest(List.of(kycBusinessStakeHolderInfoModel.getClientUserId()));
try {
log.info("Retrieving business stakeholder documents for seller with id [{}]", kycBusinessStakeHolderInfoModel.getClientUserId());
final List<MiraklShopDocument> shopDocuments = miraklMarketplacePlatformOperatorApiClient.getShopDocuments(getShopBusinessStakeholderDocumentsRequest);
// @formatter:off
log.info("Business stakeholder documents available for seller with id [{}]: [{}]", kycBusinessStakeHolderInfoModel.getClientUserId(), shopDocuments.stream().map(miraklDocument -> "Id:" + miraklDocument.getId() + " ,fileName:" + miraklDocument.getFileName() + " ,typeCode:" + miraklDocument.getTypeCode()).collect(Collectors.joining(" | ")));
// @formatter:on
return kycBusinessStakeHolderInfoModel.toBuilder().miraklShopDocuments(shopDocuments).build();
} catch (final MiraklException e) {
log.error("Something went wrong trying to receive business stakeholder documents from Mirakl for seller with id [{}]", kycBusinessStakeHolderInfoModel.getClientUserId());
kycMailNotificationUtil.sendPlainTextEmail("Issue detected getting business stakeholder documents from Mirakl", String.format("Something went wrong getting documents from Mirakl for shop Id [%s]%n%s", String.join(",", kycBusinessStakeHolderInfoModel.getClientUserId()), MiraklLoggingErrorsUtil.stringify(e)));
}
return kycBusinessStakeHolderInfoModel.toBuilder().build();
}
use of com.mirakl.client.mmp.domain.shop.document.MiraklShopDocument in project mirakl-hyperwallet-connector by paypal.
the class MiraklSellerDocumentDownloadExtractServiceImpl method populateMiraklShopDocuments.
/**
* {@inheritDoc}
*/
@Override
public KYCDocumentSellerInfoModel populateMiraklShopDocuments(final KYCDocumentSellerInfoModel kycDocumentSellerInfoModel) {
final MiraklGetShopDocumentsRequest getShopDocumentsRequest = new MiraklGetShopDocumentsRequest(List.of(kycDocumentSellerInfoModel.getClientUserId()));
try {
log.info("Retrieving documents for seller with id [{}]", kycDocumentSellerInfoModel.getClientUserId());
final List<MiraklShopDocument> shopDocuments = miraklMarketplacePlatformOperatorApiClient.getShopDocuments(getShopDocumentsRequest);
log.info("Documents retrieved for seller with id [{}]: [{}]", kycDocumentSellerInfoModel.getClientUserId(), shopDocuments.stream().map(MiraklShopDocument::getId).collect(Collectors.joining(",")));
return kycDocumentSellerInfoModel.toBuilder().miraklShopDocuments(shopDocuments).build();
} catch (final MiraklException e) {
log.error("Something went wrong trying to receive documents from Mirakl for seller with id [{}]", kycDocumentSellerInfoModel.getClientUserId());
kycMailNotificationUtil.sendPlainTextEmail("Issue detected getting documents from Mirakl", String.format("Something went wrong getting documents from Mirakl for shop Id [%s]%n%s", String.join(",", kycDocumentSellerInfoModel.getClientUserId()), MiraklLoggingErrorsUtil.stringify(e)));
}
return kycDocumentSellerInfoModel.toBuilder().build();
}
Aggregations