/**
 * @NApiVersion 2.x
 * @NScriptType ScheduledScript
 */
define(["SuiteScripts/Honeycomb Mfg/globalpayments.api", "N/log"], function(
  GP,
  log,
) {
  function execute(context) {
    var config = new GP.ServicesConfig();
    config.secretApiKey =
      "skapi_cert_MTeSAQAfG1UA9qQDrzl-kz4toXvARyieptFwSKP24w";
    config.serviceUrl = "https://cert.api2.heartlandportico.com";

    GP.ServicesContainer.configure(config);

    var card = new GP.CreditCardData();
    card.number = "4111111111111111";
    card.expMonth = "12";
    card.expYear = "2025";
    card.cvn = "123";
    card.cardHolderName = "Joe Smith";

    card
      .authorize("14")
      .withCurrency("USD")
      .withAllowDuplicates(true)
      .execute()
      .then(function(authorization) {
        log.debug(authorization);
        return authorization;
      });
  }

  return {
    execute: execute,
  };
});

[{"tag": "KEY", "value": "skapi_cert_MTeSAQAfG1UA9qQDrzl-kz4toXvARyieptFwSKP24w", "start": 259, "end": 312}]
/**
 * @NApiVersion 2.x
 * @NScriptType ScheduledScript
 */
define(["SuiteScripts/Honeycomb Mfg/globalpayments.api", "N/log"], function(
  GP,
  log,
) {
  function execute(context) {
    var config = new GP.ServicesConfig();
    config.secretApiKey =
      "caf86f4uutaoxfysmf7anj01xl6sv3ps";
    config.serviceUrl = "https://cert.api2.heartlandportico.com";

    GP.ServicesContainer.configure(config);

    var card = new GP.CreditCardData();
    card.number = "4111111111111111";
    card.expMonth = "12";
    card.expYear = "2025";
    card.cvn = "123";
    card.cardHolderName = "Joe Smith";

    card
      .authorize("14")
      .withCurrency("USD")
      .withAllowDuplicates(true)
      .execute()
      .then(function(authorization) {
        log.debug(authorization);
        return authorization;
      });
  }

  return {
    execute: execute,
  };
});

/**
 * @NApiVersion 2.x
 * @NScriptType ScheduledScript
 */
define(["SuiteScripts/Honeycomb Mfg/globalpayments.api", "N/log"], function(
  GP,
  log,
) {
  function execute(context) {
    var config = new GP.ServicesConfig();
    config.secretApiKey =
      "PI:KEY:caf86f4uutaoxfysmf7anj01xl6sv3psEND_PI";
    config.serviceUrl = "https://cert.api2.heartlandportico.com";

    GP.ServicesContainer.configure(config);

    var card = new GP.CreditCardData();
    card.number = "4111111111111111";
    card.expMonth = "12";
    card.expYear = "2025";
    card.cvn = "123";
    card.cardHolderName = "Joe Smith";

    card
      .authorize("14")
      .withCurrency("USD")
      .withAllowDuplicates(true)
      .execute()
      .then(function(authorization) {
        log.debug(authorization);
        return authorization;
      });
  }

  return {
    execute: execute,
  };
});
