28 lines
820 B
Go
28 lines
820 B
Go
package do
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"rs/cmd/api/internal/svc"
|
|
"rs/cmd/api/internal/types"
|
|
)
|
|
|
|
func NotifyInfo(req any, SipOrderNo string, svcCtx *svc.ServiceContext, ctx context.Context) (notify types.NotifyTypes, requestBody map[string]string, err error) {
|
|
requestBody = make(map[string]string, 3)
|
|
reqJson, _ := json.Marshal(req)
|
|
_ = json.Unmarshal(reqJson, &requestBody)
|
|
orderInfo, err := svcCtx.TransferOrder.FindByOutBizNo(ctx, SipOrderNo)
|
|
if err != nil {
|
|
return notify, requestBody, err
|
|
}
|
|
merchantInfo, err := svcCtx.MerchantWechat.FindOneByMerchantId(ctx, orderInfo.VoucherNum)
|
|
if err != nil {
|
|
return notify, requestBody, err
|
|
}
|
|
err = json.Unmarshal([]byte(merchantInfo.NotifyUrl.String), ¬ify)
|
|
if err != nil {
|
|
return notify, requestBody, err
|
|
}
|
|
return notify, requestBody, err
|
|
}
|