Pay an access specification

Noun: MD5-hmac:

hmac is a secret key authentication algorithm, hmac provide data integrity and source authentication key distribution depends entirely on the scope, if only the originator and the recipient know hmac key, this will send between them the data provide a guarantee source authentication and integrity.

Provides encryption class: DigestUtil

Use as follows:

StringBuffer sValue= new StringBuffer();

sValue.append("lihuoming");

sValue.append("0812910“);

String hmacMd5 = DigestUtil.hmacSign(sValue.toString(),"123456");

// The first parameter is the encrypted text, the second argument is the key


Payment Process

Http request payment by way of a third-party gateway to initiate a request, the request can get or post submission page using GBK / GB2312 coding, the form below to be paid to a third party payment gateway to initiate a request.

<form name="yeepay" action="https://www....." method="post">

Some request parameters omitted

<input type="hidden" name="p8_Url" value="http:www.babapost.com/payment/response">

<-! MD5 hmac codes ->

<input type="hidden" name="hmac" value="2a8de8147356d97c3647fvdf5gfb“>

</form>

Third-party payment gateway used to send data to the enterprise user MD5-hmac key generation code, and then compare whether or not the same now sent MD5-hmac code (a form provided by the above values ​​hmac code field), i.e., if the same gateway forwards the request to the bank, when the user complete payment, the bank gateway will guide the user's browser is redirected to the url enterprises to provide (ie, the address form provided by p8_Url)

Reproduced in: https: //www.jianshu.com/p/656edaf4a510

Guess you like

Origin blog.csdn.net/weixin_33737134/article/details/91111917