GitXplorerGitXplorer
w

cordova-wtto00-alipay

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.
Verified
8a77a17c49128550962c087604a138b2d1e07c78

Merge pull request #3 from wtto00/dev

wwtto00 committed 2 years ago
Unverified
62e23e9359aafc8ee46f2363acb217be863ee526

chore: new version

committed 2 years ago
Unverified
b275f97c628ba4cbc3ff0d639e65505b92d62032

chore: readme文档修正

committed 2 years ago
Verified
3effc1fbde74310f6ac3a9377ed2c78a2c1d3463

Merge pull request #2 from wtto00/dev

wwtto00 committed 2 years ago
Unverified
24ae6b4a34e981bcf7458decaabab09e1bef767c

chore: gitignore

committed 2 years ago
Verified
e9d713b2a5adc4559d7b07ac5dcdaaf482438739

Merge pull request #1 from wtto00/dev

wwtto00 committed 2 years ago

README

The README file for this repository.

cordova-wtto00-alipay

npm

cordova 支付宝支付插件,适配最新版本 2023/5/12

参考:cordova-plugin-alipay-v2

  • 🌟 支持最新版本支付宝 SDK(2023/5//12)
  • 🌟 支持安卓 13
  • 🌟 带有 TypeScript 类型支持
  • 🌟 附带完整注释

支持平台

  1. Android
  2. iOS

安装

cordova plugin add cordova-wtto00-alipay --variable APP_ID=your AppId

使用 API

  1. 订单在服务端签名生成订单信息,具体请参考官网进行订单签名

    带有签名信息的订单信息示例

    var orderInfo =
      "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&notify_url=http%3A%2F%2Fdomain.merchant.com%2Fpayment_notify&sign_type=RSA2&timestamp=2016-08-25%2020%3A26%3A31&version=1.0&sign=cYmuUnKi5QdBsoZEAbMXVMmRWjsuUj%2By48A2DvWAVVBuYkiBj13CFDHu2vZQvmOfkjE0YqCUQE04kqm9Xg3tIX8tPeIGIFtsIyp%2FM45w1ZsDOiduBbduGfRo1XRsvAyVAv2hCrBLLrDI5Vi7uZZ77Lo5J0PpUUWwyQGt0M4cj8g%3D";
  2. 调用支付插件

    cordova.plugins.alipay.payment(
      orderInfo,
      (e) => {
        // e.resultStatus: '9000'|'8000'|'6004'
        console.log("支付成功" + e.resultStatus);
        //TODO 服务器检查支付结果
      },
      (e) => {
        console.log(
          `支付失败: ${
            cordova.plugins.alipay.ResultStatus[e.resultStatus] || "未知错误"
          }`
        );
      }
    );