Giter Site home page Giter Site logo

bossding / store Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hahaho/store

0.0 2.0 0.0 350 KB

世界无产阶级先辈们用无数的鲜血和牺牲才换来的8小时工作制,不能就这么毁在我们手上,就算被资本打败,也要在那之前咬它一口。

Dockerfile 0.12% Java 99.88%

store's Introduction

P2P平台授权接口规范

对接准备:管理员分配 appId appSecret

接口方式:POST(application/x-www-form-urlencoded)

参数 类型 描述
appId String 平台ID(平台ID)
mobile String 授权账号(手机号码)
name String 真实姓名(务必真实)
identity String 身份证号(务必真实)
amount BigDecimal 授权金额(格式:1.23 / 单位:元)
sign String 请求签名(签名方式:MD5)

签名方式:以上字段除去sign,按照参数名的字典顺序排列,以如下形式拼接成字符串,然后加上appSecret字符串,将整个字符串MD5得到sign。

[appId=1111166059554922498]
[appSecret=1234567890]

1.字典排列
amount=30000&appId=1111166059554922498&identity=330823XXXXXXXX2115&mobile=137XXXX9882&name=王XX

2.加上appSecret
amount=30000&appId=1111166059554922498&identity=330823XXXXXXXX2115&mobile=137XXXX9882&name=王XX1234567890

3.最后MD5
sign=9aa9c188d2e10c73a3638dc1df495002

JAVA签名示例代码:

   public String getSignContent(Map<String, String> params) {
       if (params == null) {
           return null;
       } else {
           params.remove("sign");
           StringBuffer content = new StringBuffer();
           List<String> keys = new ArrayList(params.keySet());
           Collections.sort(keys);
           for (int i = 0; i < keys.size(); ++i) {
               String key = String.valueOf(keys.get(i));
               String value = String.valueOf(params.get(key));
               content.append((i == 0 ? "" : "&") + key + "=" + value);
           }
           return content.toString();
       }
   }
   
   String sign = DigestUtil.md5Hex(this.getSignContent(PARAMS_MAP) + APP_SECRET);

store's People

Contributors

d2c-cai avatar komanoaunn avatar

Watchers

James Cloos avatar BossDing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.