Having two onespan accounts configured on salesforce
Wednesday, May 26, 2021 at 08:25amWe want to have configured branding for two accounts so thinking to have separate accounts.
Question is :
- Can we configure two account API Keys in salesforce,
- If yes, how can we do that?
- How do we specify which one to use and when?
Reply to: Having two onespan accounts configured on salesforce
Wednesday, May 26, 2021 at 09:29amHi amunjal,
Unfortunately multiple accounts is not natively supported in APEX SDK. But you can easily achieve it by adjusting the source code.
Check the APEX Class OneSpanSDK.cls and OneSpanRESTAPIHelper.cls
OneSpanSDK.cls:
public OneSpanSDK()
{
helper = new OneSpanRESTAPIHelper();
}
OneSpanRESTAPIHelper.cls
public OneSpanRESTAPIHelper()
{
setSettings();
}
private void setSettings()
{
try
{
connectionSettings = OneSpan_Connection_Settings__c.getInstance('Main');
if(connectionSettings.Endpoint__c.equals('') || connectionSettings.API_Key__c.equals(''))
{
}
}
catch(Exception e)
{
throw new OneSpanRestAPIHelperException(
'Error in retrieving the OneSpan Custom Settings. Please verify you have the below set up:\n '
+ 'Custom Setting API Name: OneSpan_Connection_Settings__c, Custom Setting Record Name: Main'+e.getMessage());
}
}
Instead of hardcoding the custom settings instance "Main" and passing in the value when initiating the OneSpanSDK object should accommodate your requirement.
Duo
Reply to: Having two onespan accounts configured on salesforce
Wednesday, May 26, 2021 at 03:30pmThanks Duo, appreciate the response.
We will take care of it.