Thank you.
That's true, using Salesforce commerce cloud (Formerly know as Demandware) independently, without integration with the CRM is different and entails customization of the Storefront by uploading "cartridges" which contain a combination of Pipelines, Templates, Scripts, XML and property files.
Demandware Script is their own version of Javascript with a .ds extension, which enables you add custom logic that needs to be executed within Pipelines or Templates.
For example in your a cartridges/app_storefront_core/cartridge/scripts, you would have an initialization .ds file and initialize the REST service registry with something like the following:
var ServiceConfig = require('dw/svc/ServiceConfig');
var ServiceCredential = require('dw/svc/ServiceCredential');
var ServiceRegistry = require('dw/svc/ServiceRegistry');
var HTTPService = require('dw/svc/HTTPService');
var HTTPClient = require('dw/net/HTTPClient');
var Encoding = require('dw/crypto/Encoding');
var Bytes = require('dw/util/Bytes');
ServiceRegistry.configure("apitest.authorize.net/xml/v1/request.api", {
createRequest: function(svc: HTTPService, args) {
svc.addHeader("Content-Type", "application/x-www-form-urlencoded");
svc.addHeader("Cache-Control", "no-cache");
svc.addHeader("Accept", "application/json");
var serviceConfig: ServiceConfig = svc.getConfiguration();
var credentials: ServiceCredential = serviceConfig.getCredential();
...
svc.setRequestMethod("POST");
return args;
},
parseResponse: function(svc: HTTPService, client: HTTPClient) {
return client;
},
mockCall: function(svc: HTTPService, client: HTTPClient) {}
});
The Authorize.net API methods to be called and the data you would need to post would depend on your type of integration.
Note: There have been a number of changes since Salesforce's aquisition of Demandware last year.