Skip to content

Commit

Permalink
udpate
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Jun 27, 2024
1 parent eca3b34 commit 979e7e7
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 1 deletion.
23 changes: 23 additions & 0 deletions alipay/merchant_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
39 changes: 39 additions & 0 deletions alipay/model_merchant.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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"`
}
2 changes: 1 addition & 1 deletion constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const (
OK = "OK"
DebugOff = 0
DebugOn = 1
Version = "1.5.101"
Version = "1.5.102"
)

type DebugSwitch int8
8 changes: 8 additions & 0 deletions doc/alipay.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ xlog.Infof("%+v", phone)
* <font color='#027AFF' size='4'>安全产品</font>
* 交易安全防护
* 商户数据同步:`client.SecurityCustomerRiskSend()`
* RiskGO
* 消费者投诉
* 处理消费者投诉接口:https://opendocs.alipay.com/open/da75e1ec_alipay.security.risk.complaint.process.finish
*
* <font color='#027AFF' size='4'>广告产品</font>
* 支付宝广告投放
* 转化数据回传接口:https://opendocs.alipay.com/open/3940a105_alipay.data.dataservice.ad.conversion.upload
Expand Down Expand Up @@ -516,6 +520,10 @@ xlog.Infof("%+v", phone)
* 加入信用服务: `clinet.ZhimaCreditEpSceneAgreementUse()`
* 取消信用服务: `client.ZhimaCreditEpSceneAgreementCancel()`
* 信用服务履约同步(批量): `client.ZhimaCreditEpSceneFulfillmentlistSync()`
* <font color='#027AFF' size='4'>邀测站点</font>
* 营销咨询
* 商户前置内容咨询接口: `client.PayAppMarketingConsult()`
*

### 支付宝公共 API

Expand Down
10 changes: 10 additions & 0 deletions release_note.txt
Original file line number Diff line number Diff line change
@@ -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。
Expand Down

0 comments on commit 979e7e7

Please sign in to comment.