Android – development based on wechat open platform v3sdk (wechat payment pit filling)

Before contacting wechat payment, I heard that this is a pit. I'm ready... I thought I might not be able to get out of the pit. Unexpectedly, I filled it in. After the call was successful, I felt that all my colleagues in the company were beautiful. I seemed to see the sun through the heavy fog and haze in Beijing ~ ~ ~ well, the pretend is over... Get to the point

Development preparation:

1. Apply for an account on wechat open platform

2. To create an application after success is to fill in some seemingly official and serious materials... (said that the audit took about 7 days. Without accidents, your app was successfully audited the next day. Are you very happy? With appid, can you call wechat payment???? -------- think too much, really)

3. Wechat payment requires additional application: data review, account verification, agreement signing and other steps. (I remember, there are many things to fill in for data review. Account verification is that after you successfully review, wechat will send an email to the email account you registered at the time of registration, including random amount for account verification, agreement signing, omitted, too simple) Be sure to read any information in your email, because some details are wrong, you may fill in the pit for a long time......

Formal development phase:

Question 1:

When calling the official SDK, I found that wechat can only be successfully called once, and I can't call it when I pay again

solve:

It doesn't seem like a serious method: manage applications in mobile phone settings, clear wechat data, cache, and do it again. It can definitely be adjusted (of course, it's only once...)

continue:

I think wechat should be used for payment. I only read the documents calling the payment interface:

So let's look at the unified order documents first

1. Copy the wxpayentryactivity in the SDK downloaded from the official website to your project when using your own app. The name of the package must be. Wxapi (I copied the package together...)

2. Fill in the project list document:

3. Copy the appregister in the SDK, replace it with your own appid, and then register it in the project list.

To activate the wechat payment page, register your app with wechat in this activity

Error I met: Signature error

My reason is that I was careless about configutil.notify_ URL is an empty string written for this parameter

In addition, the debug version runs without packaging

After successful return, the payment interface can be called

Don't forget this step to jump to the interface,,,,,

Here is the complete code of my payactivity:

There are no classes,,, Na: download the source code. Download and copy by yourself...

Reference article: https://www.oudahe.com/p/17016/

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>