Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jenly1314 committed Aug 25, 2024
1 parent 0469124 commit c97a973
Show file tree
Hide file tree
Showing 13 changed files with 227 additions and 33 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{kt, kts}]
ij_kotlin_imports_layout = *
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Android CI
name: build

on:
push:
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: docs

on:
push:
branches:
- master

env:
JAVA_VERSION: 11
PYTHON_VERSION: 3.x
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

permissions:
contents: write
id-token: write
pages: write

jobs:
docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install MkDocs Material
run: pip install mkdocs-material

- name: Generate Docs
run: ./build_docs.sh

- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: site

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## 版本日志

#### v2.1.0 :2023-09-24
* 简化集成步骤
* 优化细节(统一结果判定)

#### v2.0.0 :2023-09-17
* 迁移发布至 MavenCentral
* 新增子库UnionPay(银联支付)
* 更新支付宝支付SDK依赖至v15.8.16(支付宝支付从AAR依赖更新为从Maven依赖)
* 更新微信支付SDK依赖至v6.8.24
* 更新Gradle至v7.3.3
* 更新compileSdk至32

#### v1.0.1 :2019-11-14 (之前发布的版本是在JCenter)
* 移除support:appcompat-v7依赖
* 更新微信支付SDK依赖至v5.4.0
* 更新支付宝支付SDK依赖至v15.6.8(alipaySdk-15.6.8-20191021122514)

#### v1.0.0 :2019-3-21
* AppPay初始版本
* AliPay 依赖AlipaySdk版本(alipaySdk-15.6.0-20190226104053)
47 changes: 17 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AppPay for Android 是一个专注于App支付的库,将主流的官方App支
> AppPay的整体结构:将多个独立封装的子库再次封装,并且使用更简单。
## 结构
![Image](image/AppPay_architecture.jpg)
![Image](art/AppPay_architecture.jpg)

## 引入

Expand All @@ -41,13 +41,13 @@ AppPay for Android 是一个专注于App支付的库,将主流的官方App支
```gradle
// WXPay
implementation 'com.github.jenly1314.AppPay:wxpay:2.1.0'
// AliPay
implementation 'com.github.jenly1314.AppPay:alipay:2.1.0'
// UnionPay
implementation 'com.github.jenly1314.AppPay:unionpay:2.1.0'
// AppPay
implementation 'com.github.jenly1314.AppPay:apppay:2.1.0'
```
Expand Down Expand Up @@ -148,7 +148,7 @@ mAliPay.sendReq(orderInfo, new AliPay.OnPayListener() {
```java
// 初始化银联支付
mUnionPay = new UnionPay(Context context);

// 设置银联支付监听
mUnionPay.setOnPayListener(new UnionPay.OnPayListener() {
@Override
Expand All @@ -159,11 +159,11 @@ mAliPay.sendReq(orderInfo, new AliPay.OnPayListener() {
}
}
});

// 发送银联支付请求;(参数:orderInfo为订单信息的流水号,即TN;serverMode为银联后台环境标识;用于区分使用测试环境还是正式环境;说明参见:UnionPay.PRO_SERVER_MODE 和 UnionPay.TEST_SERVER_MODE)
mUnionPay.sendReq(String orderInfo, String serverMode);
```
```java
// 发送银联支付请求并监听;(参数:orderInfo为订单信息的流水号,即TN;serverMode为银联后台环境标识;用于区分使用测试环境还是正式环境;说明参见:UnionPay.PRO_SERVER_MODE 和 UnionPay.TEST_SERVER_MODE)
mUnionPay.sendReq(orderInfo, serverMode, new UnionPay.OnPayListener() {
Expand Down Expand Up @@ -192,7 +192,7 @@ mUnionPay.sendReq(orderInfo, serverMode, new UnionPay.OnPayListener() {

// 发送微信支付请求(参数:req为拉起支付的请求参数)
mAppPay.sendWXPayReq(req, new WXPay.OnPayListener() {
@Override
@Override
public void onPayResult(WXPayResult result) {
// 支付结果
if (result.isSuccess()) {
Expand All @@ -204,7 +204,7 @@ mAppPay.sendWXPayReq(req, new WXPay.OnPayListener() {

// 发送支付宝支付请求(参数:orderInfo为拉起支付的订单信息)
mAppPay.sendAliPayReq(orderInfo, new AliPay.OnPayListener() {
@Override
@Override
public void onPayResult(AliPayResult result) {
// 支付结果
if (result.isSuccess()) {
Expand All @@ -216,7 +216,7 @@ mAppPay.sendAliPayReq(orderInfo, new AliPay.OnPayListener() {

// 发送银联支付请求(参数:orderInfo为订单信息的流水号,即TN;serverMode为银联后台环境标识;用于区分使用测试环境还是正式环境;说明参见:UnionPay.PRO_SERVER_MODE 和 UnionPay.TEST_SERVER_MODE)
mAppPay.sendUnionPayReq(orderInfo, serverMode, new UnionPay.OnPayListener() {
@Override
@Override
public void onPayResult(UnionPayResult result) {
// 支付结果
if (result.isSuccess()) {
Expand All @@ -229,7 +229,7 @@ mAppPay.sendUnionPayReq(orderInfo, serverMode, new UnionPay.OnPayListener() {

> 使用银联支付时需要在 `Activity` 中的 `onActivityResult` 方法中调用 **AppPay****onActivityResult(int, int, Intent)}** 方法,这样设置的银联支付监听才会被触发。
更多使用详情,请查看[app](app)中的源码使用示例或直接查看 [API帮助文档](https://jitpack.io/com/github/jenly1314/AppPay/latest/javadoc/)
更多使用详情,请查看[app](app)中的源码使用示例或直接查看 [API帮助文档](https://jenly1314.github.io/AppPay/api/)

## 补充说明

Expand Down Expand Up @@ -336,9 +336,9 @@ mAppPay.sendUnionPayReq(orderInfo, serverMode, new UnionPay.OnPayListener() {

```gradle
defaultConfig {
//...
ndk {
//设置支持的 SO 库架构(开发者可以根据需要,选择一个或多个平台的 so)
abiFilters 'armeabi-v7a' // , 'arm64-v8a', 'x86', 'x86_64'
Expand All @@ -354,28 +354,15 @@ mAppPay.sendUnionPayReq(orderInfo, serverMode, new UnionPay.OnPayListener() {

[银联支付Android接入指南](doc/银联支付接入指南Android_v1.0.9.pdf)

## 版本记录
<!-- end -->

## 版本日志

#### v2.1.0 :2023-09-24
* 简化集成步骤
* 优化细节(统一结果判定)

#### v2.0.0 :2023-09-17
* 迁移发布至 MavenCentral
* 新增子库UnionPay(银联支付)
* 更新支付宝支付SDK依赖至v15.8.16(支付宝支付从AAR依赖更新为从Maven依赖)
* 更新微信支付SDK依赖至v6.8.24
* 更新Gradle至v7.3.3
* 更新compileSdk至32

#### v1.0.1 :2019-11-14 (之前发布的版本是在JCenter)
* 移除support:appcompat-v7依赖
* 更新微信支付SDK依赖至v5.4.0
* 更新支付宝支付SDK依赖至v15.6.8(alipaySdk-15.6.8-20191021122514)

#### v1.0.0 :2019-3-21
* AppPay初始版本
* AliPay 依赖AlipaySdk版本(alipaySdk-15.6.0-20190226104053)
#### [查看更多日志](CHANGELOG.md)

## 赞赏
如果您喜欢AppPay,或感觉AppPay帮助到了您,可以点右上角“Star”支持一下,您的支持就是我的动力,谢谢 :smiley:
Expand Down
1 change: 1 addition & 0 deletions alipay/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down
1 change: 1 addition & 0 deletions apppay/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down
File renamed without changes
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
id 'org.jetbrains.dokka' version '1.9.20'
id 'com.vanniktech.maven.publish' version '0.22.0' apply false
}
}
27 changes: 27 additions & 0 deletions build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

set -ex

# Generate the API docs
./gradlew dokkaHtmlMultiModule

mkdir -p docs/api
mv build/dokka/htmlMultiModule/* docs/api

# Copy in special files that GitHub wants in the project root.
GITHUB_URL=https://github.com/jenly1314/AppPay/
echo $GITHUB_URL
sed "/<!-- end -->/q" README.md > docs/index.md
sed -i "s|app/src/main/ic_launcher-web.png|ic_logo.png|g" docs/index.md
sed -i "s|](app|](${GITHUB_URL}blob/master/app|g" docs/index.md
sed -i "s|](doc|](${GITHUB_URL}blob/master/doc|g" docs/index.md
sed -i "s|](alipay|](${GITHUB_URL}blob/master/alipay|g" docs/index.md
sed -i "s|](wxpay|](${GITHUB_URL}blob/master/wxpay|g" docs/index.md
sed -i "s|](unionpay|](${GITHUB_URL}blob/master/unionpay|g" docs/index.md
cat CHANGELOG.md | grep -v '## 版本日志' > docs/changelog.md

cp -r art docs/art
cp app/src/main/ic_launcher-web.png docs/ic_logo.png

# Build the site locally
mkdocs build
86 changes: 86 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Project information
site_name: AppPay
site_url: https://jenly1314.github.io/AppPay/
site_description: "AppPay for Android"
site_author: Jenly
remote_branch: gh-pages
edit_uri: ""

# Repository
repo_name: AppPay
repo_url: https://github.com/jenly1314/AppPay

# Copyright
copyright: 'Copyright &copy; 2016 - 2024 Jenly'

# Configuration
theme:
name: 'material'
favicon: https://jenly1314.github.io/favicon.png
logo: https://jenly1314.github.io/medias/logo.png
icon:
repo: fontawesome/brands/github
language: zh
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: teal
accent: blue
toggle:
icon: octicons/sun-24
name: "切换到深色模式"
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: teal
accent: blue
toggle:
icon: octicons/moon-24
name: "切换到浅色模式"
features:
- navigation.instant
- navigation.instant.progress
- navigation.tabs
- content.code.copy

extra:
social:
- icon: material/home-circle
link: https://jenly1314.github.io/
- icon: simple/github
link: https://github.com/jenly1314/
- icon: simple/gitee
link: https://gitee.com/jenly1314/
- icon: fontawesome/solid/paper-plane
link: mailto:[email protected]

markdown_extensions:
- smarty
- footnotes
- meta
- toc:
permalink: true
- attr_list
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.inlinehilite
- pymdownx.magiclink
- pymdownx.smartsymbols
- pymdownx.superfences
- pymdownx.tilde
- pymdownx.tabbed:
alternate_style: true
- tables

# Plugins
plugins:
- search

nav:
- '概览': index.md
- 'API文档': api/index.html
- '版本日志': changelog.md

3 changes: 2 additions & 1 deletion unionpay/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down Expand Up @@ -37,4 +38,4 @@ dependencies {
testImplementation "junit:junit:$versions.junit"
androidTestImplementation "androidx.test.ext:junit:$versions.androidExtJunit"
androidTestImplementation "androidx.test.espresso:espresso-core:$versions.espressoCore"
}
}
1 change: 1 addition & 0 deletions wxpay/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'org.jetbrains.dokka'
id 'com.vanniktech.maven.publish'
}

Expand Down

0 comments on commit c97a973

Please sign in to comment.