1. Alipay method:
Code:// alipayWap: form fragment returned by the background interface <div v-html="alipayWap" ref="alipayWap"></div> methods: { toAlipay() { this.$axios.get('xxx').then(res = > { this.alipayWap = res; // Wait for DOM to update, and then the form will appear on the page this.$nextTick(() => { this.$refs.alipayWap.children[0].submit() }) }) } } 2. WeChat PayMost of the workload is done by the backend. The order generation is done by the backend and connected to Tencent. The frontend is only responsible for displaying the payment QR code returned by the backend (generated by the backend. In some cases, the frontend can also connect to the order generation and then generate the QR code by itself, but this situation is relatively rare) on the terminal for users to scan. You need to generate a QR code page based on the URL returned by the background, as shown in the figure QR code display code:Request the payment QR code interface of the backendFinally, scan the QR code and pay. This is the end of this article about the payment function of the vue project. For more relevant vue payment function content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: The difference between GB2312, GBK and UTF-8 in web page encoding
>>: Solution to the ineffective margin of div nested in HTML
The default storage directory of mysql is /var/li...
title XML/HTML CodeCopy content to clipboard <...
Table of contents pom configuration Setting.xml c...
Linux basic configuration Compile and install pyt...
When using TensorFlow for deep learning, insuffic...
"Page screenshot" is a requirement ofte...
Table of contents Preface 1. Set the prototype on...
1. Environment VS 2019 16.9.0 Preview 1.0 .NET SD...
1. Use the mysql/mysql-server:latest image to qui...
Effect display: Environment preparation controlle...
1. Command Introduction The watch command execute...
This article uses examples to describe the introd...
Key Takeaways: 1. Mastering CSS3 3D animation 2. ...
Preface To solve the single point of failure, we ...
Under Ubuntu 18.04 1. sudo apt install python ins...