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.token
file.
- 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\" \"http://MN_IP_Address:8080/aps/2/resources?implementing(http://www.odin.com/rde/global-data-set/1)\" " eval $cmd2 printf '\n'
Note:
-MN_IP_Address:8080
is the IP address of the management node. Replace it with the appropriate value.
-http://www.odin.com/rde/global-data-set/1
is 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/bin
directory. Run the
get.payment.sh
script 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.json
file. 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.1
for this example. -
Create the following file:
update.payment.shrde_json="`cat payment.json`" aps_token="`cat aps.token`" md="curl -v -X PUT -H \"APS-Token: $aps_token\" --data-binary '"$rde_json"' \"http://MN_IP_Address:8080/aps/2/resources/Data_Set_ID\" " echo $cmd eval $cmd printf '\n'
Note:
-MN_IP_Address:8080
is the IP address of the management node. Replace it with the appropriate value.
-Data_Set_ID
is 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/bin
directory:payment.json
update.payment.sh
aps.token
- Run the
update.payment.sh
script to update the payment data set.Note: If the APS token created on Step 1 already expired, update the
aps.token
file with a new token and rerun the script.