use of com.mirakl.client.mmp.domain.shop.MiraklShopKyc in project mirakl-hyperwallet-connector by paypal.
the class AbstractKYCUserStatusNotificationStrategy method createUpdateShopRequest.
private MiraklUpdateShopsRequest createUpdateShopRequest(final KYCUserStatusNotificationBodyModel kycUserStatusNotificationBodyModel, final MiraklShopKycStatus status) {
final String shopId = kycUserStatusNotificationBodyModel.getClientUserId();
final MiraklUpdateShop miraklUpdateShop = new MiraklUpdateShop();
miraklUpdateShop.setShopId(Long.valueOf(shopId));
// @formatter:off
miraklUpdateShop.setKyc(new MiraklShopKyc(status, kycRejectionReasonService.getRejectionReasonDescriptions(kycUserStatusNotificationBodyModel.getReasonsType())));
if (isKycAutomated()) {
final List<MiraklRequestAdditionalFieldValue> additionalFieldValues = new ArrayList<>();
if (HyperwalletUser.VerificationStatus.REQUIRED.equals(kycUserStatusNotificationBodyModel.getVerificationStatus())) {
final MiraklSimpleRequestAdditionalFieldValue kycVerificationStatusCustomField = new MiraklSimpleRequestAdditionalFieldValue();
kycVerificationStatusCustomField.setCode(HYPERWALLET_KYC_REQUIRED_PROOF_IDENTITY_BUSINESS_FIELD);
kycVerificationStatusCustomField.setValue(Boolean.TRUE.toString());
additionalFieldValues.add(kycVerificationStatusCustomField);
}
if (HyperwalletUser.LetterOfAuthorizationStatus.REQUIRED.equals(kycUserStatusNotificationBodyModel.getLetterOfAuthorizationStatus())) {
final MiraklSimpleRequestAdditionalFieldValue kycLetterOfAuthorizationStatusCustomField = new MiraklSimpleRequestAdditionalFieldValue();
kycLetterOfAuthorizationStatusCustomField.setCode(HYPERWALLET_KYC_REQUIRED_PROOF_AUTHORIZATION_BUSINESS_FIELD);
kycLetterOfAuthorizationStatusCustomField.setValue(Boolean.TRUE.toString());
additionalFieldValues.add(kycLetterOfAuthorizationStatusCustomField);
}
if (!CollectionUtils.isEmpty(additionalFieldValues)) {
miraklUpdateShop.setAdditionalFieldValues(additionalFieldValues);
}
}
return new MiraklUpdateShopsRequest(List.of(miraklUpdateShop));
}
Aggregations