use of com.mirakl.client.mmp.domain.shop.MiraklContactInformation in project mirakl-hyperwallet-connector by paypal.
the class MiraklShopToABABankAccountModelConverterStrategy method execute.
/**
* {@inheritDoc}
*/
@Override
public ABABankAccountModel execute(@NonNull final MiraklShop source) {
final MiraklPaymentInformation paymentInformation = source.getPaymentInformation();
final MiraklAbaBankAccountInformation miraklAbaBankAccountInformation = (MiraklAbaBankAccountInformation) paymentInformation;
final MiraklContactInformation contactInformation = source.getContactInformation();
// @formatter:off
return ABABankAccountModel.builder().transferMethodCountry(contactInformation.getCountry()).branchId(miraklAbaBankAccountInformation.getRoutingNumber()).bankAccountPurpose(BankAccountPurposeType.CHECKING.name()).transferMethodCurrency(source.getCurrencyIsoCode().name()).transferType(TransferType.BANK_ACCOUNT).type(BankAccountType.ABA).bankAccountNumber(miraklAbaBankAccountInformation.getBankAccountNumber()).businessName(Optional.ofNullable(source.getProfessionalInformation()).map(MiraklProfessionalInformation::getCorporateName).orElse(null)).firstName(contactInformation.getFirstname()).lastName(contactInformation.getLastname()).country(contactInformation.getCountry()).city(miraklAbaBankAccountInformation.getBankCity()).stateProvince(source.getAdditionalFieldValues()).postalCode(miraklAbaBankAccountInformation.getBankZip()).addressLine1(contactInformation.getStreet1()).addressLine2(Optional.ofNullable(contactInformation.getStreet2()).orElse(StringUtils.EMPTY)).token(source.getAdditionalFieldValues()).hyperwalletProgram(source.getAdditionalFieldValues()).build();
// @formatter:on
}
use of com.mirakl.client.mmp.domain.shop.MiraklContactInformation in project mirakl-hyperwallet-connector by paypal.
the class MiraklShopToCanadianBankAccountModelConverterStrategy method execute.
/**
* {@inheritDoc}
*/
@Override
public BankAccountModel execute(final MiraklShop source) {
final MiraklPaymentInformation paymentInformation = source.getPaymentInformation();
final MiraklCanadianBankAccountInformation miraklCanadianBankAccountInformation = (MiraklCanadianBankAccountInformation) paymentInformation;
final MiraklContactInformation contactInformation = source.getContactInformation();
// @formatter:off
return CanadianBankAccountModel.builder().bankId(miraklCanadianBankAccountInformation.getInstitutionNumber()).branchId(miraklCanadianBankAccountInformation.getTransitNumber()).transferMethodCountry(contactInformation.getCountry()).transferMethodCurrency(source.getCurrencyIsoCode().name()).transferType(TransferType.BANK_ACCOUNT).type(BankAccountType.CANADIAN).bankAccountNumber(miraklCanadianBankAccountInformation.getBankAccountNumber()).businessName(Optional.ofNullable(source.getProfessionalInformation()).map(MiraklProfessionalInformation::getCorporateName).orElse(null)).firstName(contactInformation.getFirstname()).lastName(contactInformation.getLastname()).country(contactInformation.getCountry()).city(miraklCanadianBankAccountInformation.getBankCity()).stateProvince(source.getAdditionalFieldValues()).postalCode(miraklCanadianBankAccountInformation.getBankZip()).addressLine1(contactInformation.getStreet1()).addressLine2(Optional.ofNullable(contactInformation.getStreet2()).orElse(StringUtils.EMPTY)).token(source.getAdditionalFieldValues()).hyperwalletProgram(source.getAdditionalFieldValues()).build();
// @formatter:on
}
use of com.mirakl.client.mmp.domain.shop.MiraklContactInformation in project mirakl-hyperwallet-connector by paypal.
the class MiraklShopToIBANBankAccountModelConverterStrategy method execute.
/**
* {@inheritDoc}
*/
@Override
public IBANBankAccountModel execute(@NonNull final MiraklShop source) {
final MiraklPaymentInformation paymentInformation = source.getPaymentInformation();
final MiraklIbanBankAccountInformation miraklIbanBankAccountInformation = (MiraklIbanBankAccountInformation) paymentInformation;
final MiraklContactInformation contactInformation = source.getContactInformation();
// @formatter:off
return IBANBankAccountModel.builder().transferMethodCountry(contactInformation.getCountry()).transferMethodCurrency(source.getCurrencyIsoCode().name()).transferType(TransferType.BANK_ACCOUNT).type(BankAccountType.IBAN).bankBic(miraklIbanBankAccountInformation.getBic()).bankAccountNumber(miraklIbanBankAccountInformation.getIban()).businessName(Optional.ofNullable(source.getProfessionalInformation()).map(MiraklProfessionalInformation::getCorporateName).orElse(null)).firstName(contactInformation.getFirstname()).lastName(contactInformation.getLastname()).country(contactInformation.getCountry()).addressLine1(contactInformation.getStreet1()).addressLine2(Optional.ofNullable(contactInformation.getStreet2()).orElse(StringUtils.EMPTY)).city(miraklIbanBankAccountInformation.getBankCity()).stateProvince(source.getAdditionalFieldValues()).token(source.getAdditionalFieldValues()).hyperwalletProgram(source.getAdditionalFieldValues()).build();
// @formatter:on
}
use of com.mirakl.client.mmp.domain.shop.MiraklContactInformation in project mirakl-hyperwallet-connector by paypal.
the class MiraklShopToUKBankAccountModelConverterStrategy method execute.
/**
* {@inheritDoc}
*/
@Override
public BankAccountModel execute(final MiraklShop source) {
final MiraklPaymentInformation paymentInformation = source.getPaymentInformation();
final MiraklUkBankAccountInformation miraklUkBankAccountInformation = (MiraklUkBankAccountInformation) paymentInformation;
final MiraklContactInformation contactInformation = source.getContactInformation();
// @formatter:off
return UKBankAccountModel.builder().transferMethodCountry(contactInformation.getCountry()).transferMethodCurrency(source.getCurrencyIsoCode().name()).transferType(TransferType.BANK_ACCOUNT).type(BankAccountType.UK).bankAccountNumber(miraklUkBankAccountInformation.getBankAccountNumber()).bankAccountId(miraklUkBankAccountInformation.getBankSortCode()).businessName(Optional.ofNullable(source.getProfessionalInformation()).map(MiraklProfessionalInformation::getCorporateName).orElse(null)).firstName(contactInformation.getFirstname()).lastName(contactInformation.getLastname()).country(contactInformation.getCountry()).addressLine1(contactInformation.getStreet1()).addressLine2(Optional.ofNullable(contactInformation.getStreet2()).orElse(StringUtils.EMPTY)).city(miraklUkBankAccountInformation.getBankCity()).stateProvince(source.getAdditionalFieldValues()).token(source.getAdditionalFieldValues()).hyperwalletProgram(source.getAdditionalFieldValues()).build();
// @formatter:on
}
use of com.mirakl.client.mmp.domain.shop.MiraklContactInformation in project mirakl-hyperwallet-connector by paypal.
the class AbstractMiraklShopToSellerModelConverter method getCommonFieldsBuilder.
protected SellerModel.SellerModelBuilder getCommonFieldsBuilder(final MiraklShop source) {
final MiraklContactInformation contactInformation = source.getContactInformation();
final List<MiraklAdditionalFieldValue> additionalFieldValues = source.getAdditionalFieldValues();
final BankAccountModel bankAccountModel = miraklShopBankAccountModelStrategyExecutor.execute(source);
// @formatter:off
return SellerModel.builder().clientUserId(source.getId()).businessName(source.getName()).firstName(contactInformation.getFirstname()).lastName(contactInformation.getLastname()).phoneNumber(contactInformation.getPhone()).mobilePhone(contactInformation.getPhoneSecondary()).email(contactInformation.getEmail()).addressLine1(contactInformation.getStreet1()).addressLine2(contactInformation.getStreet2()).city(contactInformation.getCity()).postalCode(contactInformation.getZipCode()).stateProvince(contactInformation.getState()).country(contactInformation.getCountry()).timeZone(sellersMiraklApiConfig.getTimeZone()).dateOfBirth(additionalFieldValues).passportId(additionalFieldValues).countryOfBirth(additionalFieldValues).countryOfNationality(additionalFieldValues).governmentId(additionalFieldValues).governmentIdType(additionalFieldValues).driversLicenseId(additionalFieldValues).businessType(additionalFieldValues).token(additionalFieldValues).bankAccountDetails(bankAccountModel).hwTermsConsent(additionalFieldValues).hyperwalletProgram(additionalFieldValues);
// @formatter:on
}
Aggregations