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)
你是在这里申请的商户号么?普通商户号要去调微信支付的接口