Open KrishanMac opened 2 years ago
@KrishanMac You can use config options to set those things. Attaching the doc here, link
@KrishanMac You can use config options to set those things. Attaching the doc here, link
isn't that for web- integration , I need to it android-integration . I have read it and try some JSON format it doesn't seems to be working .
It also works for android. You have to position the objects correctly. You can look at the js example in the doc.
I have read of doc. available and its still confusing . Why do we need JS is there JSON way do doing it like I wrote in the above code. Its my first time implementing Razor so im still loss .
@KrishanMac you can convert the json object in the js example to jsonobject for java.
Checkout checkout = new Checkout();
checkout.setKeyID(keyId);
checkout.setImage(R.drawable.isthmus_logo);
try {
JSONObject orderRequest = new JSONObject();
JSONObject configObj = new JSONObject();
JSONObject displayObj = new JSONObject();
JSONArray hideObj = new JSONArray();
JSONObject methodObj = new JSONObject();
JSONObject methodObj2 = new JSONObject();
JSONObject methodObj3 = new JSONObject();
JSONObject preferencesObj = new JSONObject();
preferencesObj.put("show_default_blocks", "true");
methodObj.put("method","wallet");
methodObj2.put("method","paylater");
methodObj3.put("method","emi");
hideObj.put(methodObj);
hideObj.put(methodObj2);
hideObj.put(methodObj3);
displayObj.put("hide",hideObj);
displayObj.put("preferences",preferencesObj);
configObj.put("display",displayObj);
orderRequest.put("name", "Isthmus Business");
orderRequest.put("amount", subOrderAmount); // amount in the smallest currency unit
orderRequest.put("currency", "INR");
if (razorOrderId != null) {
orderRequest.put("order_id", razorOrderId);
}
orderRequest.put("config", configObj);
Log.i(TAG, orderRequest.toString());
checkout.open(getParentFragment().getActivity(), orderRequest);
And this is the output JSON String structure :
{"name":"Isthmus Business", "amount":94900, "currency":"INR", "config":{ "display":{ "hide":[ {"method":"wallet"}, {"method":"paylater"}, {"method":"emi"} ], "preferences":{ "show_default_blocks":"true" } } } }
The wallet and paylater are gone from the payment options but still the emi option there . Is this a bug or did i do anything wrong . Thanks in advanced.
resolved the emi option or not ?
resolved the emi option or not ?
Not much have change
This is the code I wrote to disable some of the payment options , but it seems to be not working . Is there an easier way to disable those given payment options programmatically for android app . Thanks in advanced.