How to connect easypaisa/jazzcash payment gateway in flutter? [closed]
Asked Answered
M

1

8

How to do that i am stuck on that please send me code and discribe me.How to connect easypaisa/jazzcash payment gateway in flutter?

Multiple answered 4/6, 2020 at 16:19 Comment(0)
N
4

I have implemented the jazz cash payment gate through REST APi, Step 1: sign into sandbox jazz cash account Step 2: select the REST API version 1.1 Step 3: copy the merchant id, password, and the integrity salt id

here is the code below and the tutorial: 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);

}

Novosibirsk answered 21/11, 2020 at 2:25 Comment(5)
Will the same code work for the IOS part as well?Fog
Yes, it'll workNovosibirsk
pp_ResponseMessage":"Please provide valid value for pp_SecureHash" facing this issue. All provided data provider to API is fine.Inn
please do not change anything in the code just replace your password, IntegeritySalt, and merchant idNovosibirsk
@KhurramAliBangash from where to get the merchant id, password, and the integrity salt id,plz provide a detail answer,having issues in creating merchant accountComparator

© 2022 - 2024 — McMap. All rights reserved.