puti94 / react-native-puti-pay Goto Github PK
View Code? Open in Web Editor NEW基于 React Native 的微信支付,支付宝支付插件
基于 React Native 的微信支付,支付宝支付插件
感谢开源共享,由于我们的项目是集成到 Unity 项目里边去的,在XCode平台不能使用 react-native link
只能使用 pod 来管理安装依赖库,所以如题,想请求帮忙支持一下 pod install
方式安装。
谢谢。
2020-01-17 05:05:31.774303+0800 easyz[5807:103496] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2020-01-17 05:05:31.774363+0800 easyz[5807:103659] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2020-01-17 05:05:31.774834+0800 easyz[5807:103496] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2020-01-17 05:05:31.774888+0800 easyz[5807:103659] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2020-01-17 05:05:31.775871+0800 easyz[5807:103496] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2020-01-17 05:05:31.776022+0800 easyz[5807:103659] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
libc++abi.dylib: terminate_handler unexpectedly threw an exception
(lldb)
有人知道吗??
ios微信支付已经按照要求填入appId,但还是调不了
/Users/pengtaikeji/Desktop/CaiChuFang/node_modules/react-native-puti-pay/android/src/main/java/com/puti/paylib/PayReactPackage.java:15: 错误: PayReactPackage不是抽象的, 并且未覆盖ReactPackage中的抽象方法createJSModules()
public class PayReactPackage implements ReactPackage {
^
1 个错误
:react-native-puti-pay:compileReleaseJavaWithJavac FAILED
Task :react-native-puti-pay:compileReleaseJavaWithJavac FAILED
/Users/weining/file/rn/node_modules/react-native-puti-pay/android/src/main/java/com/puti/paylib/XWXPayEntryActivity.java:6: 错误: 程序包android.support.annotation不存在
import android.support.annotation.Nullable;
^
/Users/weining/file/rn/node_modules/react-native-puti-pay/android/src/main/java/com/puti/paylib/XWXPayEntryActivity.java:28: 错误: 找不到符号
protected void onCreate(@nullable Bundle savedInstanceState) {
^
符号: 类 Nullable
位置: 类 XWXPayEntryActivity
2 个错误
FAILURE: Build failed with an exception.
按照安装文档配置到这一步的时候报错,无法编译,下面这个方法报错。
报错内容。
No known class method for selector 'application:openURL:options:'
请求帮助,谢谢
//设置 支付宝URL Schemes
XPay.setAlipayScheme('ap2017102209453437')
因为没有数据 测试数据用的例子里的
aliPay = () => {
XPay.alipay('app_id=2015052600090779&biz_content=%7B%22timeout_express%22%3A%2230m%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%2C%22total_amount%22%3A%220.01%22%2C%22subject%22%3A%221%22%2C%22body%22%3A%22%E6%88%91%E6%98%AF%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE%22%2C%22out_trade_no%22%3A%22IQJZSRC1YMQB5HU%22%7D&charset=utf-8&format=json&method=alipay.trade.app.pay¬ify_url=http%3A%2F%2Fdomain.merchant.com%2Fpayment_notify&sign_type=RSA2×tamp=2016-08-25%2020%3A26%3A31&version=1.0&sign=cYmuUnKi5QdBsoZEAbMXVMmRWjsuUj%2By48A2DvWAVVBuYkiBj13CFDHu2vZQvmOfkjE0YqCUQE04kqm9Xg3tIX8tPeIGIFtsIyp%2FM45w1ZsDOiduBbduGfRo1XRsvAyVAv2hCrBLLrDI5Vi7uZZ77Lo5J0PpUUWwyQGt0M4cj8g%3D',
res => {
console.log('回调', res);
const {result, memo, resultStatus} = res;
if (resultStatus === '9000') {
Toast.success('充值成功')
} else {
Toast.fail('充值失败')
}
})
};
然后提示 系统繁忙ALIN10146
请问这是集成的问题 ,还是数据的问题呢,
通过react-native link集成到RN后,运行xcode报错
Undefined symbols for architecture arm64:
"OBJC_CLASS$_CMMotionManager", referenced from:
objc-class-ref in libRNPutiPay.a(AlipaySDK)
"_sqlite3_bind_int64", referenced from:
___27-[WXOMTAStore storeConfig:]_block_invoke in libRNPutiPay.a(MTAStore.o)
___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRNPutiPay.a(MTAStore.o)
"_sqlite3_bind_text", referenced from:
___27-[WXOMTAStore storeConfig:]_block_invoke in libRNPutiPay.a(MTAStore.o)
___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRNPutiPay.a(MTAStore.o)
"_sqlite3_clear_bindings", referenced from:
___27-[WXOMTAStore storeConfig:]_block_invoke in libRNPutiPay.a(MTAStore.o)
___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRNPutiPay.a(MTAStore.o)
"_sqlite3_close", referenced from:
-[WXOMTAStore closeDB] in libRNPutiPay.a(MTAStore.o)
"_sqlite3_exec", referenced from:
-[WXOMTAStore updateDatabase:] in libRNPutiPay.a(MTAStore.o)
_execute_query in libRNPutiPay.a(MTAStore.o)
_execute_update in libRNPutiPay.a(MTAStore.o)
"_sqlite3_finalize", referenced from:
___27-[WXOMTAStore storeConfig:]_block_invoke in libRNPutiPay.a(MTAStore.o)
___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRNPutiPay.a(MTAStore.o)
"_sqlite3_free", referenced from:
-[WXOMTAStore updateDatabase:] in libRNPutiPay.a(MTAStore.o)
_execute_query in libRNPutiPay.a(MTAStore.o)
_execute_update in libRNPutiPay.a(MTAStore.o)
"_sqlite3_open", referenced from:
-[WXOMTAStore getDB] in libRNPutiPay.a(MTAStore.o)
"_sqlite3_prepare_v2", referenced from:
___27-[WXOMTAStore storeConfig:]_block_invoke in libRNPutiPay.a(MTAStore.o)
___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRNPutiPay.a(MTAStore.o)
"_sqlite3_reset", referenced from:
___27-[WXOMTAStore storeConfig:]_block_invoke in libRNPutiPay.a(MTAStore.o)
___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRNPutiPay.a(MTAStore.o)
"_sqlite3_step", referenced from:
___27-[WXOMTAStore storeConfig:]_block_invoke in libRNPutiPay.a(MTAStore.o)
___40-[WXOMTAStore storeEvent:hasTrySent:CB:]_block_invoke in libRNPutiPay.a(MTAStore.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
请问有遇到的吗
集成友盟后,就会包冲突,不清楚怎么解决。
我测试过单独使用都可以,集成了就会报错,忘了截图报错代码了。。。
感谢开源!
问题:“第一步 前往node_module里的react-native-puti-pay 文件夹下的ios_pay_lib拷贝到工程目录下,并添加到项目中”,“并添加到项目中”这一步怎么操作,未做过ios开发,不太懂。
望指教。
使用命令: grep -r UIWebView ../node_modules/
搜索出如下:
../node_modules//react-native/node_modules/fbjs/lib/UserAgent.js.flow: * - UIWebView
../node_modules//react-native/node_modules/fbjs/lib/UserAgent.js: * - UIWebView
../node_modules//react-native-webview/README.md:- 7.0.1 - Removed UIWebView
Binary file ../node_modules//react-native-puti-pay/ios/libWeChatSDK.a matches
Binary file ../node_modules//react-native-puti-pay/ios/AlipaySDK.framework/AlipaySDK matches
../node_modules//metro/node_modules/fbjs/lib/UserAgent.js.flow: * - UIWebView
../node_modules//metro/node_modules/fbjs/lib/UserAgent.js: * - UIWebView
Binary file ../node_modules//@0x5e/react-native-alipay/ios/libAlipaySDK.a matches
我在自己的苹果笔记本上面安装了
两个版本的Xcode
Xcode Version 10.2.1
Xcode Version 10.1
React-Native Version 0.58.6 版本(无其他任何的第三方依赖)
react-native-puti-pay Version 1.3.0
Xcode Version 10.2.1 编译情况如下
报错
duplicate symbol _x509parse_verify in:
/Users/lk/Library/Developer/Xcode/DerivedData/zhitiaoapp-dweifzmlebcfneeupgtqkyzichrz/Build/Products/Debug-iphonesimulator/libRNPutiPay.a(AlipaySDK)
ld: 615 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Xcode Version 10.1 编译情况如下
完整编译通过
支付宝沙箱测试功能挺有用的,建议增加此支持,其实也比较简单,可以通过一个变量来设置调用接口前是否启用沙箱安全即可:
代码:EnvUtils.setEnv(EnvUtils.EnvEnum.SANDBOX);
版本依赖
"react": "16.11.0",
"react-native": "0.62.1",
"react-native-puti-pay": "^1.4.0",
安卓logcat信息
D/MicroMsg.SDK.WXMsgImplComm: pass
I/MicroMsg.SDK.WXApiImplV10: sendReq, req type = 5
D/MicroMsg.SDK.WXApiImplV10: pay, set wxappPayEntryClassname = com.tencent.mm.plugin.base.stub.WXPayEntryActivity
D/MicroMsg.SDK.MMessageAct: send, targetPkgName = com.tencent.mm, targetClassName = com.tencent.mm.plugin.base.stub.WXPayEntryActivity
D/MicroMsg.SDK.MMessageAct: send mm message, intent=Intent { flg=0x18000000 cmp=com.tencent.mm/.plugin.base.stub.WXPayEntryActivity (has extras) }
W/libEGL: EGLNativeWindowType 0x7e9b9f4010 disconnect failed
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
W/InputMethodManager: startInputReason = 1
W/libEGL: EGLNativeWindowType 0x7e9b9f4010 disconnect failed
I/zygote64: Do full code cache collection, code=124KB, data=95KB
I/zygote64: After code cache collection, code=113KB, data=64KB
还请大佬测试一下,什么原因造成的
比较需要支付宝沙箱的功能,能否发个新版本?
请问安卓调用支付宝,如果未安装支付宝客户端 支付宝会报resultStatus: "4000"
react-native : 0.59.8
经过测试,安卓9.0是无法拉起支付宝的 支付宝返回4000错误
测试安卓8.0 6.0 都可以正常调用支付宝网页支付.
请求作者查看
支付成功了, 然后点击返回商家 APP就闪退了,然后也没有回调
更新一下:ios测试也是支付没有问题,但是点击返回商家的时候不会返回到App,而是直接返回到微信的聊天页,好消息是APP没有闪退;
支付宝是没有问题的, 能支付 有回调
1.会是微信后台设置签名的问题吗?(
后台设置了app的签名和包名,XPay.setWxId('wx5910848fd932e0ee');这一步也做了
)
2.要么就是集成参数哪里不对
3.还是APP哪里的问题
4.测试用的debug版本
有没有老哥知道 怎么排查
可以告知一下详细的处理过程吗,谢谢🙏
AlipaySDK/AlipaySDK.h' file not found
第四步 设置 URL Scheme URL Scheme是通过系统找到并跳转对应app的设置,通过向项目中的info.plist文件中加入URL types可使用第三方平台所注册的appkey信息向系统注册你的app,当跳转到第三方应用支付后,可直接跳转回你的app。微信填写微信ID,支付宝也建议添加ap+加支付宝应用id的形式以免冲突。
指的是在info里找到URL Types,然后添加两行,dentifier和,URL Scheme应该填写什么?是填写dentifier:weixin,URL Scheme:收钱的企业微信ID还是微信平台里查到的AppID,支付宝也一样是吗?
CFBundleURLTypes
CFBundleTypeRole
Editor
CFBundleURLName
weixin
CFBundleURLSchemes
wxf541xxxxxxxxxx
CFBundleTypeRole
Editor
CFBundleURLSchemes
ap20180315xxxxxxxx
还有第五步,在AppDelegate.m下加下回调,
return [RCTLinkingManager application:application openURL:url options:options];
这句出错:No known class method for selector 'application:application openURL:url options:',
按React Native中文网上说明,改成下面的就通过了
return [RCTLinkingManager application:application openURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
感谢作者开源精神,能够为RN生态贡献自己的代码。作者能够在该库上增加支付宝授权登录和微信授权登录吗?
Release-iphoneos/libRNPutiPay.a(AlipaySDK)
ld: 615 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
求大神查看一下,项目上线急
iOS
In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
Go to node_modules ➜ react-native-puti-pay and add RNPutiPay.xcodeproj
In XCode, in the project navigator, select your project. Add libRNPutiPay.a to your project's Build Phases ➜ Link Binary With Libraries
Run your project (Cmd+R)<
没有报错信息, 直接失败
请问应该怎么办
URL Scheme 微信可以自己定义吗?
RN: 0.57
平台:adroid
支付宝能够正常拉起回调,但是微信会出现闪退的情况,想请问一下,是不是因为wxPay我传入的参数有误造成的?或者是有其他的可能性?
收不到回调信息
XPay.alipay(orderInfo, (res) => { });
rt
line 71:change to 'req.timeStamp = String.valueOf(params.getInt("timeStamp"));'
改成这样更符合编程逻辑,时间戳一般后台都是返回int,很少会返回string格式
生成的订单号是没有问题的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.