Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
77b58a25c8 | ||
![]() |
8917fc9576 | ||
![]() |
9ee80ec7e1 | ||
![]() |
2c25325334 | ||
![]() |
21821b9ca7 | ||
![]() |
b66d7ad422 | ||
![]() |
04c5bfbb6c | ||
![]() |
b94b32935b | ||
![]() |
aa4d133dc8 | ||
![]() |
ccdc418521 | ||
![]() |
6de29d7637 | ||
![]() |
3e948d1346 | ||
![]() |
2f94805630 | ||
![]() |
e61f7e3525 | ||
![]() |
18a2fdd50a | ||
![]() |
35435fddd7 | ||
![]() |
6d78177551 | ||
![]() |
2557b6020b | ||
![]() |
a9e5bdb91e |
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2020 uiw
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
26
README.md
26
README.md
@@ -1,9 +1,15 @@
|
|||||||
@uiw/react-native-alipay
|
<p align="center">
|
||||||
===
|
<a href="https://uiwjs.github.io/react-native-alipay/">
|
||||||
|
<img src="https://user-images.githubusercontent.com/1680273/89095947-f0046900-d404-11ea-83ec-2408267efaa7.png" height="100" />
|
||||||
|
</a>
|
||||||
|
<h1 align="center">@uiw/react-native-alipay</h1>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
|
||||||
[](https://npmjs.org/package/@uiw/react-native-alipay)
|
[](https://npmjs.org/package/@uiw/react-native-alipay)
|
||||||
|

|
||||||
|
|
||||||
基于 React Native 的宝支付插件,支持 iOS/Android。适用于商家在 App 应用中集成支付宝支付功能,商家 APP 调用支付宝提供的 SDK,SDK 再调用支付宝 APP 内的支付模块。如果用户已安装支付宝APP,商家APP会跳转到支付宝中完成支付,支付完后跳回到商家 APP 内,最后展示支付结果。如果用户没有安装支付宝 APP,商家 APP 内会调起支付宝网页支付收银台,用户登录支付宝账户,支付完后展示支付结果。完整实例 [Example](./example)
|
基于 React Native 的宝支付插件,支持 iOS/Android。适用于商家在 App 应用中集成支付宝支付功能,商家 APP 调用支付宝提供的 SDK,SDK 再调用支付宝 APP 内的支付模块。如果用户已安装支付宝APP,商家APP会跳转到支付宝中完成支付,支付完后跳回到商家 APP 内,最后展示支付结果。如果用户没有安装支付宝 APP,商家 APP 内会调起支付宝网页支付收银台,用户登录支付宝账户,支付完后展示支付结果。完整实例 [Example](./example) | [完整的接口文档](https://uiwjs.github.io/react-native-alipay/)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -207,12 +213,22 @@ Alipay.alipay(payInfo, (res)=>console.log(res))
|
|||||||
npx create-react-native-module --package-identifier com.uiwjs --object-class-name RNAlipay --generate-example Alipay --example-react-native-version 0.63.0 --module-name @uiw/react-native-alipay --github-account uiwjs --author-name "Kenny Wong" --author-email "wowohoo@qq.com"
|
npx create-react-native-module --package-identifier com.uiwjs --object-class-name RNAlipay --generate-example Alipay --example-react-native-version 0.63.0 --module-name @uiw/react-native-alipay --github-account uiwjs --author-name "Kenny Wong" --author-email "wowohoo@qq.com"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 开发
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd example # 进入实例 example 工程,根目录不需要安装,会引发错误
|
||||||
|
yarn install # 安装依赖
|
||||||
|
|
||||||
|
cd ios # 进入 example/ios 目录安装依赖
|
||||||
|
pod instll # 安装依赖
|
||||||
|
```
|
||||||
|
|
||||||
## 相关连接
|
## 相关连接
|
||||||
|
|
||||||
- [支付宝:生成秘钥指南](https://opendocs.alipay.com/open/291/105971)
|
- [支付宝:生成秘钥指南](https://opendocs.alipay.com/open/291/105971)
|
||||||
- [支付宝:SDK 下载地址,当前使用的是 AlipaySDK 15.7.7](https://opendocs.alipay.com/open/54/104509)
|
- [支付宝:SDK 下载地址,当前使用的是 AlipaySDK 15.7.9](https://opendocs.alipay.com/open/54/104509)
|
||||||
- [支付宝:客户端调试工具及使用教程](https://openclub.alipay.com/club/history/read/7695)
|
- [支付宝:客户端调试工具及使用教程](https://openclub.alipay.com/club/history/read/7695)
|
||||||
- [支付宝:支付,接入前准备](https://opendocs.alipay.com/open/204/105297/)
|
- [支付宝:支付,接入前准备](https://opendocs.alipay.com/open/204/105297/)
|
||||||
- [支付宝:完整版授权 SDK 调用方法](https://opendocs.alipay.com/open/218/105325)
|
- [支付宝:完整版授权 SDK 调用方法](https://opendocs.alipay.com/open/218/105325)
|
||||||
- [支付宝:异步通知错误码: IllRet](https://opensupport.alipay.com/support/problem.htm?ant_source=antsupport)
|
- [支付宝:异步通知错误码: IllRet](https://opensupport.alipay.com/support/problem.htm?ant_source=antsupport)
|
||||||
- [React-native 0.6版本集成支付宝-Alipay爬坑](https://segmentfault.com/a/1190000020758279)
|
- [@uiw/react-native-wechat](https://github.com/uiwjs/react-native-wechat) 微信支付。
|
||||||
|
@@ -86,7 +86,7 @@ def configureReactNativePom(def pom) {
|
|||||||
name packageJson.title
|
name packageJson.title
|
||||||
artifactId packageJson.name
|
artifactId packageJson.name
|
||||||
version = packageJson.version
|
version = packageJson.version
|
||||||
group = "com.uiwjs"
|
group = "com.uiwjs.alipay"
|
||||||
description packageJson.description
|
description packageJson.description
|
||||||
url packageJson.repository.baseUrl
|
url packageJson.repository.baseUrl
|
||||||
|
|
||||||
|
Binary file not shown.
@@ -1,5 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.uiwjs">
|
package="com.uiwjs.alipay">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
package com.uiwjs;
|
package com.uiwjs.alipay;
|
||||||
|
|
||||||
import com.alipay.sdk.app.AuthTask;
|
import com.alipay.sdk.app.AuthTask;
|
||||||
import com.alipay.sdk.app.PayTask;
|
import com.alipay.sdk.app.PayTask;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
package com.uiwjs;
|
package com.uiwjs.alipay;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@@ -35,12 +35,12 @@ android_library(
|
|||||||
|
|
||||||
android_build_config(
|
android_build_config(
|
||||||
name = "build_config",
|
name = "build_config",
|
||||||
package = "com.example",
|
package = "com.uiwjs.example.alipay",
|
||||||
)
|
)
|
||||||
|
|
||||||
android_resource(
|
android_resource(
|
||||||
name = "res",
|
name = "res",
|
||||||
package = "com.example",
|
package = "com.uiwjs.example.alipay",
|
||||||
res = "src/main/res",
|
res = "src/main/res",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -129,7 +129,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.example"
|
applicationId "com.uiwjs.example.alipay"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 1
|
versionCode 1
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
||||||
* directory of this source tree.
|
* directory of this source tree.
|
||||||
*/
|
*/
|
||||||
package com.example;
|
package com.uiwjs.example.alipay;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import com.facebook.flipper.android.AndroidFlipperClient;
|
import com.facebook.flipper.android.AndroidFlipperClient;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.example">
|
package="com.uiwjs.example.alipay">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
package com.example;
|
package com.uiwjs.example.alipay;
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity;
|
import com.facebook.react.ReactActivity;
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
package com.example;
|
package com.uiwjs.example.alipay;
|
||||||
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -62,7 +62,7 @@ public class MainApplication extends Application implements ReactApplication {
|
|||||||
We use reflection here to pick up the class that initializes Flipper,
|
We use reflection here to pick up the class that initializes Flipper,
|
||||||
since Flipper library is not available in release mode
|
since Flipper library is not available in release mode
|
||||||
*/
|
*/
|
||||||
Class<?> aClass = Class.forName("com.example.ReactNativeFlipper");
|
Class<?> aClass = Class.forName("com.uiwjs.example.alipay.ReactNativeFlipper");
|
||||||
aClass
|
aClass
|
||||||
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
|
||||||
.invoke(null, context, reactInstanceManager);
|
.invoke(null, context, reactInstanceManager);
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">example</string>
|
<string name="app_name">支付宝SDK实例</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -161,7 +161,6 @@
|
|||||||
C40641DB7F56A684B820B607 /* Pods-example-tvOSTests.debug.xcconfig */,
|
C40641DB7F56A684B820B607 /* Pods-example-tvOSTests.debug.xcconfig */,
|
||||||
9E02A36BA0975904A97235F2 /* Pods-example-tvOSTests.release.xcconfig */,
|
9E02A36BA0975904A97235F2 /* Pods-example-tvOSTests.release.xcconfig */,
|
||||||
);
|
);
|
||||||
name = Pods;
|
|
||||||
path = Pods;
|
path = Pods;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@@ -294,6 +293,7 @@
|
|||||||
TestTargetID = 13B07F861A680F5B00A75B9A;
|
TestTargetID = 13B07F861A680F5B00A75B9A;
|
||||||
};
|
};
|
||||||
13B07F861A680F5B00A75B9A = {
|
13B07F861A680F5B00A75B9A = {
|
||||||
|
DevelopmentTeam = 968DSZ49MT;
|
||||||
LastSwiftMigration = 1120;
|
LastSwiftMigration = 1120;
|
||||||
};
|
};
|
||||||
2D02E47A1E0B4A5D006451C7 = {
|
2D02E47A1E0B4A5D006451C7 = {
|
||||||
@@ -660,6 +660,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
DEVELOPMENT_TEAM = 968DSZ49MT;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = example/Info.plist;
|
INFOPLIST_FILE = example/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
@@ -668,7 +669,7 @@
|
|||||||
"-ObjC",
|
"-ObjC",
|
||||||
"-lc++",
|
"-lc++",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = com.uiwjs.example.alipay;
|
||||||
PRODUCT_NAME = example;
|
PRODUCT_NAME = example;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -683,6 +684,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
DEVELOPMENT_TEAM = 968DSZ49MT;
|
||||||
INFOPLIST_FILE = example/Info.plist;
|
INFOPLIST_FILE = example/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = (
|
||||||
@@ -690,7 +692,7 @@
|
|||||||
"-ObjC",
|
"-ObjC",
|
||||||
"-lc++",
|
"-lc++",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
|
PRODUCT_BUNDLE_IDENTIFIER = com.uiwjs.example.alipay;
|
||||||
PRODUCT_NAME = example;
|
PRODUCT_NAME = example;
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>en</string>
|
<string>en</string>
|
||||||
<key>CFBundleDisplayName</key>
|
<key>CFBundleDisplayName</key>
|
||||||
<string>example</string>
|
<string>支付宝SDK实例</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>$(EXECUTABLE_NAME)</string>
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
|
Binary file not shown.
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
///////////////// 支付宝标准版本支付SDK ///////////////////
|
///////////////// 支付宝标准版本支付SDK ///////////////////
|
||||||
///////// version:15.7.7 motify:2020.07.02///////////
|
///////// version:15.7.9 motify:2020.07.27///////////
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
13
package.json
13
package.json
@@ -1,15 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "@uiw/react-native-alipay",
|
"name": "@uiw/react-native-alipay",
|
||||||
"version": "2.0.10",
|
"title": "React Native Alipay",
|
||||||
|
"version": "2.1.3",
|
||||||
"description": "基于 React Native 的支付宝插件,支持Android/iOS。",
|
"description": "基于 React Native 的支付宝插件,支持Android/iOS。",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"typings": "index.d.ts",
|
"typings": "index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"README.md",
|
"android/libs",
|
||||||
"android",
|
"android/src",
|
||||||
"index.js",
|
"android/build.gradle",
|
||||||
|
"ios",
|
||||||
"index.d.ts",
|
"index.d.ts",
|
||||||
"ios"
|
"index.js",
|
||||||
|
"README.md"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "typedoc"
|
"build": "typedoc"
|
||||||
|
Reference in New Issue
Block a user