Git Product home page Git Product logo

cordova-plugin-alipay's Issues

Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

Android进行真机测试的时候提示这个信息,具体调试堆栈信息如下,麻烦帮忙看看。多谢~~

W/System.err( 2368): java.lang.NullPointerException: Attempt to get length of null array
W/System.err( 2368): at java.security.spec.EncodedKeySpec.(EncodedKeySpec.java:37)
W/System.err( 2368): at java.security.spec.PKCS8EncodedKeySpec.(PKCS8EncodedKeySpec.java:35)
W/System.err( 2368): at wang.imchao.plugin.alipay.SignUtils.sign(SignUtils.java:17)
W/System.err( 2368): at wang.imchao.plugin.alipay.AliPayPlugin.sign(AliPayPlugin.java:154)
W/System.err( 2368): at wang.imchao.plugin.alipay.AliPayPlugin.pay(AliPayPlugin.java:59)
W/System.err( 2368): at wang.imchao.plugin.alipay.AliPayPlugin.execute(AliPayPlugin.java:45)
W/System.err( 2368): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
W/System.err( 2368): at org.apache.cordova.PluginManager.exec(PluginManager.java:133)
W/System.err( 2368): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
W/System.err( 2368): at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
W/System.err( 2368): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
W/System.err( 2368): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53)
W/System.err( 2368): at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err( 2368): at android.os.Looper.loop(Looper.java:145)
W/System.err( 2368): at android.os.HandlerThread.run(HandlerThread.java:61)
E/PluginManager( 2368): Uncaught exception from plugin
E/PluginManager( 2368): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
E/PluginManager( 2368): at libcore.net.UriCodec.encode(UriCodec.java:132)
E/PluginManager( 2368): at java.net.URLEncoder.encode(URLEncoder.java:57)
E/PluginManager( 2368): at wang.imchao.plugin.alipay.AliPayPlugin.pay(AliPayPlugin.java:62)
E/PluginManager( 2368): at wang.imchao.plugin.alipay.AliPayPlugin.execute(AliPayPlugin.java:45)
E/PluginManager( 2368): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
E/PluginManager( 2368): at org.apache.cordova.PluginManager.exec(PluginManager.java:133)
E/PluginManager( 2368): at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
E/PluginManager( 2368): at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
E/PluginManager( 2368): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
E/PluginManager( 2368): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53)
E/PluginManager( 2368): at android.os.Handler.dispatchMessage(Handler.java:102)
E/PluginManager( 2368): at android.os.Looper.loop(Looper.java:145)
E/PluginManager( 2368): at android.os.HandlerThread.run(HandlerThread.java:61)

调起支付失败

首先多谢分享。
Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

安卓 5.0
cordova version:6.2.0

关于这插件

亲,这个插件能实现支付宝账户间的直接互转么

提示 private key is NULL 怎么回事呀

privatekey 也打印出来了 是存在的,执行到这个代码的时候 就报错了
id signer = CreateRSADataSigner(self.privateKey);
NSString *signedString = [signer signString:orderSpec];
求解惑

命令行参数的长度限制?

cordova 5.4.0 / ionic 1.7.8 使用命令行引入插件后 package.json 和 plugins/fetch.json 中的 $PRIVATE_KEY都正确,但是platforms中目标文件还是 $PRIVATE_KEY,需要手工修改,这是什么问题啊? 我猜是 variable 的值不能太长,触发了cordova的相关BUG。

IOS couldn't call callback, but Android could in cordova 6.1.1

Modify the file AppDelegate.m, add the following code, this bug will disappear.

import <AlipaySDK/AlipaySDK.h>

  • (BOOL)application:(UIApplication *)application
    openURL:(NSURL *)url
    sourceApplication:(NSString *)sourceApplication
    annotation:(id)annotation {

    if ([url.host isEqualToString:@"safepay"]) {
    //跳转支付宝钱包进行支付,处理支付结果
    [[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) {
    NSLog(@"result = %@",resultDic);
    }];
    }
    return YES;
    }

上传Appstore被拒

作者您好,不知道怎么联系你。我最近用这个插件上传到Appstore审核时被拒,貌似使用了非公开的API,经过我的排查,请问会不会跟这个插件有关。

Apps that use non-public APIs will be rejected

android调用没反应

你好,我按照你的文档安装,有几点不是很明白,

1.我现在用的是这种方法安装的,cordova版本5.4.1,应该没问题吧
cordova plugin add $CORDOVA_PLUGIN_DIR --variable PARTNER_ID=[你的商户PID可以在账户中查询] --variable SELLER_ACCOUNT=[你的商户支付宝帐号] --variable PRIVATE_KEY=[你生成的private key]
2.你的调用方法是用的window全局调用吗?我用angular调用的话是这么写的
image
能弹出123456,但是在调用的时候报错了,显示pay not define;不知懂这里应该怎么调用pay函数

3.我支付宝那边应该用还没通过审核,不知道会不会影响插件的使用

安装失败

Checking connectivity... done.
'export' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
1.git clone https://github.com/charleyw/cordova-plugin-alipay.git && cd cordova-plugin-alipay && export c:\test=$(pwd) 执行的时候报的就是这个错 我不知道为什么

2.用你不用动配置文件的 安装 地址报这个错
Error: Failed to fetch plugin https://github.com/charleyw/cordova-plugin-alipay.git via git.
Either there is a connection problems, or plugin spec is incorrect:
Error: C:\Program Files\Git\cmd\git.exe: Command failed with exit code 128 Error output:
Cloning into 'C:\Users\31297\AppData\Local\Temp\git\1464595923182'...
fatal: unable to access 'https://github.com/charleyw/cordova-plugin-alipay.git/': Unknown SSL protocol error in connection to github.com:443

我想知道为什么id和 支付宝帐号要在命令行里跟上 为什么不能配置到文件中呢

安卓平台调用失败

安卓平台调用失败 返回的错误信息为null,参数都是正确的,不清楚是哪里有问题

把私钥放在客户端会不会有安全问题?

首先感谢作者的无私奉献。

在使用该软件时,我发现这个私钥是放在客户端的,按照支付宝文档的推荐,对于参数的加密应该放在服务端,客户端需要往服务端做一次请求得到各个参数和加密后的参数,然后客户端调用支付宝的sdk向支付宝端发起交易请求。 如果按照目前的用法,如果我的app被安装了10W台手机上,相当于我的私钥有10W份分散在各个用户手机上?

显示正在跳转支付宝,然后就提示交易订单处理失败,请稍后再试。(AL164)

android 的 日志。大神求解
THREAD WARNING: exec() call to AliPay.pay blocked the main thread for 21ms. Plugin should use CordovaInterface.getThreadPool().
05-02 15:17:20.784 30900-30923/com.aa.starter I/Timeline: Timeline: Activity_launch_request id:com.eg.android.AlipayGphone time:59828416
05-02 15:17:21.174 30900-30900/com.aa.starter W/IInputConnectionWrapper: showStatusIcon on inactive InputConnection
05-02 15:17:23.424 30900-30900/com.aa.starter I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@2b2ccdf0 time:59831052
05-02 15:17:23.484 30900-31284/com.aa.starter E/ContextImpl: IllegalArgumentException unbindService: com.alipay.sdk.util.i@280f8ca
05-02 15:17:23.504 30900-30900/com.aa.starter I/chromium: [INFO:CONSOLE(312)] "Error in Error callbackId: AliPay1040165311 : ReferenceError: results is not defined", source: file:///android_asset/www/cordova.js (312)

ios build error

hi,charleyw.
I use the plugin into my project , when i ionic build ios,ionic throw an error.
The following build commands failed: CompileC build/aliPayDemo.build/Debug-iphonesimulator/aliPayDemo.build/Objects-normal/i386/AlipayPlugin.o aliPayDemo/Plugins/wang.imchao.plugin.alipay/AlipayPlugin.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure) Error code 65 for command: xcodebuild with args: -xcconfig,/Workspace/AliPayPluginDemo/aliPayDemo/platforms/ios/cordova/build-debug.xcconfig,-project,aliPayDemo.xcodeproj,ARCHS=i386,-target,aliPayDemo,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Workspace/AliPayPluginDemo/aliPayDemo/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Workspace/AliPayPluginDemo/aliPayDemo/platforms/ios/build/sharedpch ERROR building one of the platforms: Error: /Workspace/AliPayPluginDemo/aliPayDemo/platforms/ios/cordova/build: Command failed with exit code 2 You may not have the required environment or OS to build this project Error: /Workspace/AliPayPluginDemo/aliPayDemo/platforms/ios/cordova/build: Command failed with exit code 2 at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23) at ChildProcess.emit (events.js:110:17) at maybeClose (child_process.js:1015:16) at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
I try to ionic platform remove ios and cordova plugin remove wang.imchao.plugin.alipay then i re-add these , but still get the same error.
I'm new to ios can you help me to solve this problem?

IOS 成功支付 或者取消回调报错了

ReferenceError: Can't find variable: results

JS
tradeNo = new Date().getTime() * 1024;
window.alipay.pay({
tradeNo: tradeNo,
subject: '逸家具支付',
body: '我是测试内容',
price: 0.01,
notifyUrl: 'http://your.server.notify.url'
}, (function(successResults) {
console.log(results);
}), function(errorResults) {
console.log(results);
});
不管是支付成功 还是取消支付,在调试时都报这个错误

但是xcode里面的result 是对的
reslut = {
memo = "";
result = "partner="2088221550482102"&seller_id="[email protected]"&out_trade_no="1496721314118656"&subject="\U6d4b\U8bd5\U6807\U9898"&body="\U6211\U662f\U6d4b\U8bd5\U5185\U5bb9"&total_fee="0.01"&notify_url="http://your.server.notify.url\"&service=\"mobile.securitypay.pay\"&payment_type=\"1\"&_input_charset=\"utf-8\"&it_b_pay=\"30m\"&show_url=\"m.alipay.com\"&success=\"true\"&sign_type=\"RSA\"&sign=\"\"";
resultStatus = 9000;
}

ionic info

Your system information:

Cordova CLI: 5.3.3
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.0.1
Ionic CLI Version: 1.7.7
Ionic App Lib Version: 0.6.3
ios-deploy version: 1.8.2
ios-sim version: 5.0.3
OS: Mac OS X El Capitan
Node Version: v4.2.1
Xcode version: Xcode 7.3 Build version 7D175

调用后 弹出 null

app功能都正常 机器上也安装了支付宝,其他程序都能正确打开支付宝,
$scope.zhifu = function () {
window.alipay.pay({
tradeNo: new Date().getTime(),
subject: "测试标题",
body: "我是测试内容",
price: 0.02,
notifyUrl: "http://your.server.notify.url"
}, function (successResults) {
alert(successResults);
}, function(errorResults) {
alert(errorResults);
});
}
alert(errorResults); 我打断点 他走到这里 直接弹出 null ,请问是什么情况

有空做个回调方法呗。。

android ios两个平台返回消息不太一样,而且 有支付宝客户端的跟没有支付宝客户端的返回机制好像也不太一样。。 感觉好难处理啊 ,觉得如果插件调用有成功失败回调就好多了,就不用处理那么多情况了,求添加带信息的回调

回调参数少了流水号

@charleyw 你好,我在ios平台成功调用了你的插件并且成功回调了参数successResults,但是里面少了trade_no流水号,请问是notify_url的问题还是其他什么原因

自动修改Url_Schema时多了个a

plugin.xml文件第83行左右,如下:

    <config-file target="*-Info.plist" parent="CFBundleURLTypes">
      <array>
          <dict>
              <key>CFBundleURLName</key>
              <string>alipay</string>
              <key>CFBundleURLSchemes</key>
              <array>
                  <string>a$PARTNER_ID</string>
              </array>
          </dict>
      </array>
    </config-file>

导致生成的形如com.xxx.demo会变成acom.xxx.demo。

IOS 调用alipay.pay闪退

cordova 6.1.1, iOS9.3.3, IOS8.1都有相同的情况
openssl_wrapper.m下的这里停住了,然后闪退:
rsa_private = PEM_read_bio_RSAPrivateKey(bio_private, NULL, NULL, "");

Android下成功调用支付了,应该可以确认是PKSC8格式了吧。

安卓版在模拟器里返回空的sign

在SignUtil的第20行:
PrivateKey priKey = keyf.generatePrivate(priPKCS8);
执行出错了,catch到错误是:

java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07209B:asn1 encoding routines:ASN1_get_object:too long

关于签名放客户端的安全问题

感谢能够分享此plugin
我注意到在发起支付前没有前往服务端请求签名,而将签名放置在客户端,感觉不够安全,虽然在用法上简单了许多,希望能出一份在服务器签名的代码,谢谢

ios支付宝客户端操作完成后不回调原app

如果手机没有装支付宝app,调用wap支付成功或取消支付后都能调callback函数。
如果打开手机支付宝app,支付成功或取消支付都不调callback函数,怎么解决?
急!

ios9 can't trigger payOrder's callback

ios9 can't trigger payOrder's callback,i try to add
<key>LSApplicationQueriesSchemes</key> <array> <string>alipay</string> </array>
to info.plist , but not work.

关于唤起支付界面

@charleyw 你好,当我首次安装应用付款的时候,唤起的是H5页面支付,并不会唤起支付宝客户端支付(注:手机已经安装了支付宝,且已经登录),求大神帮忙,这样的体验效果不太友好。

哥们 使用方法 讲的 不够明白啊

cordova.exec(successCallback, errorCallback, "AliPay", "pay", [paymentInfo]);
这个怎么用啊
还有这个
window.alipay.pay({
tradeNo: 112233445566, //这个是支付宝需要的,应该是一个唯一的ID号
subject: "测试标题", //这个字段会显示在支付宝付款的页面
body: "我是测试内容", //订单详情,没找到会显示哪里
price: 0.02, //价格,支持两位小数
notifyUrl: "http://your.server.notify.url"
}, function(successResults){//是成功之后的回调函数
alert(results)
}, function(errorResults){//是失败之后的回调函数
alert(results)
}
);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.