Search in sources :

Example 1 with MiraklProfessionalInformation

use of com.mirakl.client.mmp.domain.shop.MiraklProfessionalInformation 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
}
Also used : MiraklContactInformation(com.mirakl.client.mmp.domain.shop.MiraklContactInformation) MiraklPaymentInformation(com.mirakl.client.mmp.domain.shop.bank.MiraklPaymentInformation) MiraklIbanBankAccountInformation(com.mirakl.client.mmp.domain.shop.bank.MiraklIbanBankAccountInformation) MiraklProfessionalInformation(com.mirakl.client.mmp.domain.shop.MiraklProfessionalInformation)

Example 2 with MiraklProfessionalInformation

use of com.mirakl.client.mmp.domain.shop.MiraklProfessionalInformation 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
}
Also used : MiraklContactInformation(com.mirakl.client.mmp.domain.shop.MiraklContactInformation) MiraklPaymentInformation(com.mirakl.client.mmp.domain.shop.bank.MiraklPaymentInformation) MiraklProfessionalInformation(com.mirakl.client.mmp.domain.shop.MiraklProfessionalInformation) MiraklUkBankAccountInformation(com.mirakl.client.mmp.domain.shop.bank.MiraklUkBankAccountInformation)

Aggregations

MiraklContactInformation (com.mirakl.client.mmp.domain.shop.MiraklContactInformation)2 MiraklProfessionalInformation (com.mirakl.client.mmp.domain.shop.MiraklProfessionalInformation)2 MiraklPaymentInformation (com.mirakl.client.mmp.domain.shop.bank.MiraklPaymentInformation)2 MiraklIbanBankAccountInformation (com.mirakl.client.mmp.domain.shop.bank.MiraklIbanBankAccountInformation)1 MiraklUkBankAccountInformation (com.mirakl.client.mmp.domain.shop.bank.MiraklUkBankAccountInformation)1