Reputation: 247
I have been reading about the payeezy gateway, and decided to try it, looked up the git hubrepo and tried it . after having to perform various changes to the provided sample.html
to get it working, finally was able to get a response with a token, but now I am kind of lost , their documentation suggests to process the payments , to look in this link as you have figured by now, I dont know how to implement that part and would appreciate guidance from here on
I have right now
-sample.html which contains credit card data and info, including api key, api secret and tokens
-succesful token response
Upvotes: 0
Views: 1109
Reputation: 106
Here is how to integrate with Java SDK. You may choose any other integration method.
example code:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String cardType=(String) request.getParameter("cardType");
String cardHolderName=(String) request.getParameter("cardHolderName");
String expMonth=(String) request.getParameter("expMonth");
String expYear=(String) request.getParameter("expYear");
String payeezyToken=(String) request.getParameter("payeezyToken");
String amount=(String) request.getParameter(("amount"));
client.setAppId("y6pWAJNyJyjGv66IsVuWnklkKUPFbb0a"); //Your API Key client.setSecuredSecret("86fbae7030253af3cd15faef2a1f4b67353e41fb6799f576b5093ae52901e6f7"); //Your API secret
client.setUrl("https://api-cert.payeezy.com/v1");
TransactionRequest trequest=new TransactionRequest();
trequest.setPaymentMethod("token");
trequest.setAmount(amount);
trequest.setCurrency("USD");
trequest.setTransactionType("purchase");
Token token=new Token();
Transarmor ta = new Transarmor();
ta.setValue(payeezyToken);
ta.setName(cardHolderName);
ta.setExpiryDt(expMonth+expYear);
ta.setType(cardType);
token.setTokenData(ta);
token.setTokenType("transarmor");
trequest.setToken(token);
TransactionResponse tresponse=new TransactionResponse();
tresponse=client.postTokenTransaction(trequest);
}
Upvotes: 1