From 979e7e7211e0c72d8dd52e6d8478b075b1611241 Mon Sep 17 00:00:00 2001 From: Jerry <85411418@qq.com> Date: Thu, 27 Jun 2024 17:56:20 +0800 Subject: [PATCH] udpate --- alipay/merchant_api.go | 23 +++++++++++++++++++++++ alipay/model_merchant.go | 39 +++++++++++++++++++++++++++++++++++++++ constant.go | 2 +- doc/alipay.md | 8 ++++++++ release_note.txt | 10 ++++++++++ 5 files changed, 81 insertions(+), 1 deletion(-) diff --git a/alipay/merchant_api.go b/alipay/merchant_api.go index 4e49ff5e..311233fe 100644 --- a/alipay/merchant_api.go +++ b/alipay/merchant_api.go @@ -214,3 +214,26 @@ func (a *Client) SecurityCustomerRiskSend(ctx context.Context, bm gopay.BodyMap) aliRsp.SignData = signData return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr) } + +// alipay.pay.app.marketing.consult(商户前置内容咨询接口) +// 文档地址:https://opendocs.alipay.com/pre-open/296d225f_alipay.pay.app.marketing.consult +func (a *Client) PayAppMarketingConsult(ctx context.Context, bm gopay.BodyMap) (aliRsp *PayAppMarketingConsultRsp, err error) { + err = bm.CheckEmptyError("biz_scene", "total_amount", "product_code") + if err != nil { + return nil, err + } + var bs []byte + if bs, err = a.doAliPay(ctx, bm, "alipay.pay.app.marketing.consult"); err != nil { + return nil, err + } + aliRsp = new(PayAppMarketingConsultRsp) + if err = json.Unmarshal(bs, aliRsp); err != nil || aliRsp.Response == nil { + return nil, fmt.Errorf("[%w], bytes: %s", gopay.UnmarshalErr, string(bs)) + } + if err = bizErrCheck(aliRsp.Response.ErrorResponse); err != nil { + return aliRsp, err + } + signData, signDataErr := a.getSignData(bs, aliRsp.AlipayCertSn) + aliRsp.SignData = signData + return aliRsp, a.autoVerifySignByCert(aliRsp.Sign, signData, signDataErr) +} diff --git a/alipay/model_merchant.go b/alipay/model_merchant.go index 9d05aacf..5efaad16 100644 --- a/alipay/model_merchant.go +++ b/alipay/model_merchant.go @@ -63,6 +63,13 @@ type SecurityCustomerRiskSendRsp struct { Sign string `json:"sign"` } +type PayAppMarketingConsultRsp struct { + Response *PayAppMarketingConsult `json:"alipay_pay_app_marketing_consult_response"` + AlipayCertSn string `json:"alipay_cert_sn,omitempty"` + SignData string `json:"-"` + Sign string `json:"sign"` +} + // =========================================================分割========================================================= type TradeRelationBind struct { @@ -131,3 +138,35 @@ type TradeRoyaltyRateQuery struct { type SecurityCustomerRiskSend struct { ErrorResponse } + +type PayAppMarketingConsult struct { + ErrorResponse + PreConsultId string `json:"pre_consult_id"` + ChannelInfoList []*ChannelInfo `json:"channel_info_list"` + ConfusedCipherList []string `json:"confused_cipher_list"` + BlindSignature string `json:"blind_signature"` +} + +type ChannelInfo struct { + ChannelIndex string `json:"channel_index"` + ChannelName string `json:"channel_name"` + ChannelEnable bool `json:"channel_enable"` + ChannelCode string `json:"channel_code"` + ChannelLogo string `json:"channel_logo"` + ChannelOperationInfo string `json:"channel_operation_info"` + OperationList []*Operation `json:"operation_list"` +} + +type Operation struct { + SceneCode string `json:"scene_code"` + ViewData *ViewData `json:"view_data"` +} + +type ViewData struct { + OperationTip string `json:"operation_tip"` + OperationDesc string `json:"operation_desc"` + PromoType string `json:"promo_type"` + PromoPrice string `json:"promo_price"` + ThresholdAmount string `json:"threshold_amount"` + PayOperationInfo string `json:"pay_operation_info"` +} diff --git a/constant.go b/constant.go index 817acf5e..dd6393e8 100644 --- a/constant.go +++ b/constant.go @@ -7,7 +7,7 @@ const ( OK = "OK" DebugOff = 0 DebugOn = 1 - Version = "1.5.101" + Version = "1.5.102" ) type DebugSwitch int8 diff --git a/doc/alipay.md b/doc/alipay.md index 3ec83cc3..1aa1c9cf 100644 --- a/doc/alipay.md +++ b/doc/alipay.md @@ -464,6 +464,10 @@ xlog.Infof("%+v", phone) * 安全产品 * 交易安全防护 * 商户数据同步:`client.SecurityCustomerRiskSend()` + * RiskGO + * 消费者投诉 + * 处理消费者投诉接口:https://opendocs.alipay.com/open/da75e1ec_alipay.security.risk.complaint.process.finish + * * 广告产品 * 支付宝广告投放 * 转化数据回传接口:https://opendocs.alipay.com/open/3940a105_alipay.data.dataservice.ad.conversion.upload @@ -516,6 +520,10 @@ xlog.Infof("%+v", phone) * 加入信用服务: `clinet.ZhimaCreditEpSceneAgreementUse()` * 取消信用服务: `client.ZhimaCreditEpSceneAgreementCancel()` * 信用服务履约同步(批量): `client.ZhimaCreditEpSceneFulfillmentlistSync()` +* 邀测站点 + * 营销咨询 + * 商户前置内容咨询接口: `client.PayAppMarketingConsult()` + * ### 支付宝公共 API diff --git a/release_note.txt b/release_note.txt index 301dfb30..4f2d43df 100644 --- a/release_note.txt +++ b/release_note.txt @@ -1,3 +1,13 @@ +版本号:Release 1.5.102 +修改记录: + (1) 支付宝:新增 client.PayAppMarketingConsult(),商户前置内容咨询接口。 + (2) 支付宝:新增 + (3) 支付宝:新增 + (4) 支付宝:新增 + (5) 支付宝:新增 + (6) 支付宝:新增 + (7) 支付宝:新增 + 版本号:Release 1.5.101 修改记录: (1) gopay:golang.org/x/crypto v0.20.0 版本升级到 v0.23.0。