ABSTRACT


When testing as part of the development process for certification when working within the Sandbox of IPaaS.com some data collections while the models have been made and IPaaS.com is knowledgeable they exist they must first be mapped.




Process


Any fields you define in the “custom name here” data model will become standard mappable fields.


Following this syntax, you will have made the field available to the user for mappings


[JsonProperty(“3rd party Variable name”, NullValueHandling = NullValueHandling.ignore)]

Public “data Type” “some variable name” {get; set;}

 

EXAMPLE:

These three handle some variables being worked with some being ignored for default mappings but making them readily available to the customer.

 

[JsonProperty(“extension_attributes”)]

Public CatalogDataProductExtensionInterface ExtensionAttributes { get; set;}

 

[JsonIgnore]

Public decimal? StockItemQty { get { return (decimal?)GetStockItemField(“qty”); } set { SetStockItemField(“qty” ,value); } }

 

[JsonIgnore]

Public bool? StockItemInStock { get { return (bool?)GetstockItemField(“is_in_stock”); } set { SetStockItemField(“is_in_stock”, value); } }

 

This last portion will handle any unique portion to an integration while some things are the same some may differ from customer to customer with no way of knowing such as custom fields.

 

[JsonProperty(“custom_attributes”)]

Public List <FrameworkAttributeInterface> Custom Attributes { get; set; }

 

Unique custom fields per customer when done in this manner will be returned by the API as a list

[{“attribute_code”: “Field 1”, “value”: “123”}, {“attribute_code”: “Field 2”, “value”: “abc”} ]

Custom fields once created need to be made inside of IPaaS.com for example...

 

Once inside of the dashboard enter your subscription management --->Subscriptions.

 

 

Click on the Icon for custom fields on your respective integration.


 

  

Create the Custom Field needed


 

 

The field created is then available among the others created to be mapped.


  

EXAMPLE video


Runtime Handling

 

During runtime each custom field mapped will use the CustomFieldHandler

GetValueCustomField when direction is TO IPaaS.com

SetValueCustomField when direction is FROM IPaaS.com

 

Inside of these functions you can handle the way to deal with the data as needed.

For example, below is a function in the custom field handler that is being called to handle the custom attributed design within the model itself.

 

public override object GetValueCustomField(object inputObject, string propertyName)

{

    If (inputObject is CatalogDataProductInterface)

    Return ((CatalogDataProductInterface)inputObject).GetCustomAttribute(propertyName);

}

 

Inside of a data model of relevance

    

Public object GetCustomAttribute(string name) 

{

    If (CustomAttribute == null)

        Return null;

 

    Var customAttribute = CustomAttributes.Find(x => x.AttributeCode == name);

    If (customAttribute == null)

    Return null;

    Return customAttribute.Value;

}