Implementation, Preparing the Application to Transact: Managing Merchant Profiles

Integration Tip! Merchant Profiles are required by payment service providers to process transactions. While Merchant Profiles can be be created and managed programmatically within the application, leveraging the Merchant Profile Management within Commerce Link allows you to manage profile data in a hosted interface while reducing integration times. Contact us for more information.

Common configuration data is stored on behalf of each merchant based on a unique Merchant Profile. When invoking transaction processing operations, Merchant Profiles are accessed to ensure all required common configuration data elements are sent with the transaction.

The following operations are used to facilitate the management of merchant profiles and common configuration data for both SOAP and REST implementations:

Merchant Profile Operations
IsMerchantProfileInitialized GetMerchantProfilesByProfileId
GetMerchantProfile SaveMerchantProfiles
GetMerchantProfileIds DeleteMerchantProfile
GetMerchantProfiles ValidateMerchantProfile

For more information about Managing Merchant Profiles and common configuration data, refer to Managing Merchant Profiles.

Important! All parameters in each operation are considered "required" unless otherwise noted.

 


 

IsMerchantProfileInitialized

The IsMerchantProfileInitialized operation can be used to verify that a specific Merchant Profile has been "initialized" (saved at least once) for a specific Tender Type.

SOAP

Operation

bool IsMerchantProfileInitialized(string sessionToken, string serviceId, string merchantProfileId, TenderType tenderType);

Parameters

Parameter Data Type Description
sessionToken String The short-lived token used to authenticate to CWS.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
merchantProfileId String The specific Merchant Profile to verify.
tenderType TenderType The tender type associated with the Merchant Profile.

Return Type

Data Type Description
Boolean Returns "true" if the Merchant Profile has been initialized.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

Note: The HTTP Authorization Header must contain the required sessionToken value.

PHP Code Sample

public function isMerchantProfileInitialized($merchProfileId, $serviceId)
{
	if (! $this->signOn ())
		return false;
	try
	{
		$mi = new IsMerchantProfileInitialized ();
		$mi->sessionToken = $this->session_token;
		$mi->serviceId = $serviceId;
		$mi->tenderType = 'Credit';
		$mi->merchantProfileId = $merchProfileId;
		$response = $this->serviceInfo->isMerchantProfileInitialized ( $mi );
		//echo ('
'.$this->serviceInfo->__getLastRequest()); //echo ('
'.$this->serviceInfo->__getLastResponse()); return $response; } catch ( SoapFault $e ) { echo 'SERVER ERROR: Error Checking if Merchant Profile is Initialized.
'; $xmlFault = $this->serviceInfo->__getLastResponse (); $errors = handleSvcInfoFault ( $e, $xmlFault ); echo $errors; exit (); } }

C# Code Sample

public bool IsMerchantProfileInitialized(string sessionToken, string serviceId, string merchantProfileId, TenderType tenderType)
{
	using (var client = new CWSServiceInformationClient(ConfigurationManager.AppSetting["Bindings.StsSoap"]))
	{
		try
		{
			return client.IsMerchantProfileInitialized(sessionToken, serviceId, merchantProfileId, tenderType);
		}
		catch (FaultException ex)
		{
			SoapFaultHandler.HandleFaultException(ex);
		}
	}
}

REST

Operation

URL https://api.nabcommerce.com/REST/2.0.18/SvcInfo/merchProfile/{merchantProfileId}/OK?serviceId={serviceId}
Action GET

Parameters

Parameter Data Type Description
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
merchantProfileId String The specific Merchant Profile to verify. Required.

Message Body Type

None.

Return Type

Data Type Description
Boolean Returns "true" if the supplied Merchant Profile has been previously initialized (saved at least once).

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

PHP Code Sample

public function isMerchantProfileInitialized($merchProfileId, $serviceId)
{
	if (! $this->signOn ())
		return false;
 
	$msgBody = '';
	$url = $this->svcInfo.'/merchProfile/'.$merchProfileId.'/OK?serviceId='.$serviceId;
	$action = 'GET';
	$response = curl_json($msgBody, $url, $action, $this->session_token);
	if(isset($response->body->ErrorId))
	{
		handleRestFault($response);
		return false;
	}
	if(isset($response[0]))
		return $response[0];
	return false;
}

C# Code Sample

public bool IsMerchantProfileInitialized(string sessionToken, string serviceId, string merchantProfileId, TenderType tenderType)
{
	var isJson = string.Equals(_msgFormat, MessageFormat.JSON.ToString());
	// No body is required for GetServiceInformation in the HttpWebRequest.
	var requestString = RestBaseUri + "/merchProfile/" + merchantProfileId + "/OK?serviceId=" + serviceId;
 
	HttpWebRequest request = WebRequest.Create(requestString) as HttpWebRequest;
	request.Method = HttpMethod.GET.ToString();
	request.Credentials = new NetworkCredential(sessionToken, "");
 
	request.ContentType = isJson ? "application/json" : "application/xml";
	try
	{
		return Boolean.Parse(RestHelper.GetResponse(request, isJson));
	}
	catch(Exception ex)
	{
		RestFaultHandler.HandleFaultException(ex, isJson);
	}
}

 


 

GetMerchantProfile

The GetMerchantProfile operation retrieves a specific Merchant Profile and associated profile data (MerchantProfile) for a specific Service ID and Tender Type. To retrieve all profiles in a list, refer to the GetMerchantProfiles operation.

SOAP

Operation

MerchantProfile GetMerchantProfile(string sessionToken, string merchantProfileId, string serviceId, TenderType tenderType);

Parameters

Parameter Data Type Description
sessionToken String The short-lived token used to authenticate to CWS.
merchantProfileId String The specific Merchant Profile to retrieve.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
Note: Not specifying the serviceId will return all merchantProfileIds associated with all serviceIds.
tenderType TenderType The tender type associated with the Merchant Profile.

Return Type

Data Type Description
MerchantProfile The requested Merchant Profile and associated profile data.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

Note: The HTTP Authorization Header must contain the required sessionToken value.

PHP Code Sample

public function getMerchantProfile($svcId, $merchProfId, $tndrType)
{
	if (! $this->signOn ())
		return false;
	try
	{
		$mp = new GetMerchantProfile ();
		$mp->sessionToken = $this->session_token;
		$mp->serviceId = $svcId;
		$mp->merchantProfileId = $merchProfId;
		$mp->tenderType = $tndrType;
		$response = $this->serviceInfo->GetMerchantProfile ( $mp );
		return $response->GetMerchantProfilesResult->MerchantProfile;
	}
	catch ( SoapFault $e )
	{
		echo 'SERVER ERROR: Error Retrieving Merchant Profiles.
'; $xmlFault = $this->serviceInfo->__getLastResponse (); $errors = handleSvcInfoFault ( $e, $xmlFault ); echo $errors; exit (); } }

REST

Operation

URL https://api.nabcommerce.com/REST/2.0.18/SvcInfo/merchProfile/{merchantProfileId}/?serviceId={serviceId}
Action GET

Parameters

Parameter Data Type Description
merchantProfileId String The specific Merchant Profile to retrieve.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
Note: Not specifying the serviceId will return all merchantProfileIds associated with all serviceIds.

Message Body Type

None.

Return Type

Data Type Description
MerchantProfile The requested Merchant Profile.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

 

PHP Code Sample

public function getMerchantProfile($svcId, $merchProfId)
{
	if (! $this->signOn ())
		return false;
 
	$msgBody = '';
	$url = $this->svcInfo.'/merchProfile/'.$merchProfId.'?serviceId='.$svcId;
	$action = 'GET';
	$response = curl_json($msgBody, $url, $action, $this->session_token);
	if(isset($response->body->ErrorId))
	{
		handleRestFault($response);
		return false;
	}
	if(isset($response[2]))
		return $response[2];
	return false;
}

 


 

GetMerchantProfiles

The GetMerchantProfiles operation retrieves all merchantProfileId's and associated profile data (MerchantProfile) for a specific Service ID and Tender Type. This is useful in multi-merchant application scenarios to allow for the update of a specific Merchant Profile by passing the merchantProfileId with the GetMerchantProfile operation.

SOAP

Operation

List GetMerchantProfiles(string sessionToken, string serviceId, TenderType tenderType);

Parameters

Parameter Data Type Description
sessionToken String The short-lived token used to authenticate to CWS.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
Note: Not specifying the serviceId will return all merchantProfileIds associated with all serviceIds.
tenderType TenderType The tender type associated with the Merchant Profile.

Return Type

Data Type Description
List<MerchantProfile> A collection of Merchant Profiles with associated profile data.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

Note: The HTTP Authorization Header must contain the required sessionToken value.

PHP Code Sample

public function getMerchantProfiles($svcId, $tndrType)
{
	if (! $this->signOn ())
		return false;
	try
	{
		$mp = new GetMerchantProfiles ();
		$mp->sessionToken = $this->session_token;
		$mp->serviceId = $svcId;
		$mp->tenderType = $tndrType;
		$response = $this->serviceInfo->GetMerchantProfiles ( $mp );
		//echo ('
'.$this->serviceInfo->__getLastRequestHeaders()); //echo ('
'.$this->serviceInfo->__getLastRequest()); //echo ('
'.$this->serviceInfo->__getLastResponseHeaders()); //echo ('
'.$this->serviceInfo->__getLastResponse()); return $response->GetMerchantProfilesResult->MerchantProfile; } catch ( SoapFault $e ) { echo 'SERVER ERROR: Error Retrieving Merchant Profiles.
'; $xmlFault = $this->serviceInfo->__getLastResponse (); $errors = handleSvcInfoFault ( $e, $xmlFault ); echo $errors; exit (); } } /* Return only the Merchant Profile Id */ public function getMerchantProfileId() { $response = $this->getMerchantProfiles (); if ($response) return $response->GetMerchantProfilesResult->MerchantProfile->ProfileId; return false; }

C# Code Sample

public List GetMerchantProfiles(string sessionToken, string serviceId, TenderType tenderType, string merchantProfileId = null)
{
	using (var client = new CWSServiceInformationClient(ConfigurationManager.AppSettings["Bindings.StsSoap"]))
	{
		try
		{
			return client.GetMerchantProfiles(sessionToken, serviceId, tenderType).ToList();
		}
		catch (FaultException ex)
		{
			SoapFaultHandler.HandleFaultException(ex);
		}
	}
}

REST

Operation

URL To return all Merchant Profiles by serviceId:

https://api.nabcommerce.com/REST/2.0.18/SvcInfo/merchProfile?serviceId={serviceId}

To return all Merchant Profiles by merchantProfileId (across multiple services):

https://api.nabcommerce.com/REST/2.0.18/SvcInfo/merchProfile?merchantProfileId={merchantProfileId}
Action GET

Parameters

Parameter Data Type Description
merchantProfileId String The Merchant Profiles to retrieve.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
Note: Not specifying the serviceId will return all merchantProfileIds associated with all serviceIds.

Message Body Type

None.

Return Type

Data Type Description
List<MerchantProfileId> The list of all merchantProfileIds.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

PHP Code Sample

public function getMerchantProfiles($svcId, $tndrType)
{
	if (! $this->signOn ())
		return false;
 
	$msgBody = '';
	//if($svcId != '' || $svcId != null || )
		$url = $this->svcInfo.'/merchProfile?serviceId='.$svcId;
	//else
		//$url = $this->svcInfo.'/merchProfile?merchantProfileId='.$merchantProfileID;
	$action = 'GET';
	$response = curl_json($msgBody, $url, $action, $this->session_token);
	if(isset($response->body->ErrorId))
	{
		handleRestFault($response);
		return false;
	}
	if(isset($response[2]))
		return $response[2];
	return false;
}

C# Code Sample

public List GetMerchantProfiles(string sessionToken, string serviceId, TenderType tenderType, string merchantProfileId = null)
{
	var isJson = string.Equals(_msgFormat, MessageFormat.JSON.ToString());
 
	// For REST, to return all Merchant Profiles by merchantProfileId. Otherwise return all Merchant Profiles by serviceId. 
	var requestString = "";
	if(!string.IsNullOrEmpty(merchantProfileId))
		requestString = RestBaseUri + "/merchProfile?merchantProfileId=" + merchantProfileId;
	else
		requestString = RestBaseUri + "/merchProfile?serviceId=" + serviceId;
 
	HttpWebRequest request = WebRequest.Create(requestString) as HttpWebRequest;
	request.Method = HttpMethod.GET.ToString();
	request.Credentials = new NetworkCredential(sessionToken, "");
 
	request.ContentType = isJson ? "application/json" : "application/xml";
	// You'll need to use the Rest merchant profile Id Data Contract for serializing. This is then converted to use the standard data contract.
	var restMerchProfiles = new List();
	try
	{
		restMerchProfiles = RestHelper.GetResponseList(request, isJson);
	}
	catch (Exception ex)
	{
		RestFaultHandler.HandleFaultException(ex, isJson);
	}
	
	var merchProfiles = new List();
	foreach (var rmp in restMerchProfiles)
	{
		var mp = new MerchantProfile();
		mp.ProfileId = rmp.id;
		mp.ServiceId = rmp.href.Split('=')[1];
		merchProfiles.Add(mp);
	}
	return merchProfiles;
}

 


 

GetMerchantProfileIds

The GetMerchantProfileIds operation retrieves a list of all merchantProfileId’s associated with a specific Service ID and Tender Type, without returning any merchant profile data (MerchantProfile).

 Once retrieved, the application should invoke either GetMerchantProfile or GetMerchantProfiles to retrieve profile data associated with specific merchantProfileId’s.

Note: The GetMerchantProfileIds operation is not available for REST implementations.

SOAP

Operation

List GetMerchantProfileIds(string sessionToken, string serviceId, TenderType tenderType);

Parameters

Parameter Data Type Description
sessionToken String The short-lived token used to authenticate to CWS.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
Note: Not specifying the serviceId will return all merchantProfileIds associated with all serviceIds.
tenderType TenderType The tender type associated with the Merchant Profile.

Return Type

Data Type Description
List A list of Merchant Profiles only.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

Not applicable to REST implementations.

 


 

GetMerchantProfilesByProfileId

The GetMerchantProfilesByProfileId operation retrieves all merchant-specific Merchant Profiles and associated profile data (MerchantProfile) by merchantProfileId.

SOAP

Operation

List GetMerchantProfilesByProfileId(string sessionToken, string merchantProfileId);

Parameters

Parameter Data Type Description
sessionToken String The short-lived token used to authenticate to CWS.
merchantProfileId String The specific Merchant Profile to retrieve.

Return Type

Data Type Description
List<MerchantProfile> A list of merchant-specific Merchant Profiles with associated profile data.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

Not applicable to REST implementations.

 


 

SaveMerchantProfiles

The SaveMerchantProfiles operation is used to save one or more Merchant Profiles for a specific Tender type.

Note: When defining a merchantProfileId, only the following characters are allowed:

[Space]#&'(),-./0123456789:@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]_abcdefghijklmnopqrstuvwxyz

SOAP

Operation

void SaveMerchantProfiles(string sessionToken, string serviceId, TenderType tenderType, List merchantProfiles);

Parameters

Parameter Data Type Description
sessionToken String The short-lived token used to authenticate to CWS.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
tenderType TenderType The tender type associated with the Merchant Profile.
merchantProfiles List<MerchantProfile> The collection of Merchant Profiles to be saved.

Return Type

None.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

Note: The HTTP Authorization Header must contain the required sessionToken value.

PHP Code Sample

public function saveMerchantProfiles($merchantProfile, $tenderType, $serviceId)
{
	if (! $this->signOn ())
		return false;
	try
	{
		$mp = new merchantProfiles ();
		$mp->MerchantProfile = $merchantProfile;
 
		$smp = new SaveMerchantProfiles ();
		$smp->sessionToken = $this->session_token;
		$smp->serviceId = $serviceId;
		$smp->tenderType = $tenderType;
		$smp->merchantProfiles = $mp;
		$response = $this->serviceInfo->SaveMerchantProfiles ( $smp );
		//echo ('
'.$this->serviceInfo->__getLastRequestHeaders()); //echo ('
'.$this->serviceInfo->__getLastRequest()); //echo ('
'.$this->serviceInfo->__getLastResponseHeaders()); //echo ('
'.$this->serviceInfo->__getLastResponse()); return $response; } catch ( SoapFault $e ) { echo '
SERVER ERROR: Error Saving Merchant Profiles.
'; //echo ('
'.$this->serviceInfo->__getLastRequest()); //echo ('
'.$this->serviceInfo->__getLastResponse()); $xmlFault = $this->serviceInfo->__getLastResponse (); $errors = handleSvcInfoFault ( $e, $xmlFault ); echo $errors; //echo $xmlFault; exit (); } }

C# Code Sample

public void SaveMerchantProfiles(string sessionToken, string serviceId, TenderType tenderType, List merchantProfiles)
{
	using (var client = new CWSServiceInformationClient(ConfigurationManager.AppSettings["Bindings.StsSoap"]))
	{
		try
		{
			// Referencing the STS service directly requires the merchant profiles to be in an array instead of type List. 
			// When generating proxies from the WSDL you can specify to use lists instead of arrays.
			client.SaveMerchantProfiles(sessionToken, serviceId, tenderType, merchantProfiles.ToArray());
		}
		catch (FaultException ex)
		{
			SoapFaultHandler.HandleFaultException(ex);
		}
	}
}

REST

Operation

URL https://api.nabcommerce.com/REST/2.0.18/SvcInfo/merchProfile?serviceId={serviceId}
Action PUT

Parameters

Parameter Data Type Description
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.

Message Body Type

Data Type Description
List<MerchantProfile> The collection of Merchant Profiles to save.

Return Type

None.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

PHP Code Sample

public function saveMerchantProfiles($merchantProfile, $tenderType, $serviceId)
{
	if (! $this->signOn ())
		return false;
 
	$msgBody = new stdClass();
	$msgBody->typeHOLDER = 'REPLACE'; // The beginning of the JSON msg needs $type and the schema location replaced below.
	$msgBody->ProfileId = $merchantProfile->ProfileId;
	$msgBody->ServiceId = $serviceId;
	$msgBody->ServiceName = $merchantProfile->ServiceName;
	$msgBody->LastUpdated = $merchantProfile->LastUpdated;
	$msgBody->MerchantData = $merchantProfile->MerchantData;
	$msgBody->TransactionData = $merchantProfile->TransactionData;
	$action = 'PUT';
	$url = $this->svcInfo.'/merchProfile?serviceId='.$serviceId;
 
	// Format the message
	$msgBody = (string)json_encode($msgBody);
	$msgBody = str_replace('typeHOLDER', '$type', $msgBody);
	$msgBody = str_replace('REPLACE', "MerchantProfile, http://schemas.nabcommerce.com/CWS/v2.0/ServiceInformation", $msgBody);
	$msgBody = '['.$msgBody.']';
	$response = curl_json($msgBody, $url, $action, $this->session_token);
	if(isset($response->body->ErrorId))
	{
		handleRestFault($response);
		return false;
	}
	if(isset($response[2]))
		return $response[2][0];
}

C# Code Sample

public void SaveMerchantProfiles(string sessionToken, string serviceId, TenderType tenderType, List merchantProfiles )
{
	var isJson = string.Equals(_msgFormat, MessageFormat.JSON.ToString());
	var requestString = RestBaseUri + "/merchProfile?serviceId=" + serviceId;
 
	var request = RestHelper.CreateRestRequest(merchantProfiles, requestString, HttpMethod.PUT, sessionToken, isJson);
	try
	{
		RestHelper.GetResponse(request, isJson);
	}
	catch(Exception ex)
	{
		RestFaultHandler.HandleFaultException(ex, isJson);
	}
}

 


 

DeleteMerchantProfile

The DeleteMerchantProfile operation is used to delete one or more Merchant Profiles (for a specific Tender Type).

SOAP

Operation

void DeleteMerchantProfile(string sessionToken, string merchantProfileId, string serviceId, TenderType tenderType);

Parameters

Parameter Data Type Description
sessionToken String The short-lived token used to authenticate to CWS.
merchantProfileId String The specific Merchant Profile to delete.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
tenderType TenderType The tender type associated with the Merchant Profile.

Return Type

None.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

Note: The HTTP Authorization Header must contain the required sessionToken value.

C# Code Sample

public void DeleteMerchantProfile(string sessionToken, string serviceId, string merchantProfileId, TenderType tenderType)
{
	using (var client = new CWSServiceInformationClient(ConfigurationManager.AppSettings["Bindings.StsSoap"]))
	{
		try
		{
			client.DeleteMerchantProfile(sessionToken, merchantProfileId, serviceId, tenderType);
		}
		catch (FaultException ex)
		{
			SoapFaultHandler.HandleFaultException(ex);
		}
	}
}

REST

Operation

URL https://api.nabcommerce.com/REST/2.0.18/SvcInfo/merchProfile/{merchantProfileId}/?serviceId={serviceId}
Action DELETE

Parameters

Parameter Data Type Description
merchantProfileId String The specific Merchant Profile(s) to delete.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.

Message Body Type

None.

Return Type

None.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

C# Code Sample

public void DeleteMerchantProfile(string sessionToken, string serviceId, string merchantProfileId, TenderType tenderType)
{
	var isJson = string.Equals(_msgFormat, MessageFormat.JSON.ToString());
	// No body is required for GetServiceInformation in the HttpWebRequest.
	var requestString = RestBaseUri + "/merchProfile/" + merchantProfileId + "?serviceId=" + serviceId;
 
	HttpWebRequest request = WebRequest.Create(requestString) as HttpWebRequest;
	request.Method = HttpMethod.DELETE.ToString();
	request.Credentials = new NetworkCredential(sessionToken, "");
 
	request.ContentType = isJson ? "application/json" : "application/xml";
	try
	{
		RestHelper.GetResponse(request, isJson);
	}
	catch(Exception ex)
	{
		RestFaultHandler.HandleFaultException(ex, isJson);
	}
}

 


 

ValidateMerchantProfile

The ValidateMerchantProfile operation is used to validate the provided merchant profile data in Unmanaged Merchant Profile (UMP) implementations.

Note: If the application will not support UMP, you do not need to call ValidateMerchantProfile. Your merchant profile will automatically be validated when invoking the SaveMerchantProfiles operation.

SOAP

Operation

void ValidateMerchantProfile(string sessionToken, string serviceId, TenderType tenderType, MerchantProfile merchantProfile);

Parameters

Parameter Data Type Description
sessionToken String The short-lived token used to authenticate to CWS.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.
tenderType TenderType The tender type associated with the Merchant Profile.
merchantProfile MerchantProfile The merchant profile data to include with each transaction.

Return Type

None.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

Note: The HTTP Authorization Header must contain the required sessionToken value.

REST

Operation

URL https://api.nabcommerce.com/REST/2.0.18/SvcInfo/merchProfile/validate
Action POST

Parameters

Parameter Data Type Description
merchantProfile MerchantProfile The merchant profile data to include with each transaction.
serviceId String Unique identifier for available services returned in the ServiceInformation object when invoking the GetServiceInformation operation.

Message Body Type

Data Type Description
MerchantProfile The Merchant Profile data to validate.

Return Type

None.

Exceptions

CWSFault AuthenticationFault
ExpiredTokenFault CWSServiceInformationUnavailableFault
InvalidTokenFault CWSValidationResultFault

For additional details about each fault, refer to Service Information Faults in the CWS Developer API Reference.

Comments