I have been doing research for a couple of hours and haven't found any viable examples or information on how I could receive PayPal notifications for payments and process them within a Java Application.
What I want to do is:
Person makes payment.
PayPal sends a notification to the java program, indicating that they had made a payment, with email, usernames, amount, package name/ID, etc.
Java program processes the payment.
Perhaps I am looking at it the wrong way. So far I have found out that I need a webhook listener or some kind of IPN serverlet program that can read the POST messages PayPal sends and redirect them? Can't this be done directly within my java program?
Thank you!
As you've found, you really need to use Webhook (which is newer in PayPal) or IPN. This technologies let you to configure PayPal to send (as POST requests) certain events on a certain URLs. All you need to do in your program is to handle this events (requests) in Serlvet, RestHandler or whatever else.
Related
I need help with Microsoft teams integration. I have an system from which I want to send chat message to a particular user in MS teams upon an event in my system. How do I go about implementing this. The teams graph api documentation is not looking clear to me. Like it has body but no head and tail. I'm confused on where to start for this. I understand I need to use Graph API's create/send chat api to send messages but it says I need to configure a delegate user for this? How do I send messages on behalf of a external system? Can I can use Teams Java sdk based application? Or I need to create a bot? But I think it's for one-2-one conversation is it? I only want to send a one way message from external system to user. Someone with experience in this pls help me on a good approach for this.
All I want is to send chat message from external system to a user in teams.
You cannot use Graph API in this scenario if you want it on behalf of External system. The API is only available when you are having delegated permission.
Other option would be to create a Notification only bot. In this case please keep in mind that the bot needs to be installed in Teams of user you want to send notification. You can use this graph API to install bot in user's Teams- Install app for User.
Once it is installed you need to have user's Conversation.Id and ServiceUrl (maybe store it in database for all users). When you are done with everything you can send Proactive messages.
They have told us about the possibility of using webhook in a project in which a certain system needs to notify when an action occurs. At first we had proposed it as a batch that would consult the existence of data, then the webhook issue seemed acceptable to us.
Now, looking for information about webhooks, I can't find the difference between a lifelong rest API and webhooks. What is the difference between them? The system can call both as soon as the event occurs. What functionality would this additional webhook offer to the system calling the REST endpoint directly with the solution to be executed without further ado? Apart from the fact that the webhook must be public
I understand webhook as a publishing system that can be attacked as a POST, but this is precisely what I understand of a POST-type rest endpoint. I intend to create the webhook as a JAVA project, is there any point to take into account when building it that differentiates it from a normal REST endpoint?
Thanks
All the best
A webhook is an API endpoint. What makes it unique is that it is an endpoint in the "client" application.
For example, let's say your application uses a payment processing API. It makes GET and POST requests to that payment processor's API. But payments take time to be approved, so you set up a "payment approved" endpoint on your end and register it with the payment processor. Once the payment is approved, the payment processor will POST to your endpoint and your application reacts accordingly. We call this endpoint a webhook.
Here's the documentation for one such payment provider's webhook system: https://stripe.com/docs/webhooks.
We have developed a Google Action with Dialogflow that responds to personalized requests from users and performs some tasks that require a certain amount of time, usually several minutes.
Our goal is to announce the result of the tasks using the "Broadcast" feature of Google Assistant, but we can't find a way to send the command to Google Assistant.
Our agent receives the user's request and launches a Java application that executes the task, so it is the Java application that must communicate with Google Assistant when the process is finished.
From the Java application we can communicate with the agent using Dialogflow RPC API, but not with Google Assistant.
Is there any way to send the request to Google Assistant from the Java app? or... since we can communicate with our Google Action Agent... how could we send the request through the agent?
In other words, could the agent communicate with google assistant to use any of its features, for example, "Broadcast ..."?
We have checked Google Assistant SDK as alternative, but we are confused about it.
Please, excuse me for my bad English.
Any help would be appreciated. Thanks!
The "Broadcast" feature is not available to user-developed Actions, and probably not a good scheme to use in any event - if users will need to wait for a while for an answer, they probably don't want the answer suddenly announced when they're not expecting it.
Actions are typically meant to be conversational, rather than taking a while to reply with the answer, which is why there is a 5 second limit on how long the fulfillment has to do processing. If you do need to take a while, you have a few options available to you:
First is that you can use some other method outside of the Assistant to deliver the answer - possibly using something like Firebase Cloud Messaging or sending email to the user.
Similarly, you might be able to use notifications. In this scenario, your Java program would send a notification through the Assistant to the user when the information is available and store the result. The user can then activate the notification to continue the conversation and get the result. This has the advantage that the answer isn't just blurted out, possibly when the user isn't ready for it, but does have a downside that speakers don't (yet) support notifications.
You can also look into using a Media Response to set up a way for you to poll for new messages periodically. Under this scheme, you would fire off the Java program which would get the result and then store this in a way your fulfillment server can access. In your reply to the user saying you're working on the results, you would include a Media Response for some audio that plays for, say, 15 seconds. When the audio finishes, your Action will be called again and you can check to see if the result is available. If so, you send the result and continue or end the conversation. Otherwise, just send a Media Response.
The application I'm creating is supposed to allow client to send some feedback to server, so I make a simple httprequest with my feedback and other information in it, but I wanna make sure that request can only come my application, the rest should be rejected. So what are my choices?
Thank you for your helpful directions in advance.
P.s: I'm not asking for code, just the best practice.
I have looked for the same thing and what is possible is to force the app users to sign in with their Google account and then you can get verification via tokens that the call came from your app as described here:https://developers.google.com/identity/sign-in/android/backend-auth
That there isn't an option without having users sign in is disappointing.
So what I need is basically to create a java program that runs from command line and will continue to run until I decide to stop it. The goal of this program is to read email from a particular email address and create JIRA tickets using the contents of the email.
IE: subject of email will be title. Body will be description. Etc...
I am getting confused with how to go about with the design of how to do this. I know I can use JavaMail to gain access to the emails right? Then I just have to parse the email. But other than that I am a little stuck on how I should be making the JIRA Ticket
Thanks!
Your problem is an ideal use case for esb like mule or spring-integration. Basically these eip frameworks provide all building blocks you just need to connect.
First you need to define mail inbound. This component will automatically connect to an mail inbox and fetch all new messages.
Then define a transformation from e-mail message to json object. Finally POST that object using HTTP outbound. You can create ticket in JIRA using /rest/api/2/issue API method.
whole workflow can be implemented almost without coding. Of course you can do everything manually (using javamail and httpclient), but then threading, error handling and retrying is up to you.
For the future - if you're confused what requests are sent and so on - use Google Chrome.
Press Ctrl+Shift+I->Network and make request. If you need to login before etc. it is the same.
For handling HTTP requests (POST, GET, etc.) I recommend to use HttpClient or if you need to use JavaScript HtmlUnit.
So answer is this:
- Track what requests are made when you do certain things via web browser
- implements the same in Java code using HttpClient or HtmlUnit