黄梓健
5 years ago
19 changed files with 360 additions and 286 deletions
-
2controllers/client/bully_screen.go
-
3controllers/client/lottery.go
-
2controllers/client/reward.go
-
6controllers/client/wx.go
-
2controllers/pc/activity.go
-
8libs/wechat/wx.go
-
32libs/wx/code.go
-
44libs/wx/params.go
-
70libs/wx/pay.go
-
9libs/wx/wx.go
-
16services/lottery/lottery.go
-
3services/pay/client.go
-
141services/pay/const.go
-
105services/pay/handle.go
-
101services/pay/order.go
-
16services/pay/order_test.go
-
17services/pay/transfer.go
-
2test/pay_test.go
-
67utils/define/define.go
@ -1,32 +0,0 @@ |
|||
package wx |
|||
|
|||
const CODE_SUCCESS = "SUCCESS" // 成功
|
|||
const CODE_FAIL = "FAIL" // 失败
|
|||
const CODE_NOTPAY = "NOTPAY" // 未支付
|
|||
const CODE_CHANGE = "CHANGE" // 退款异常
|
|||
const CODE_REFUNDCLOSE = "REFUNDCLOSE" // 退款关闭
|
|||
const CODE_ERROR = "ERROR" // 业务错误
|
|||
const CODE_INVALID_REQUEST = "INVALID_REQUEST" // 无效请求
|
|||
const CODE_NOAUTH = "NOAUTH" // 异常IP请求不予受理
|
|||
const CODE_NOTENOUGH = "NOTENOUGH" // 余额不足
|
|||
const CODE_ORDERPAID = "ORDERPAID" // 订单已支付
|
|||
const CODE_ORDERCLOSED = "ORDERCLOSED" // 订单已关闭
|
|||
const CODE_SYSTEMERROR = "SYSTEMERROR" // 系统错误
|
|||
const CODE_APPID_NOT_EXIST = "APPID_NOT_EXIST" // APPID不存在
|
|||
const CODE_MCHID_NOT_EXIST = "MCHID_NOT_EXIST" // MCHID不存在
|
|||
const CODE_APPID_MCHID_NOT_MATCH = "APPID_MCHID_NOT_MATCH" // APPID MCHID 不匹配
|
|||
const CODE_LACK_PARAMS = "LACK_PARAMS" // 缺少参数
|
|||
const CODE_OUT_TRADE_NO_USED = "OUT_TRADE_NO_USED" // 商户订单号重复
|
|||
const CODE_SIGNERROR = "SIGNERROR" // 签名错误
|
|||
const CODE_XML_FORMAT_ERROR = "XML_FORMAT_ERROR" // xml格式错误
|
|||
const CODE_REQUIRE_POST_METHOD = "REQUIRE_POST_METHOD" // 请使用post请求方法
|
|||
const CODE_POST_DATA_EMPTY = "POST_DATA_EMPTY" // post数据为空
|
|||
const CODE_NOT_UTF8 = "NOT_UTF8" // 编码错误
|
|||
const CODE_ORDERNOTEXIST = "ORDERNOTEXIST" // 交易订单号不存在
|
|||
const CODE_BIZERR_NEED_RETRY = "BIZERR_NEED_RETRY" // 退款业务流程错误,需要商户触发重试来解决
|
|||
const CODE_TRADE_OVERDUE = "TRADE_OVERDUE" // 订单已经超过退款期限
|
|||
const CODE_USER_ACCOUNT_ABNORMAL = "USER_ACCOUNT_ABNORMAL" // 退款请求失败用户帐号注销
|
|||
const CODE_INVALID_REQ_TOO_MUCH = "INVALID_REQ_TOO_MUCH" // 无效请求过多
|
|||
const CODE_INVALID_TRANSACTIONID = "INVALID_TRANSACTIONID" // 无效transaction_id
|
|||
const CODE_PARAM_ERROR = "PARAM_ERROR" // 参数错误
|
|||
const CODE_FREQUENCY_LIMITED = "FREQUENCY_LIMITED" // 请求频率限制
|
@ -0,0 +1,16 @@ |
|||
package pay_service |
|||
|
|||
import ( |
|||
"fmt" |
|||
"testing" |
|||
"time" |
|||
) |
|||
|
|||
func TestUnifiedOrder(t *testing.T) { |
|||
res, err := UnifiedOrder("欧轩互动测试", "o9XM41s_NN8Y0QK6_MbM-aYMV3TE", |
|||
2, 1, 1, 101, time.Now().Add(1*time.Hour).Unix()) |
|||
if err != nil { |
|||
t.Error(err) |
|||
} |
|||
fmt.Println(res) |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue