Modify API to match PaymentPluginApi and fix bugs during java integration