The code assumes that there is always a "metadata" key in the appdata dictionary. This is not always the case; see e.g, this order. In such cases, the script produces an error
if "partnerFee" in app_data["metadata"].keys():
~~~~~~~~^^^^^^^^^^^^
KeyError: 'metadata'
The code assumes that there is always a "metadata" key in the appdata dictionary. This is not always the case; see e.g, this order. In such cases, the script produces an error
This PR addresses this.