How can we void a fedex shipment using FedEx API? - fedex

Can we void a FedEx shipment ? Is this same as cancelling a shipment?
What are the queries to run voiding a shipment in FedEx?

You can delete (or cancel) a FedEx shipment as long as it hasn't been tendered to FedEx. The Shipping API provides a delete shipment functionality which is very straight forward. You may find extra information about it in section 2.3 of the FedEx Ship Service Documentation.
Regards,

Related

Twilio. How to get not viewed messages count by users

Is there any option to get unread messages count by user? Is there any Twilio apps that can help me?
I just need mapping, ex:
[{user: messages_count}, {user2: messages_count}, {user3: messages_count}, ...]
Is there any chance to get data for my backend like this?
Library provided by Twilio for backend is not vectorized and I need to make 1000+ post requests. It can take a century).
I'm considering webhooks or whatever that can helps me to get this data, and not kill my server.

Spring Websocket dynamic subscribption

Is it possible to do a dynamic subscription with spring WebSocket?
We have a multi-tenancy application and the need is to send messages to a group of users within the tenant. I am currently achieving his with a user-specific queue, but this is not effective as we are adding the same message to all the user's queues. The problem with using a tenant-specific topic is from the client any one case subscribe to the same topic once the topic name is known.
Any ideas or help will be appreciated.
You could use a Topic and subscribe it from every user (frontend).
Then you send the Messages for a group of Users to this Topic.
So every subscribed user get Updates broadcasted.
Perhaps this Tutorial would help.
https://www.dariawan.com/tutorials/spring/spring-boot-websocket-stomp-tutorial/
To make it more secure, you can add the SessionIDs to virtual groups, so its safe only specific users are allowed to subscribe the Topic.

Use of Datadog and Webhooks to call multiple numbers

I have my application integrated with Datadog for monitoring purpose. At the same time I want the notifications/calls to be sent to the team if any of the metric fails to achieve the desires value. I used Webhooks integration in Datadog for this purpose. In the webhooks configuration I have set the URL (Twilio request) and I do get a call on my number. Now I am looking for an scenario wherein if the user doesn't pick the call for say 30secs then try calling the second number. How do I achieve this?
Just use a find me Twimlet. Enter up to 10 numbers and a timeout between moving on to the next number. Twilio will do the rest.
https://www.twilio.com/labs/twimlets/findme
If you are looking for a more full featured paid solution I'd recommend PagerDuty. DataDog has an integration for PagerDuty. Any monitor that gets triggered that mentions #pagerduty-myteamname(as example) in the monitor message will cause PagerDuty to page the on call person. If that person does not acknowledge the page you can configure it to go through list of people to contact next until it is acknowledged by someone.

How to notify an API user once a process has been finished?

I have an API where users can create, what I call, orders.
I enqueue those orders and process them via Sidekiq gem. When the process is done, I currently send an email to the user. However, I am looking on how to notify him programatically.
So, sending the user a POST request to a particular endpoint, telling him that the order has been processed.
I am wondering which kind of security or other technical things I should take into account when doing this, or if there is any kind of gem that would help me on developing this.
you can check pub/sub pattern to do this...
when sidekiq finish processing then you publish an event... and you register the browser to listen to this event... which is better than sending the user a POST request to a particular endpoint, telling him that the order has been processed.
there are many libraries out there that can help you implementing the pub/sub pattern check the following...
PubNub
Pusher
Bunny
RabbitMQ
Redis
please note that you will have to use the rails app as the publisher and the front end as the subscriber ( you can check equivalent libs for JS )
and if you are interested in implementing the pub/sub within the same rails app... i've looked a lot and found that only those are the working solutions ( for app to publish and listen to his published events without getting locked in the process )
EventBus
Event_BG_Bus
Wisper
this is a post on how to use those gems to implement pub/sub pattern

Using Stripe webhooks with Rails

I have successfully built out a rails app as per Ryan Bates' railscast (http://railscasts.com/episodes/288-billing-with-stripe) - However, in the railscast he doesn't cover webhooks. I was wondering if there are any good examples in the public domain of implementing and using webhooks to manage a subscription billing that has been created.
Any thoughts / direction would be super helpful?
Thanks!
There's a nice gem for this: https://github.com/integrallis/stripe_event.
It looks to be well written and maintained.
In your gemfile you can simply add the line -
gem 'stripe_event'
There's clear doc in the readme on github.
Most all payment gateways, including stripe, have some way of telling the client (your webapp) whether the charge went through or not.
For stripe, their docs show how to receive a webhook notification from them.
The flow is:
Create a controller and method in your app to receive the webhook calls from stripe. Note that the calls will come in as POSTs, not GETs
Register the url with stripe using their dashboard. This is a manual step that you do once.
When your method is called from stripe, use the event info to update your models which track the status of your users' subscriptions.
Any questions?
I'd like to use this gem for testing stripe webhooks https://github.com/stripe-ruby-mock/stripe-ruby-mock
Features
No stripe server access required
Easily test against stripe errors
Mock and customize stripe webhooks
Flip a switch to run your tests against Stripe's live test servers

Resources