我正在我的 android 应用程序中集成 payfort 支付网关。我已经使用 rest api https://sbpaymentservices.payfort.com/FortAPI/paymentApi生成了令牌,现在我必须将该令牌传递给 fort sdk 进行交易。
但是商家参考也需要生成才能传递到fort sdk。我找不到任何关于如何生成商家参考的信息,因为付款文档中没有给出任何内容。
我也和支持人员谈过,他们说我们必须用我们自己的算法创建商家参考
有人可以知道如何创建商家参考吗?任何帮助将不胜感激
String device_id = FortSdk.getDeviceId(this);
Log.e("device_iddd",device_id+"");
Map<String, String> map = new HashMap<>();
map.put("command", "AUTHORIZATION");
map.put("amount",String.valueOf(1));
map.put("language", "en");
map.put("merchant_reference", "r1FANA78-ok00tH0");
map.put("currency","SAR");
map.put("customer_name", "bharat");
map.put("customer_email", "bharat56@gmai.com");
map.put("order_description", "Description");
map.put("return_url", "http://faza.fazadigital.com/Faza_WS/payfortReturnPage.php");
map.put("sdk_token", "441E41CFFF2E49F2E053321E320A4884");
fortRequest.setRequestMap(map);
try {
FortSdk.getInstance().registerCallback(this, fortRequest, FortSdk.ENVIRONMENT.TEST, 10, fortCallback, new FortInterfaces.OnTnxProcessed() {
@Override
public void onCancel(Map<String, String> requestParamsMap, Map<String, String> responseMap) {
showProgress(false);
for (Map.Entry<String, String> entry : responseMap.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
Log.e("cancel", key + "////////" + value);
// do stuff
}
}
@Override
public void onSuccess(Map<String, String> requestParamsMap, Map<String, String> fortResponseMap) {
for (Map.Entry<String, String> entry : fortResponseMap.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
Log.e("responsee", key + "////////" + value);
// do stuff
}
}
@Override
public void onFailure(Map<String, String> requestParamsMap, Map<String, String> fortResponseMap) {
for (Map.Entry<String, String> entry : fortResponseMap.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
Log.e("failure", key + "////////" + value);
// do stuff
}
}
});
} catch (Exception ex) {
ex.printStackTrace();
}