Authentication

Authentication with Heartland is simple: you will pass either your Secret API Key (found on your Account Settings screen) or your site, license, device, username and password to the SDK via your configuration.

Create an authentication object

/* Card Not Present */
var config = new HpsServicesConfig()  {
    SecretApiKey = "skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A"
};
var creditService = new HpsCreditService(config);

/* Card Present */
var config = new HpsServicesConfig()  {
    DeviceId = 1234567,
    LicenseId = 12345,
    Password = "$Password",
    SiteId = 12345,
    UserName = "UserName"
};
var creditService = new HpsCreditService(config);
<?php
// Card Not Present
$config = new HpsServicesConfig();
$config->secretApiKey =  "skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A";
$creditService = new HpsCreditService($config);

// Card Present
$config = new HpsServicesConfig();
$config->siteId = '12345';
$config->licenseId = '12345';
$config->deviceId = '1234567';
$config->username = 'UserName';
$config->password = '$Password';
$creditService = new HpsCreditService($config);
/* Card Not Present */
HpsServicesConfig config = new HpsServicesConfig();
config.setSecretAPIKey("skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A");
HpsCreditService creditService = new HpsCreditService(config);

/* Card Present */
HpsServicesConfig config = new HpsServicesConfig();
config.setDeviceId(1234567);
config.setLicenseId(12345);
config.setPassword("$Password");
config.setSiteId(12345);
config.setUserName("UserName");
HpsCreditService creditService = new HpsCreditService(config);
=begin
Card Not Present
=end
Hps.configure do |config|
    config.secret_api_key = "skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A"
end

charge_service = Hps::HpsChargeService.new

=begin
Card Present
=end
Hps.configure do |config|
    config.user_name = "UserName"
    config.password = "$Password"
    config.license_id = 12345
    config.device_id = 1234567
    config.site_id = 12345
end

charge_service = Hps::HpsChargeService.new
'''
Card Not Present
'''
config = HpsServicesConfig()
config.secret_api_key = '%%SECRET_API_KEY%%'

credit_service = HpsCreditService(config)

'''
Card Present
'''
config = HpsServicesConfig()
config.site_id = '12345'
config.license_id = '12345'
config.device_id = '1234567'
config.username = 'UserName'
config.password = '$Password'

credit_service = HpsCreditService(config)
var validServicesConfig = {
  secretApiKey: "skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A",
  versionNumber: "1234",
  developerId: "123456"
};

var uri = "https://cert.api2.heartlandportico.com/hps.exchange.posgateway/posgatewayservice.asmx";

var creditService = new HpsCreditService(
  validServicesConfig,
  uri
);