提交 5931b32a authored 作者: Whispa's avatar Whispa

commit commit

上级 ea92e8d7
...@@ -70,22 +70,20 @@ public class CardCharge { ...@@ -70,22 +70,20 @@ public class CardCharge {
return json; return json;
} }
private ApiQuery getPhoneJSON() { private JSONObject getPhoneJSON() {
String alg="3DES-24"; JSONObject json = new JSONObject();
ApiQuery json = new ApiQuery();
try { try {
json.putParams("txref", this.getTxRef()); json.put("txRef", this.getTxRef());
json.putParams("amount", this.getAmount()); json.put("orderRef", this.getTxRef());
json.putParams("currency", this.getCurrency()); json.put("amount", this.getAmount());
json.putParams("network", "MTN"); json.put("currency", this.getCurrency());
json.putParams("customer_email", this.getEmail()); json.put("network", "RWF");
json.putParams("customer_phone", this.getPhonenumber()); json.put("payment_type", "mobilemoneygh");
json.putParams("fullname", this.getFullname()); json.put("is_mobile_money_gh", "1");
json.put("email", this.getEmail());
json.put("phonenumber", this.getPhonenumber());
json.put("fullname", this.getFullname());
} catch (JSONException ex) { } catch (JSONException ex) {
ex.getMessage(); ex.getMessage();
} }
...@@ -142,10 +140,10 @@ public class CardCharge { ...@@ -142,10 +140,10 @@ public class CardCharge {
public JSONObject chargeMobileMoney() throws JSONException { public JSONObject chargeMobileMoney() throws JSONException {
ApiQuery json = getPhoneJSON(); JSONObject json = getPhoneJSON();
json.putParams("PBFPubKey", RaveConstant.PUBLIC_KEY); json.put("PBFPubKey", RaveConstant.PUBLIC_KEY);
json.putParams("redirect_url", this.getRedirect_url()); json.put("redirect_url", this.getRedirect_url());
json.putParams("payment_options", "account"); json.put("payment_options", "account");
System.out.println(json.toString()); System.out.println(json.toString());
String message = json.toString(); String message = json.toString();
...@@ -155,7 +153,7 @@ public class CardCharge { ...@@ -155,7 +153,7 @@ public class CardCharge {
Charge ch = new Charge(); Charge ch = new Charge();
return ch.charge(json,ed.getChargeEndPoint()); return ch.charge(client,ed.getChargeEndPoint());
} }
......
...@@ -43,16 +43,6 @@ public class Charge { ...@@ -43,16 +43,6 @@ public class Charge {
return this.apiConnection.connectAndQuery(api);
}
//for all charges
public JSONObject charge(ApiQuery api,String endpoint){
this.apiConnection = new ApiConnection(endpoint);
return this.apiConnection.connectAndQuery(api); return this.apiConnection.connectAndQuery(api);
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论