Get Converge Account Information

This function accesses the following Converge account information to optionally change certain functionality on your application or for debugging purposes:

  • Merchant name
  • Default currency
  • Default language
  • Business email
  • Address line 1
  • City
  • State/Province
  • Postal Code
  • Market Segment
  • Gratuity support
  • CVV support
  • AVS support
  • Invoice number support

Also, you could optionally change/override some of the settings of your terminal/account - like default language, debit network preferences (if in the US) or digital signature preferences.

Code Samples

CWS

This code sample demonstrates accessing the Converge acount information when opening the payment gateway.

Request

{
  "method" : "openPaymentGateway",
  "requestId" : "1326383996",
  "targetType" : "paymentGatewayConverge",
  "version" : "1.0",
  "parameters" : {
    "email" : "******",
    "pin" : "******",
    "userId" : "******",
    "handleDigitalSignature" : true,
    "paymentGatewayEnvironment" : "DEMO",
    "merchantId" : "******",
    "vendorId" : "******",
    "vendorAppName" : "******",
    "vendorAppVersion" : "******",
    "overrideDefaultTerminalLanguage" : {
      "languageInformation" : {
        "languageCode" : "EN",
        "countryCode" : "US"
      }
    },
    "overrideDebitNetworkPreferences" : {
      "visa" : "NO_PREFERENCE",
      "mastercard" : "US_COMMON_DEBIT",
      "discover" : "GLOBAL_NETWORK"
    },
    "proxyInfo" : {
      "address" : "******",
      "port" : "******",
      "user" : "******",
      "password" : "******"
    },
  }
}

Response

{
  "requestId" : "1326383996",
  "statusDetails" : "REQUEST_ACCEPTED",
  "data" : {
    "paymentGatewayCommand" : {
      "completed" : true,
      "eventQueue" : [ ],
      "openPaymentGatewayData" : {
        "result" : "SUCCESS",
        "paymentGatewayId" : "0907356b-d985-4e3f-adae-1a74b9264a8a"
      },
      "accountInfo" : {
        "postalCode" : "",
        "currencyCode" : "USD",
        "marketSegment" : "SERVICE",
        "isCvvEnabled" : true,
        "name" : "EMV test terminal",
        "isGratuitySupported" : true,
        "stateProvince" : "",
        "address1" : "",
        "businessEmail" : "test@test.com",
        "isAvsEnabled" : true,
        "city" : ""
      }

    }
  }
}

Java

This code sample demonstrates accessing the Converge account information during initialization. The code sample implements ECLAccountInformationRetrievalListener and passes the listener during initialization.

public class CommerceAccountListener implements ECLConvergeAccountListener, ECLAccountInformationRetrievalListener
{

    ...

    @Override
    public void accountInformationRetrievalDidSucceed(ECLAccountInterface eclAccountInterface, ECLAccountInformation eclAccountInformation)
    {
        logger.info("Account info retrieved:");
        logger.info("name:" + eclAccountInformation.getName());
        logger.info("currency:" + eclAccountInformation.getCurrencyCode());
        logger.info("language: " + eclAccountInformation.getLanguageInformation().valueAsString());
        logger.info("Gratuity: " + eclAccountInformation.isGratuitySupported());
        logger.info("CVV: " + eclAccountInformation.isCvvEnabled());
        logger.info("AVS: " + eclAccountInformation.isAvsEnabled());
        ECLTerminalConfiguration terminalConfig = eclAccountInterface.getTerminalConfiguration();
        if (terminalConfig != null)
        {
            logger.info("language: " + terminalConfig.getRemoteLanguage().valueAsString());
            ECLDebitNetworkPreferences debitPrefs = terminalConfig.getRemoteDebitNetworkPreferences();
            if (debitPrefs != null)
            {
                logger.info("Debit network preference (VISA): " + debitPrefs.getPreference(ECLCardBrand.VISA));
                logger.info("Debit network preference (MASTERCARD): " + debitPrefs.getPreference(ECLCardBrand.MASTERCARD));
                logger.info("Debit network preference (DISCOVER): " + debitPrefs.getPreference(ECLCardBrand.DISCOVER));
            }
        }
        commerceAccount.setEclAccountInformation(eclAccountInformation);
    }

    @Override
    public void accountInformationRetrievalDidFail(ECLAccountInterface eclAccountInterface, ECCError error)
    {
        logger.warning("Failed to get info");
        if (error instanceof ECLCommerceError)
        {
            logger.warning(((ECLCommerceError) error).getCode().name());
        }
        else if (error instanceof ECLConvergeError)
        {
            logger.warning(((ECLConvergeError) error).getCode().name());
        }
        else
        {
            logger.warning("error" + error.getLocalizedDescription());
        }
    }
}

This code sample demonstrates accessing the Converge account information using explicit calls.

ECLAccountInterface account;

...

ECLAccountInformationRetrievalListener delegate = new ECLAccountInformationRetrievalListener()
{
    @Override
    public void accountInformationRetrievalDidSucceed(ECLAccountInterface account, ECLAccountInformation accountInformation)
    {
        logger.info("AVS: " + accountInformation.isAvsEnabled());
    }

    @Override
    public void accountInformationRetrievalDidFail(ECLAccountInterface account, ECCError eccError)
    {
        //Error handling
    }
};

if (account != null)
{
    account.retrieveAccountInformation(delegate);
}

Objective-C (iOS)

This code sample demonstrates accessing the Converge account information during initialization. The code sample implements ECLAccountInformationRetrievalDelegate and passes the delegate during initialization.

@interface AccountDelegate : NSObject <ECLAccountDelegate, ECLAccountInformationRetrievalDelegate>

...

+ (void)accountInformationRetrievalDidSucceed:(id<ECLAccountProtocol>)account accountInformation:(ECLAccountInformation *)accountInformation {
    [self.mainViewControllerReference addStatusString:@"Account Info Retrieval succeeded\n"];
    self.mainViewControllerReference.accountInformation = accountInformation;
}


+ (void)accountInformationRetrievalDidFail:(id<ECLAccountProtocol>)account error:(NSError *)error {
    [self.mainViewControllerReference addStatusString:[NSString stringWithFormat:@"Account Info Retrieval failed: %@\n", [error debugDescription]]];
}

This code sample demonstrates accessing the Converge account information using explicit calls.

[account retrieveAccountInformation:account codeBlock:^(id<ECLAccountProtocol> account, ECLAccountInformation *info, NSError *error) {
    // we are on the callback queue so run on our queue
    if (error == nil) {
        ECL_LOG_INFO(@"prvProcessTransaction: retrieved account info");
        //Do something with the account info
    } else {
        ECL_LOG_INFO(@"prvProcessTransaction: failed to retrieve account info");
        [delegate transactionDidFail:transaction using:tender errors:@[ error ]];
    }
}];

C#

This code sample demonstrates accessing the Converge account information when opening the payment gateway.

Request

OpenPaymentArgs obea = new OpenPaymentArgs();

Response

public void MyOpenPaymentGatewayComplete(OpenPaymentGatewayResults ober)
{
    ...

    AccountInfo accountInfo = ober.AccountInfo;
    if (null != accountInfo)
    {
        //do something with the account info
    }

    ...
}