Example: Customizing the Payments Data Set
To update the Payments tile title or description, or to add or delete any locale for the tile of the enabled data set, perform the following steps:
- Get an APS token of the provider:
- Log in to the Operations PCP.
- Go to System > Settings > User APS tokens > admin.
- Copy the displayed text and paste it in the newly created
aps.tokenfile.
- Get the ID of the current data set:
Create the following file:
get.payment.shaps_token="`cat aps.token`" cmd="curl -s -X GET -H \"APS-Token: $aps_token\" \"https://brand_domain/aps/2/resources?implementing(http://www.odin.com/rde/global-data-set/1)\" " eval $cmd2 printf '\n'
Note:
-brand_domainis the branded domain name, for example: brand.com
-http://www.odin.com/rde/global-data-set/1is the APS resource type that was used for data set enabling. See this example.- Save these two files on the CloudBlue Commerce management node, for example, in the
/usr/local/bindirectory. Run the
get.payment.shscript to output the payment data set ID.
Output example:[ { "aps": { "modified": "2019-09-16T10:37:42Z", "id": "44b72ab9-473e-4041-a833-f9ca976efc8e", "type": "http://www.odin.com/rde/global-data-set/1.0", "status": "aps:ready", "revision": 4 }, "dataSetType": "payment", ...
-
Create or update the text in your existing
payment.jsonfile. Use this example for reference.Important: Increase the APS resource type version in this file; it must be
http://www.odin.com/rde/global-data-set/1.1for this example. -
Create the following file:
update.payment.sh
rde_json="`cat payment.json`" aps_token="`cat aps.token`" md="curl -v -X PUT -H \"APS-Token: $aps_token\" --data-binary '"$rde_json"' \"https://brand_domain/aps/2/resources/Data_Set_ID\" " echo $cmd eval $cmd printf '\n'
Note:
-brand_domainis the branded domain name, for example: brand.com
-Data_Set_IDis the ID of the current data set found on Step 2. Replace it with the appropriate value. - Save the following three files on the CloudBlue Commerce management node, for example, in the
/usr/local/bindirectory:payment.jsonupdate.payment.shaps.token
- Run the
update.payment.shscript to update the payment data set.Note: If the APS token created on Step 1 already expired, update the
aps.tokenfile with a new token and rerun the script.