Add sample code for java payment api demo