收藏
回答

微信小程序退款接口,报错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)


回答关注问题邀请回答
收藏

1 个回答

  • Memory
    Memory
    星期四 13:25

    你是在这里申请的商户号么?普通商户号要去调微信支付的接口

    星期四 13:25
    有用
    回复
登录 后发表内容