Mike Slinn
unread,Dec 26, 2012, 2:12:02 PM12/26/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to play-fr...@googlegroups.com, Alejandro Pedraza, Will Sargent
Alejandro,
Nice to see this in Scala.
Looks like you are using a custom field for something, and a Purchase
(whatever that is) is inserted into the database somehow before the IPN
is called by PayPal. I've also got a custom field, but it is static, so
the Completed logic would differ and there would be no Purchase. I'll
play with the remaining code; the task for me would be to create a
PaypalTransaction, along the lines of what Will does. Here is my
untested version of a chunk of his Java code, which I will convert to Scala:
Map<String, List<String>> dataMap1 = BodyParserUtils.parseTextAsFormUrlEncodedForJava(request().body().asText());
Map<String, String> dataMap = new HashMap<String, String>();
for (String key : dataMap1.keySet())
dataMap.put(key, dataMap1.get(key).get(0));
PaypalTransaction tx = new PaypalTransaction(dataMap);
if (StringUtils.equals(result, "VERIFIED"))
tx.processTransaction();
Thanks,
Mike