fix:支付

This commit is contained in:
momo 2023-09-25 17:06:12 +08:00
parent 5be1edfa71
commit 3c094cf201

View File

@ -57,12 +57,15 @@ func (l *StripeWebhookLogic) StripeWebhook(req *types.StripeWebhookReq, userinfo
logc.Errorf(l.ctx, "StripeWebhookLogic StripeWebhook Unmarshal err:%v", err)
return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "pay notify Unmarshal fail")
}
// fmt.Println(req)
// fmt.Println(event)
endpointSecret := l.svcCtx.Config.PayConfig.Stripe.EndpointSecret
signatureHeader := req.StripeSignature
fmt.Println(endpointSecret)
event, err := webhook.ConstructEvent(req.Payload, signatureHeader, endpointSecret)
if err != nil {
logx.Error(err)
logc.Errorf(l.ctx, "webhook.ConstructEvent err:%v", err)
return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "Webhook signature verification failed")
}