Java Micro-Trust public number development (build local test environment) _java

Source: Internet
Author: User

As the saying goes, 工欲善其事, its prerequisite. To do the micro-credit development, two things are essential, that is to have a test for the public number, there is a code for the development of the environment.

Test public number

Micro-Credit public number has a subscription number, service number, enterprise number, in the registration time to see such information, only the subscription number can be personal application, service number and enterprise number to have enterprise qualification can. The development of the micro-public number mentioned here refers to the subscription number and service number.

In addition, an authenticated personal subscription number has interfaces that have no permissions, and the current personal subscription number has not supported the micro-credit authentication, that is, the personal subscription number can not call some advanced permissions interface, the following image is an unauthorized personal subscription number has a list of permissions, such as the generation of two-dimensional code, Web page authorization, custom menu, Micro-credit to pay such interface permissions are not available.

Said for a long time, that if there is no enterprise qualification, but also want to do the development of advanced interface how to do it.

The micro-credit public platform provides the test public account, the login address is: Http://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login, just want to go to this page, click to login, and use their own micro-letter client Scan Code , and authorized to log in, you can get your own test public number. Test the public number with almost all the interface, normally developed if there is no public number available, use this test public number on it.

Local test environment

The development of micro-credit public accounts of a major pain is debugging problems, each implementation of a function need to deploy to a public network server, although there are a variety of free cloud platform can be deployed, but the mode is basically only log output, and no change-> deployment-> View Log, This process is a waste of time, time is life, this is not a waste of life. So, is there a way to deploy locally and debug locally?

Of course there are, because each time to send a command to the public, the public number of the server to interact with your server, so that your server to ensure that the extranet can be accessed, then only need to map your local to an external network address to achieve micro-credit public number of local debugging. There are many software to provide such functions, such as peanut shells, but charges. Here is a free software, Ngrok, Access may require FQ. According to the local required version, Windows or Linux version, and then registered account, the account registration success, you will get a free authorization code, this authorization code in the first time to start Ngrok will be used.

To my local example, I downloaded the version of Windows, download and extract, find the Extract directory, double-click Ngrok.exe, the first time you start, enter the following command:

Ngrok-authtoken Authorization Code 80

Then start, double-click Ngrok.exe, after the start of the input command to map the computer to the extranet, the local 8080-port Web services mapped to the extranet 80 ports, the command is as follows:

Ngrok http 8080

The interface after startup is as follows:

  

The red section is the mapped extranet address, which is now accessed by accessing local port 8080. But the free version of the Ngrok, the generated external network map address is random, each reboot will be different, but in fact, it is not serious, because every day Ngrok start a halfway will not close, every time after the start, to the micro-credit test public number Management page, reconfigure it.

So far Ngrok is available, that is to say, the Ngrok server is a wall, but the micro-mail public number server is accessible, so it does not prevent us from doing local mode. Just download the registration Ngrok need FQ.

There are also some Ngrok servers in the country, but have not tried, if interested can search their own. Of course, if you have the ability, you can build a Ngrok platform, Ngrok is the go language implementation.

The above is the use of Java Development Micro-letter public number to achieve the public number test and local test environment to build, I hope to help you learn.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.