I have followed the tutorial provided HERE. Quick start demo can be found HERE.
If I choose in "tokenizationSpecification" param below method,
private static JSONObject getGatewayTokenizationSpecification() throws JSONException {
return new JSONObject(){{
put("type", "PAYMENT_GATEWAY");
put("parameters", new JSONObject(){{
put("gateway", "example");
put("gatewayMerchantId", "exampleGatewayMerchantId");
}
});
}};
}
It works fine but if I Choose below method,
private static JSONObject getDirectTokenizationSpecification()
throws JSONException, RuntimeException {
if (Constants.DIRECT_TOKENIZATION_PARAMETERS.isEmpty()
|| Constants.DIRECT_TOKENIZATION_PUBLIC_KEY.isEmpty()
|| Constants.DIRECT_TOKENIZATION_PUBLIC_KEY == null
|| Constants.DIRECT_TOKENIZATION_PUBLIC_KEY == "REPLACE_ME") {
throw new RuntimeException(
"Please edit the Constants.java file to add protocol version & public key.");
}
JSONObject tokenizationSpecification = new JSONObject();
tokenizationSpecification.put("type", "DIRECT");
JSONObject parameters = new JSONObject(Constants.DIRECT_TOKENIZATION_PARAMETERS);
tokenizationSpecification.put("parameters", parameters);
return tokenizationSpecification;
}
Its not working.[Not displaying my list of cards.]
Note:- I have performed below method to generate public key and replaced it in constants file as well.
# generate private key openssl ecparam -name prime256v1 -genkey -noout -out key.pem
# generate a base64-encoded public key
openssl ec -in key.pem -pubout -text -noout 2> /dev/null | grep "pub:" -A5 | sed 1d | xxd -r -p | base64 | paste -sd "\0" -
Question:- -Do I must have developer profile in google pay to run the demo ?
BOdoXP+9Aq473SnGwg3JU1aiNpsd9vH2ognq4PtDtlLGa3Kj8TPf+jaQNPyDSkh3JUhiS0KyrrlWhAgNZKHYF2Y=
(from: developers.google.com/pay/api/web/guides/resources/…) – Soc