Home  >  Article  >  Backend Development  >  Things to note when accessing PHP Sesame Credit

Things to note when accessing PHP Sesame Credit

墨辰丷
墨辰丷Original
2018-05-30 09:32:471889browse

This article has compiled two precautions for accessing the Sesame API. Friends who are interested in PHP Sesame Credit access should learn through this article.

The SDK officially downloaded by Sesame cannot run. After searching on Baidu, I didn't find too many articles. There was only one article written by a CSDN blog, which is more valuable for reference.

Read the documentation in detail for a few days to test and sort out the following notes:

Accessing the Sesame API interface should be divided into two steps:

The first step is to obtain authorization. This is the official SDK. As long as the parameters are configured correctly, it can be operated. Pay attention to the following parameters, compare with the Sesame document,

##The other most important point is, Sesame public key generation and modification, the generated public key is copied according to the official operation Enter the Sesame backend, and after saving, Sesame will generate a new public key, click copy, save it to our public key file, and then upload it to the space for PHP to call.

$request->setScene("test"); 
$request->setChannel("apppc");
$request->setPlatform("zmop");
$request->setIdentityType("2");// 必要参数 
// 构造授权业务入参证件号,姓名,证件类型;“章节4中的业务入参说明identity_param” 
$request->setIdentityParam("{\"certNo\":\"$certNo\",\"certType\":\"IDENTITY_CARD\", \"name\":\"$name\"}"); 
// $request->setIdentityParam("{\"certNo\":\"$certNo\",\"certType\":\"IDENTITY_CARD\", \"name\":\"$name\",\"mobileNo\":\"$mobile\"}"); 
// 构造业务入参扩展参数“章节4中的业务入参说明biz_params” 
$request->setBizParams("{\"auth_code\":\"M_H5\",\"channelType\":\"app\",\"state\":\"$uid\"}");//

After the authorization is successful, it will jump to the callback address we set. This callback address GET parameter has a param parameter. You must use the decryption function in the SDK. After decryption, you can get the customer's OPENI_ID.

After getting the OPEN_ID, save it to the database and the authorization is completed.

The second step,

According to the OPEN_ID obtained through authorization, you can get Sesame points. The example in this SDK can be run. . .

The most important thing is the first point.

The above are the precautions for PHP Sesame Credit access introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for your support of the Script House website!

The above is the entire content of this article, I hope it will be helpful to everyone's study.


Related recommendations:

How to implement the function of randomly generating watermark images in PHP

# #PHP implements reading Cookies set by JavaScript


phpMethod to implement multi-dimensional array sorting

The above is the detailed content of Things to note when accessing PHP Sesame Credit. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn