wht_sande_pay 0.1.0 copy "wht_sande_pay: ^0.1.0" to clipboard
wht_sande_pay: ^0.1.0 copied to clipboard

A new Flutter plugin.

wht_sande_pay #

集成微信开发SDK(支付、登录、分享)Flutter插件,集成衫德支付FlutterSDK.

Getting Started #

This project is a starting preferenceoint for a Flutter plug-in package, a specialized package that includes platform-specific implementation code for Android and/or iOS.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API .

Flutter插件获取 wht_sande_pay,本插件集成了wechat_kit 3.0.1具体使用方式请查看wechat_kit,谢谢!

使用步骤 #

  • 1、依赖插件 (具体版本以插件为准 wht_sande_pay),衫德对接文档这里。

    dependencies:
    wht_pay_plugin: ^0.0.8
    
  • 2、原生项目依赖

    • IOS配置
      1、注意:微信SDK一定要配置universal link,在工程对应的 plist 文件中,添加 LSApplicationQueriesSchemes Array 并加入 weixin,weixinULAPI。在在工程对应的 plist 文件中,配置返回的 URL Types,URL Schemes是你的微信App id(微信移动应用ID)。
      2、吊起支付宝支付后,无法返回原App,需要用户手动返回。
      3、银联配置需要在工程 info.plist 设置中添加一个 URL Types 回调协议(在 UPPayDemo 工程中使 用“UPPayDemo”作为协议),用于在支付完成后返回商户客户端,在手机上没有安装云闪付时,会吊起银联自身的快捷支付页面,可以输入卡号支付,见下图。在用户选择支付方式时,也可以选择一些银行的APP直接进行支付。在 Xcode7.0 之后的版本中进行开发,需要在工程对应的 plist 文件中,添加 LSApplicationQueriesSchemes Array 并加入 uppaysdk、uppaywallet、uppayx1、 uppayx2、uppayx3 五个 item 。 这个版本的银联SDK可以直接掉银行的APP,例如招商银行APP进行支付,但是在iOS15的情况下会报错, 如下图显示,解决办法是在LSApplicationQueriesSchemes加上,spdbcccUnionPay、credit、 spdbbank、ccbmbsylunionpay、paesuperbank、com.cebbank.ebank、cmbmobilebank、还可以加其他的银行APP,具体有哪些银行APP支持,请和业务经理沟通。

    • Android配置(在原生主工程manifest中加入)

                  <intent-filter>
                  <action android:name="android.intent.action.VIEW"/>
                  <category android:name="android.intent.category.DEFAULT"/>
                  <category android:name="android.intent.category.BROWSABLE"/>
                  <data android:scheme="sandcash"
                      android:host="scpay"/>
              </intent-filter>
      
  • 3、插件初始化 (需要传入一个服务端结果查询的API,用户IOS支付宝结果查询)

        ///初始化微信
        Wechat.instance
            .registerApp(
        appId: "wexinId",
        universalLink: "link",
            queryURL:"http://192.168.2.9:8888/payQuery"
        )
            .then((value) {
        /// 判断是否安装了微信
        MainService.to.checkWechatInstallStatus();
        });
    
  • 4、调起支付(衫德支付需要后端获取签名和签名信息)。

      ///衫德支付,请求签名拉起支付 100001 杉德,100002快接
    void reqestSdpaySgin({
    required String signType,
    required String orderAmt,
    required String merOrderNo,
    required String createIp,
    required String productCode}){
    MyHttpUtil().post("http://192.168.2.9:8888/sign",data: {
      "sign_type" : signType,
      "order_amt" : orderAmt,
      "mer_order_no" :merOrderNo,
      "create_ip" : createIp,
      "goodsName" : "测试商品",
      "code" : 100001
    }).then((value) {
      SDPPaymentBean bean =  SDPPaymentBean(productCode:productCode, orderAmt: "0.01", goodsName: "测试商品名称");
      Wechat.instance.generalPayment(bean: bean,parameter: value.data);
    });
    
    }
    
1
likes
120
points
7
downloads

Publisher

unverified uploader

Weekly Downloads

A new Flutter plugin.

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

convert, crypto, flutter, json_annotation

More

Packages that depend on wht_sande_pay

Packages that implement wht_sande_pay