Webhooks functionality - webhooks

I would like to 'export' data out of ActiveCollab into another 3rd party tool (Helix ALM), but I'm confused about how webhooks function. Do webhooks execute a POST when changes are made in ActiveCollab, or are they executed by the 3rd party app and Activecollab returns the information that is requested in them? I'm trying to understand if ActiveCollab is 'pushing' data when changes are made, or if the data is being requested by 3rd party app. If AC is pushing data out, does it do so when ANY change is made or can it be configured to POST on specific/configurable changes?
I have reviewed the webhooks documentation but I'm unclear on the intended functionality.
https://activecollab.com/help/books/my-active-collab/webhooks

ActiveCollab sends out POST requests on relevant model events. These events are JSON encoded, and system will set User-Agent header to Active Collab when making a request.
No filtering for custom webhooks is currently available. You'll receive all webhooks, and you should filter them out on your end. Each webhook has event_type property set that you can use to find events that you are interested in.

Related

Stripe API testing automation

Background
I am integrating stripe API into my site to take one off payments. My site will be API first on server side with a separate web and mobile front end. I am working on the API server side code. I will eventually use stripe payment pages to take credit card payments. I am trying to automate the testing of my APIs and am bamboozled by the documentation (which are thorough) as I just can't see what steps to take next.
My server side initiates a call with stripe using stripe sdk to create a stripe Session object - this contains a URL to redirect to checkout.stripe.com/pay/..., a success URL when payment is successful and a cancel URL (these I set to handle the callback).
Problem
I can automate in Postman all my API calls from Browse Products, Select Product, Place Order but the next step I am stuck. After Placing Order I get back the stripe session but how can I mimick making the payment with stripe for the session and then call my Success URL ?
When the site is complete I will redirect the UI to stripe to take payments but I am testing and completing the back end flow first.
I have copied and pasted the session URL which is returned by the stripe Session object to bring up the page in a browser and used Dev tools on Chrome to inspect Network to see which APIs are being called by stripe in an attempt to reproduce and I can see a POST to stripe.com/api/payment_methods and I can see the posted values but I can't reproduce this in Postman. Also, the documentation (https://stripe.com/docs/api/payment_methods/create) says
"Instead of creating a PaymentMethod directly, we recommend using the
PaymentsIntents API to accept a payment immediately"
Question
Which stripe APIs do I need to call to automate the flow from a stripe Session object to make a payment and then check that it was successful? Payment Methods? Make a Charge? Payments Intents? ...and how. Happy to be pointed to the documentation if you can help me understand the flow.
TIA
Checkout is a Stripe product that looks like a "box" and you can't know (and shouldn't need to know) what happens inside. It is created for the purpose that merchants won't have to think about what's being done under the hood.
Speaking from an automation perspective, you can try to reproduce the whole process but there's no guarantee it won't change in the future, and it could leave you with more problems later.
For options to reproduce:
The closest way is simulating browser filling and submission, using automated browser tools (ie Selenium). But it's not as straightforward as PostMan. Generally you would want to simulate every browser action that a human could do.
Or you can try to accomplish the same with the logs and events you receive on Stripe's Dashboard, when you test a Checkout Session by yourself. From now there are 3 requests.
And your goal is to receive the same 5 events in Webhook:
TBH I recommend to reconsider the need of this test, to see if it worth your efforts.

Pass query parameter while making POST request from twilio webhook

When the call ends, I want to send data to Microsoft teams. For that purpose, I am making a POST request using the Twilio webhook. I have added the link for HTTP request in CALL STATUS CHANGES. But I also want to send data collected during calls. Is there any way to do that?
Article here(https://www.twilio.com/docs/usage/webhooks/voice-webhooks) doesn't mention anything about passing data.
My POST request URI looks something like this:-
https://xyz?Name=Himanshu&Phone=1234567890
I want Name and Phone data to be collected from Memory.
Twilio developer evangelist here.
When Twilio sends a webhook request about a voice call it will send a whole bunch of parameters including CallSid, To, From (the number user called from), AccountSid, CallStatus and more all of which are listed here.
I would not recommend making the Twilio webhook directly to Microsoft Teams as Twilio expects there to be a response to the request. Also, Twilio cannot know the name of your caller either.
Instead, I would recommend setting up the webhook request to go to your own application where you can parse out the data you need from the request, collect other data like name, and then make the request to Teams to complete your interaction.

Creating new payment method for Bigcommerce

I would like to know if this is possible to add new payment method for Bigcommerce. I tried to contact their support without any luck. If anyone is familiar with bigcommerce and know if this is possible, i would appreciate any advice.
I already read their API docs and didn't found anything useful - only method to obtain list of available payment methods.
I already tried to signup for their partner. Without any luck.
We've done this before for a couple stores to allow clients to process payments through their own processor. The way we achieved this, is essentially through the following high-level steps:
Allow payments by Check (or similar offline method). We are going to replace this with the custom processor.
You'll notice that if you attempt to checkout via Check, that BigCommerce automatically creates the order for you, but sets the order status to Awaiting Payment. Upon submission the user is automatically sent to a 'Thank You' Order Confirmation page that contains both the Order ID and some payment instructions (such as where to send the check to).
Here's the trick -- Modify this 'Order Thank You' page to prompt the user for her or his credit card information. A simple HTML form will suffice here, performing the actual request via JavaScript.
Once you have the user's credit card data, you can then POST it to your own external server, where you would connect to and send data to whichever processor you are using. Additionally, you should make sure to send the Order ID to this program, so that you can connect to the BigCommerce API to load billing information, and then subsequently adjust the order status to either approved or declined depending on the response from your processor. Finally, you should send back some sort of response to the client to inform of the result of the charge attempt.
That's pretty much it in a nutshell. The way you integrate with the payment processor (step 4) is unique to whichever processor you are using. I hope this makes sense.
Although opinion based, I'm a huge fan of serverless technologies, and would suggest looking into AWS Lambda + AWS API Gateway. The benefit here is that you don't need to worry about creating an infrastructure or the associated concerns of security and scale. Rather, AWS Lambda allows you to simply upload your software, and allows it to be executed via an HTTP request to some defined endpoint set through the API Gateway. Lambda will scale automatically for you, and you don't need to worry about system level security concerns - only security at the application level. It's truly a set and forget setup, and a bleeding edge technology. Not to mention dirt cheap!
Implementing a new payment method is unsupported and requires hacky workarounds since we implement payment gateways via the core app. You can do this on blueprint by using an offline payment method and then using the API to update payment statuses, etc. I'd recommend using ActiveMerchant if you do wish to go down this path.

"Request a Web Hook" Form - Filters?

The Evernote documentation on web hooks states the following:
If your service only cares about some notes, we can configure a filter on your API key. Notifications will only be sent when the note matches the filter. For example, the filter resource:image/* causes notifications to be sent anytime a note containing at least one image attachment is created or updated. The filter is configured on your API key, so it is the same for all users. The filter string supports our full search grammar.
This is great, except that the Webhook Request form doesn't have any input to specify a filter.
How do we make a request with specific filters?
If we have multiple environments (dev, stage, prod), is it okay to make a request for the same API Consumer Key but for different URLs?
I got a response to my webhook request via email, at which point they asked if I needed the webhook to point to the sandbox or production environment. In my response, I also mentioned the filter I would like applied, and they proceeded to make the webhook the next day. Overall it took about a week and a half to get it setup.

No source parameter in real-time response from API checkin

I have an app that
- initiates checkins via the API
- receives checkin data via the push mechanism
The JSON object returned by an API call contains a source parameter denoting the app. [This actually seems unnecessary, since my app is initiating the API call...]
The corresponding real-time push response sent to my app does NOT have the source parameter included. Why is that?
I'm attempting to filter out the push data related to my app's checkins, and the easiest way would be to inspect source parameter. [I could also inspect the checkin ids, and watch for duplicates in the two paths; but that seems unnecessary if the source parameter was always included.]
Unfortunately, that particular field isn't currently passed along in our Push API. What exactly are you trying to do?
If you're looking to get real-time notifications about your own app's check-ins, it seems like you don't really need foursquare's push API? You could just have your app send-up the info you want to your own servers at the same time (or immediately after) you check in the user on foursquare, so that you still get real-time info.
If that doesn't work for you, if the user has authorized your application (which will be the case if you're using the User Push API), you can query our check-in detail endpoint (https://developer.foursquare.com/docs/checkins/checkins) to get that info, and filter away the check-ins you're not interested in.

Resources