微信小程序退款接口,报错48001 api unauthorized?
response = requests.get(f'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={WX_APP_ID}&secret={WX_APP_SECRET}') access_token = json.loads(response.text).get('access_token') data = { "openid": orderItem.openid, "mchid": WX_MERCHAT, "trade_no": orderItem.ordersn, "transaction_id": orderItem.transaction_id, "refund_no": orderItem.refund_no, "total_amount": orderItem.totalPirce, "refund_amount": orderItem.refund_amount } response2 = requests.post(f'https://api.weixin.qq.com/shop/pay/refundorder?access_token={access_token}',json=data)