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");
}
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);
}
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");
}
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");
}
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());
}
Aggregations