diff --git a/ucloud-pay.py b/ucloud-pay.py index 2b8e33d..cf7011d 100644 --- a/ucloud-pay.py +++ b/ucloud-pay.py @@ -227,14 +227,14 @@ class ProductOrder(Resource): # Validate the given product is ok product_id = data["product_id"] - product = client.get_prefix( - "/v1/products/{}/".format(product_id), value_in_json=True + product = client.get( + "/v1/products/{}".format(product_id), value_in_json=True ) if not product: - logging.debug("User chose invalid product {}".format(product)) + logging.debug("User chose invalid product {}".format(product_id)) return {"message": "Invalid product"}, 400 - logging.debug("Got product {}".format(str(product))) + logging.debug("Got product {}: {}".format(product.key, product.value)) # Check the user has a payment source added