PBA allows to change status of an order via Public API according the defined order flow using the OrderStatusChange_API method. The method itself is described in PBA documentation and requires the Signature parameter, which is MD5 sum of concatenated order details:
- Order ID
- Order number
- Creation time
- Total amount
The order details listed above may be obtained with the help of the GetOrder_API PBA API method, it returns XML document which has to be carefully parsed to generate signature for the OrderStatusChange_API method. It may take much time to generate correct signature manually.
Use the instruction below and the attached Python script to automate process of generating signature for the OrderStatusChange_API method.
Download the attached Python script signature.py.
Run the script, pass an order ID as an argument:
# python signature.py 10653 91519941f7f39798100b11a0d165747a
By default localhost is used as an entry point, if you run the script from host other than PBA application server or xmlrpcd is not setup to listen on 127.0.0.1, pass the correct URL as the second argument:
# python signature.py 10628 http://10.39.94.72:5224/RPC2 d3f7c3a5d4e40e613a088074d71b4248
- Output of the script (seen in the examples above) is the signature that should be used in the OrderStatusChange_API method.
- Script can be run on any host with python > 2.5.
python signature.py OrderID [http://PBA.XMLRPCD.IP:5224/RPC2>]
where OrderID is an obligatory argument,
http://PBA.XMLRPCD.IP:5224/RPC2shall be passed when the script is executed from the host other than PBA application server or xmlrpcd is not listened on 127.0.0.1:5224.
- If run on the pba application server, the script automatically detects the price precision (taken from /usr/local/stellart/share/currencies.txt) and generates the signature accordingly. If run from other host, the default precision (2) is used.