支付和广告调试
This commit is contained in:
+31
-12
@@ -14,11 +14,23 @@ import (
|
||||
)
|
||||
|
||||
type PayTypeParam struct {
|
||||
Moneys []int64 `json:"moneys"`
|
||||
DevType string `json:"devType"`
|
||||
ProductType int `json:"productType"` //产品类型 0站群 1棋牌
|
||||
UserLevel int `json:"userLevel"` //限定用户层级 (0默认无等级 1充值成功过的1等级)
|
||||
PlatformID string `json:"platformID"` //平台
|
||||
Moneys []int64 `json:"moneys"`
|
||||
DevType string `json:"devType"`
|
||||
ProductType int `json:"productType"` //产品类型 0站群 1棋牌
|
||||
UserLevel int `json:"userLevel"` //限定用户层级 (0默认无等级 1充值成功过的1等级)
|
||||
PlatformID string `json:"platformID"` //平台
|
||||
DistrictCode string `json:"districtCode"` //用户渠道码 支付中心据此绑定可用支付渠道
|
||||
}
|
||||
|
||||
// BillPlatformID 账单中心平台标识
|
||||
const BillPlatformID = "逼哩逼哩"
|
||||
|
||||
// billDevType 账单中心设备类型,非android按ios处理
|
||||
func billDevType(devType string) string {
|
||||
if devType != "android" {
|
||||
return "ios"
|
||||
}
|
||||
return devType
|
||||
}
|
||||
|
||||
type RchgType struct {
|
||||
@@ -40,13 +52,19 @@ type StdMsg struct {
|
||||
|
||||
// GetPayType 从支付中心获取充值金额对应的充值方式
|
||||
func GetPayType(ctx context.Context, moneys []int64, devType string, productType, userLevel int) ([]RchgType, error) {
|
||||
return GetPayTypeByDistrict(ctx, moneys, devType, productType, userLevel, "")
|
||||
}
|
||||
|
||||
// GetPayTypeByDistrict 从支付中心获取充值金额对应的充值方式(按用户渠道码匹配)
|
||||
func GetPayTypeByDistrict(ctx context.Context, moneys []int64, devType string, productType, userLevel int, districtCode string) ([]RchgType, error) {
|
||||
var errlog string
|
||||
p := PayTypeParam{
|
||||
moneys,
|
||||
devType,
|
||||
productType,
|
||||
userLevel,
|
||||
"91PORN",
|
||||
Moneys: moneys,
|
||||
DevType: billDevType(devType),
|
||||
ProductType: productType,
|
||||
UserLevel: userLevel,
|
||||
PlatformID: BillPlatformID,
|
||||
DistrictCode: districtCode,
|
||||
}
|
||||
res := StdMsg{}
|
||||
code, err := httputil.DefaultClientPostJsonWithResp(&res, p.GetURL(), nil, p.GetBody())
|
||||
@@ -143,14 +161,15 @@ func (this *Rchg) ToPayNew(ctx context.Context) (res RchgMsg, err error) {
|
||||
|
||||
// GetURL 获取请求地址
|
||||
func (this *Rchg) fill() {
|
||||
this.PlatformID = "91PORN"
|
||||
this.PlatformID = BillPlatformID
|
||||
if this.ProductType == 0 {
|
||||
this.TransNo = RChgIDAssemble(this.TransNo)
|
||||
}
|
||||
if this.ProductType == 1 {
|
||||
this.TransNo = RChgWLIDAssemble(this.TransNo)
|
||||
}
|
||||
this.NotifyUrl = appg.Conf.URL.LocalWebUrl + RCHG_NOTIFY_URL + "bill"
|
||||
// 回调路由 /3rd/defray/callback/rchg/:name 挂在 app 服务上
|
||||
this.NotifyUrl = appg.Conf.PayCenter.CallbackUrl + RCHG_NOTIFY_URL + "bill"
|
||||
this.PType = this.PayMethod
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user