【问题标题】:How to connect easypaisa/jazzcash payment gateway in flutter? [closed]如何在flutter中连接easypaisa/jazzcash支付网关? [关闭]
【发布时间】:2020-09-23 17:21:09
【问题描述】:

我卡住了怎么办,请给我发送代码并描述我。如何在颤振中连接 easypaisa/jazzcash 支付网关?

【问题讨论】:

    标签: sql-server flutter dart cross-platform payment-gateway


    【解决方案1】:

    我已经通过 REST APi 实现了爵士现金支付门, 第一步:登录沙盒爵士现金账户 第 2 步:选择 REST API 版本 1.1 第三步:复制商家id、密码、完整性salt id

    下面是代码和教程:https://www.youtube.com/watch?v=wW9V7IVjpic&t=10

     payment() async{
    var digest;
    String dateandtime = DateFormat("yyyyMMddHHmmss").format(DateTime.now());
    String dexpiredate = DateFormat("yyyyMMddHHmmss").format(DateTime.now().add(Duration(days: 1)));
    String tre = "T"+dateandtime;
    String pp_Amount="100000";
    String pp_BillReference="billRef";
    String pp_Description="Description";
    String pp_Language="EN";
    String pp_MerchantID="your id";
    String pp_Password="your password";
    
    String pp_ReturnURL="https://sandbox.jazzcash.com.pk/ApplicationAPI/API/Payment/DoTransaction";
    String pp_ver = "1.1";
    String pp_TxnCurrency= "PKR";
    String pp_TxnDateTime=dateandtime.toString();
    String pp_TxnExpiryDateTime=dexpiredate.toString();
    String pp_TxnRefNo=tre.toString();
    String pp_TxnType="MWALLET";
    String ppmpf_1="4456733833993";
    String IntegeritySalt = "your key";
    String and = '&';
    String superdata=
        IntegeritySalt+and+
            pp_Amount+and+
            pp_BillReference +and+
            pp_Description +and+
            pp_Language +and+
            pp_MerchantID +and+
            pp_Password +and+
            pp_ReturnURL +and+
            pp_TxnCurrency+and+
            pp_TxnDateTime +and+
            pp_TxnExpiryDateTime +and+
            pp_TxnRefNo+and+
            pp_TxnType+and+
            pp_ver+and+
            ppmpf_1
    ;
    
    
    
    var key = utf8.encode(IntegeritySalt);
    var bytes = utf8.encode(superdata);
    var hmacSha256 = new Hmac(sha256, key);
    Digest sha256Result = hmacSha256.convert(bytes);
    var url = 'https://sandbox.jazzcash.com.pk/ApplicationAPI/API/Payment/DoTransaction';
    
    var response = await http.post(url, body: {
      "pp_Version": pp_ver,
      "pp_TxnType": pp_TxnType,
      "pp_Language": pp_Language,
      "pp_MerchantID": pp_MerchantID,
      "pp_Password": pp_Password,
      "pp_TxnRefNo": tre,
      "pp_Amount": pp_Amount,
      "pp_TxnCurrency": pp_TxnCurrency,
      "pp_TxnDateTime": dateandtime,
      "pp_BillReference": pp_BillReference,
      "pp_Description": pp_Description,
      "pp_TxnExpiryDateTime":dexpiredate,
      "pp_ReturnURL": pp_ReturnURL,
      "pp_SecureHash": sha256Result.toString(),
      "ppmpf_1":"4456733833993"
    });
    
    print("response=>");
    print(response.body);
    

    }

    【讨论】:

    • 相同的代码是否也适用于 IOS 部分?
    • 是的,它会工作
    • pp_ResponseMessage":“请为 pp_SecureHash 提供有效值”面临此问题。所有提供给 API 的数据提供程序都可以。
    • 请不要更改代码中的任何内容,只需替换您的密码、IntegeritySalt 和商家 ID
    猜你喜欢
    • 2020-11-27
    • 2011-02-16
    • 2023-03-03
    • 2012-12-12
    • 1970-01-01
    • 2021-01-05
    • 1970-01-01
    • 2011-01-18
    • 2011-08-24
    相关资源
    最近更新 更多