Search in sources :

Example 11 with Hyperwallet

use of com.hyperwallet.clientsdk.Hyperwallet in project mirakl-hyperwallet-connector by paypal.

the class InvoiceHyperwalletSDKEncryptedServiceImplTest method getHyperwalletInstanceByIssuingStore_shouldReturnAnHyperwalletInstance.

@Test
void getHyperwalletInstanceByIssuingStore_shouldReturnAnHyperwalletInstance() {
    when(invoicesHyperwalletApiConfigMock.getPaymentStoreTokens()).thenReturn(Map.of(ISSUING_STORE, PROGRAM_TOKEN));
    when(invoicesHyperwalletApiConfigMock.getUsername()).thenReturn(USER_NAME);
    when(invoicesHyperwalletApiConfigMock.getPassword()).thenReturn(PASSWORD);
    when(invoicesHyperwalletApiConfigMock.getServer()).thenReturn(SERVER);
    when(invoicesHyperwalletApiConfigMock.getPaymentStoreTokens()).thenReturn(Map.of(ISSUING_STORE, PROGRAM_TOKEN));
    when(invoicesHyperwalletApiConfigMock.getUsername()).thenReturn(USER_NAME);
    when(invoicesHyperwalletApiConfigMock.getPassword()).thenReturn(PASSWORD);
    when(invoicesHyperwalletApiConfigMock.getServer()).thenReturn(SERVER);
    final Hyperwallet result = testObj.getHyperwalletInstanceByHyperwalletProgram(ISSUING_STORE);
    assertThat(result).hasFieldOrPropertyWithValue("programToken", PROGRAM_TOKEN).hasFieldOrPropertyWithValue("apiClient.username", USER_NAME).hasFieldOrPropertyWithValue("url", SERVER + "/rest/v4");
}
Also used : Hyperwallet(com.hyperwallet.clientsdk.Hyperwallet) Test(org.junit.jupiter.api.Test)

Example 12 with Hyperwallet

use of com.hyperwallet.clientsdk.Hyperwallet in project mirakl-hyperwallet-connector by paypal.

the class InvoiceHyperwalletSDKEncryptedServiceImplTest method getHyperwalletInstanceWithProgramToken_shouldReturnAnHyperwalletInstanceWithEncryptedOption.

@Test
void getHyperwalletInstanceWithProgramToken_shouldReturnAnHyperwalletInstanceWithEncryptedOption() {
    when(invoicesHyperwalletApiConfigMock.getUsername()).thenReturn(USER_NAME);
    when(invoicesHyperwalletApiConfigMock.getPassword()).thenReturn(PASSWORD);
    when(invoicesHyperwalletApiConfigMock.getServer()).thenReturn(SERVER);
    final Hyperwallet result = testObj.getHyperwalletInstanceWithProgramToken(PROGRAM_TOKEN);
    assertThat(result).hasFieldOrPropertyWithValue(API_CLIENT_HYPERWALLET_ENCRYPTION, hyperwalletEncryptionMock);
}
Also used : Hyperwallet(com.hyperwallet.clientsdk.Hyperwallet) Test(org.junit.jupiter.api.Test)

Example 13 with Hyperwallet

use of com.hyperwallet.clientsdk.Hyperwallet in project mirakl-hyperwallet-connector by paypal.

the class InvoiceHyperwalletSDKServiceImplTest method getHyperwalletInstanceByHyperwalletProgram_shouldReturnAnHyperwalletInstance.

@Test
void getHyperwalletInstanceByHyperwalletProgram_shouldReturnAnHyperwalletInstance() {
    when(invoicesHyperwalletApiConfigMock.getPaymentStoreTokens()).thenReturn(Map.of(HYPERWALLET_PROGRAM, PROGRAM_TOKEN));
    when(invoicesHyperwalletApiConfigMock.getUsername()).thenReturn(USER_NAME);
    when(invoicesHyperwalletApiConfigMock.getPassword()).thenReturn(PASSWORD);
    when(invoicesHyperwalletApiConfigMock.getServer()).thenReturn(SERVER);
    final Hyperwallet result = testObj.getHyperwalletInstanceByHyperwalletProgram(HYPERWALLET_PROGRAM);
    assertThat(result).hasFieldOrPropertyWithValue("programToken", PROGRAM_TOKEN).hasFieldOrPropertyWithValue("apiClient.username", USER_NAME).hasFieldOrPropertyWithValue("url", SERVER + "/rest/v4");
}
Also used : Hyperwallet(com.hyperwallet.clientsdk.Hyperwallet) Test(org.junit.jupiter.api.Test)

Example 14 with Hyperwallet

use of com.hyperwallet.clientsdk.Hyperwallet in project mirakl-hyperwallet-connector by paypal.

the class InvoiceHyperwalletSDKServiceImplTest method getHyperwalletInstanceWithProgramToken_shouldReturnAnHyperwalletInstance.

@Test
void getHyperwalletInstanceWithProgramToken_shouldReturnAnHyperwalletInstance() {
    when(invoicesHyperwalletApiConfigMock.getUsername()).thenReturn(USER_NAME);
    when(invoicesHyperwalletApiConfigMock.getPassword()).thenReturn(PASSWORD);
    when(invoicesHyperwalletApiConfigMock.getServer()).thenReturn(SERVER);
    final Hyperwallet result = testObj.getHyperwalletInstanceWithProgramToken(PROGRAM_TOKEN);
    assertThat(result).hasFieldOrPropertyWithValue("programToken", PROGRAM_TOKEN).hasFieldOrPropertyWithValue("apiClient.username", USER_NAME).hasFieldOrPropertyWithValue("url", SERVER + "/rest/v4");
}
Also used : Hyperwallet(com.hyperwallet.clientsdk.Hyperwallet) Test(org.junit.jupiter.api.Test)

Example 15 with Hyperwallet

use of com.hyperwallet.clientsdk.Hyperwallet in project mirakl-hyperwallet-connector by paypal.

the class HyperwalletBusinessStakeholderExtractServiceImpl method getKYCRequiredVerificationBusinessStakeHolders.

/**
 * {@inheritDoc}
 */
@Override
public List<String> getKYCRequiredVerificationBusinessStakeHolders(final String hyperwalletProgram, final String userToken) {
    final Hyperwallet hyperwallet = hyperwalletSDKService.getHyperwalletInstance(hyperwalletProgram);
    final List<HyperwalletBusinessStakeholder> businessStakeholders = getBusinessStakeholders(userToken, hyperwallet);
    return businessStakeholders.stream().filter(hyperwalletBusinessStakeholder -> REQUIRED.equals(hyperwalletBusinessStakeholder.getVerificationStatus())).map(HyperwalletBusinessStakeholder::getToken).collect(Collectors.toList());
}
Also used : Hyperwallet(com.hyperwallet.clientsdk.Hyperwallet) HyperwalletBusinessStakeholder(com.hyperwallet.clientsdk.model.HyperwalletBusinessStakeholder)

Aggregations

Hyperwallet (com.hyperwallet.clientsdk.Hyperwallet)24 Test (org.junit.jupiter.api.Test)14 HyperwalletException (com.hyperwallet.clientsdk.HyperwalletException)7 HyperwalletBusinessStakeholder (com.hyperwallet.clientsdk.model.HyperwalletBusinessStakeholder)3 HyperwalletUser (com.hyperwallet.clientsdk.model.HyperwalletUser)3 HyperwalletPayment (com.hyperwallet.clientsdk.model.HyperwalletPayment)1 KYCDocumentBusinessStakeHolderInfoModel (com.paypal.kyc.model.KYCDocumentBusinessStakeHolderInfoModel)1 KYCDocumentSellerInfoModel (com.paypal.kyc.model.KYCDocumentSellerInfoModel)1