Code Monkey home page Code Monkey logo

Comments (23)

charleyw avatar charleyw commented on July 18, 2024 2

@mlgmlg 等周天,看有时间我加一下。不过你得自己在服务端生成sign

from cordova-plugin-alipay.

charleyw avatar charleyw commented on July 18, 2024

安装好之后在页面里面直接调用

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)
  }
);

from cordova-plugin-alipay.

mlgmlg avatar mlgmlg commented on July 18, 2024

可是这报错啊
Error: window.alipay is undefined

from cordova-plugin-alipay.

charleyw avatar charleyw commented on July 18, 2024

你怎么安装的?

from cordova-plugin-alipay.

wangxiaochuan366 avatar wangxiaochuan366 commented on July 18, 2024

请问自动安装后要在页面中引入alipay.js吗?要在plugin.xml中删除并且替换下面两处的私钥吗?还有Android文件夹下面的res文件夹config.xml中的privatekey?麻烦大神给个回复谢谢,谢谢,谢谢,谢谢。重要的事情说四遍。

from cordova-plugin-alipay.

charleyw avatar charleyw commented on July 18, 2024

自动安装之后什么都不用干。

直接使用就可以了:

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)});

试下看能调出支付宝不

from cordova-plugin-alipay.

wangxiaochuan366 avatar wangxiaochuan366 commented on July 18, 2024

你好 可以的 但是会报al164错误 现在我在查公钥和私钥的配置是否正确 还是要非常感谢你。

from cordova-plugin-alipay.

mlgmlg avatar mlgmlg commented on July 18, 2024

@charleyw 哥们 不考虑一下 把私钥配置到服务端, 服务端生成sign ?

from cordova-plugin-alipay.

mlgmlg avatar mlgmlg commented on July 18, 2024

@charleyw ok ,服务端确实是要自己写的。
不管什么语言,约定好了,生成sign就没问题。
参数顺序不一样,sign 就不一样。
还有私钥的格式 也决定了sign 。
好多都是出问题在sign上。

我已经做好了心理准备。。

from cordova-plugin-alipay.

wangxiaochuan366 avatar wangxiaochuan366 commented on July 18, 2024

@charleyw 还想问下 你的列子中我从服务端获取的sign在什么地方填写呢 列子中只需要填5个参数

from cordova-plugin-alipay.

charleyw avatar charleyw commented on July 18, 2024

得加新的方法。接收的参数应该会变,跟现在不一样,肯定多sign,其他几个可能可以省掉了。我得完了看看alipay的API才知道。

from cordova-plugin-alipay.

wangxiaochuan366 avatar wangxiaochuan366 commented on July 18, 2024

辛苦了, 大神 。最好能把私钥和sign在服务端生成 pay方法传入一些无关紧要的参数 客户端不存这些数据 祝周末愉快。

from cordova-plugin-alipay.

charleyw avatar charleyw commented on July 18, 2024

不好意思。周末太忙了。估计得等两天 有空了 才能弄。

from cordova-plugin-alipay.

wangxiaochuan366 avatar wangxiaochuan366 commented on July 18, 2024

自己也试着在修, 希望能改成自己需要的那种,还是谢谢大神了。

from cordova-plugin-alipay.

lingxuesonga avatar lingxuesonga commented on July 18, 2024

@mlgmlg Error: window.alipay is undefined 这个问题,你是咋解决的啊

from cordova-plugin-alipay.

mlgmlg avatar mlgmlg commented on July 18, 2024

@lingxuesonga
时间挺长的,记不清了。
关于这个错误,看看有没有引用cordova.js ,或者你安装插件的时候 有没有提示jar 库冲突。
我最后没用楼主这个插件,抱歉。希望能帮到你。

from cordova-plugin-alipay.

lingxuesonga avatar lingxuesonga commented on July 18, 2024

@mlgmlg 最后用到了什么插件啊,推荐下哈

from cordova-plugin-alipay.

mlgmlg avatar mlgmlg commented on July 18, 2024

@lingxuesonga https://github.com/TongChia/cordova-plugin-pingpp

from cordova-plugin-alipay.

wangxiaochuan366 avatar wangxiaochuan366 commented on July 18, 2024

@mlgmlg 用这个插件ping++ 会另外收取一定的费用吧?

from cordova-plugin-alipay.

mlgmlg avatar mlgmlg commented on July 18, 2024

@wangxiaochuan366 我问过,貌似不收,要不你再问问客服?
我这有个客服聊天的截图 http://blog.csdn.net/ganggelove/article/details/50821101

from cordova-plugin-alipay.

wangxiaochuan366 avatar wangxiaochuan366 commented on July 18, 2024

@mlgmlg 好的 非常感谢

from cordova-plugin-alipay.

lingxuesonga avatar lingxuesonga commented on July 18, 2024

@mlgmlg 他这个插件,要在他们网站注册吧

from cordova-plugin-alipay.

mlgmlg avatar mlgmlg commented on July 18, 2024

@lingxuesonga 可以去了解一下,博客写了http://blog.csdn.net/ganggelove/article/details/50821101

from cordova-plugin-alipay.

Related Issues (20)

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.