Do not open change to realize small program withdrawal, small program to withdraw PHP interface explained

Source: Internet
Author: User
Tags openid

The implementation of the small program to bring the existing two solutions:

The first type is the simplest:

That is, call the cloud to send Red Envelopes API, small Program server request to send Red Envelopes API will get red Envelopes link, and then the small program service side of the red envelope chain to deliver into a two-dimensional code picture, in the small program display, so that users can download sweep code to collect! The results of the collection are as follows:



This makes it easy for the user to realize the withdrawal! Don't worry about inducing attention to the public number, the number is sealed!

How do I charge for red envelopes?

Collect the cloud of the generation of red envelopes, do not charge any fees.

What is the principle of red envelopes ' generation?

The generation of red envelopes refers to the API interface that calls the cloud, the interface returns the red envelope number and the red envelope link. Then your system will link the red envelopes to template messages, customer service messages, H5 links and other forms, issued to your users click the link to collect red envelopes.

Ultimately, it's your public number to send red envelopes to your fans.

What is the difference between red envelopes and their generation?

Use the interface of the cloud to send red envelopes and use the official interface to send red envelopes, the biggest difference is that you opened the cash red envelopes, the distribution of red envelopes funds is to recharge to the merchant platform (no handling fees), the use of hair red envelopes, is to recharge to the cloud account balance (no handling fees)

The amount limit of sending red envelopes

Use the Cloud API to send red envelopes, the minimum amount is 0.3 yuan, the highest is 499 yuan. Each request to create a red envelope is required to send a parameter amount. This is where the API is most flexible.

How do I calculate a bonus without receiving a red envelope?

Because the provision of red envelopes has a 24-hour collection period, as long as the red envelopes did not receive success (such as not received, receive not issued, interception, etc.), will be 24 hours later, within 72 hours of return.

What are the restrictions on the use of red envelopes?

The API's Red envelope link can only be opened in the Public Number dialog box (template message, Customer service message, menu), H5. cannot be opened in small programs, text messages, non-browsers.

How to docking the Red envelopes API?

Start creating an API app by signing up for a 30-day free Demo Cloud account

Once the setting is successful, you will get one of the parameters that the API must have: Appkey

Let's take PHP docking as an example:

$params = [' appkey ' = ' appkey ', ' method ' = ' jfy.redpacks.send ', ' OpenID ' = ' OpenID ', ' money ' =>30]; $result = Http::p ost (' Https://www.jufenyun.com/openapi/gateway ', $params);p rint_r ($result [' body ']);



Interface returns:

{"Code": 0, "REDPACK_SN": "201806276147485200", "Redpack_url": "https:\/\/www.jufenyun.com\/wechat\/batches?key= A283YRL3IH0UAJS6%2BFGA5LJUU%2BZ2IAAHLMK "}


Use PHP's Json_decode to convert a JSON string into an object:

$result = Json_decode ($result [' body ']);//Get red envelope number $REDPACK_SN = $result->redpack_sn;//get red envelope link $redpack_url = $result- >redpack_url;


Through the following four forms, the request API to get the red envelope link, issued to fans click, you can collect red envelopes OH


1. Through the template message

2, through the Customer service message (text form)

3, through the H5 in the user to click the link

4, the red envelopes to deliver into a two-dimensional code picture, in the small program display, let users download scan code can! This method is the most convenient!


is not particularly easy!

Most importantly, the cloud packet Generation API not only supports the service number, but also supports the subscription number! Support Small Program! No need to open payment, no need to open cash red envelopes, docking can send red envelopes! Come and try it.


Do not open change to realize small program withdrawal, small program to withdraw PHP interface explained

Related Article

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.