Search in sources :

Example 1 with MiraklShopKyc

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));
}
Also used : MiraklUpdateShopsRequest(com.mirakl.client.mmp.operator.request.shop.MiraklUpdateShopsRequest) MiraklUpdateShop(com.mirakl.client.mmp.operator.domain.shop.update.MiraklUpdateShop) MiraklShopKyc(com.mirakl.client.mmp.domain.shop.MiraklShopKyc) MiraklRequestAdditionalFieldValue(com.mirakl.client.mmp.request.additionalfield.MiraklRequestAdditionalFieldValue) MiraklSimpleRequestAdditionalFieldValue(com.mirakl.client.mmp.request.additionalfield.MiraklRequestAdditionalFieldValue.MiraklSimpleRequestAdditionalFieldValue)

Aggregations

MiraklShopKyc (com.mirakl.client.mmp.domain.shop.MiraklShopKyc)1 MiraklUpdateShop (com.mirakl.client.mmp.operator.domain.shop.update.MiraklUpdateShop)1 MiraklUpdateShopsRequest (com.mirakl.client.mmp.operator.request.shop.MiraklUpdateShopsRequest)1 MiraklRequestAdditionalFieldValue (com.mirakl.client.mmp.request.additionalfield.MiraklRequestAdditionalFieldValue)1 MiraklSimpleRequestAdditionalFieldValue (com.mirakl.client.mmp.request.additionalfield.MiraklRequestAdditionalFieldValue.MiraklSimpleRequestAdditionalFieldValue)1