Does silentpostURL expects any response from the server?
If Yes,
What are the possible response values?
If the response is false(0) then will the transaction for that month will be voided?
In a monthly recurring subscription, I have to stop charging the user for 1 or 2 months and after that it has to be started again. Is there any way to do it programatically?
Silent Post does not expect a response from your server like Relay Response does.
In a monthly recurring subscription, I have to stop charging the user for 1 or 2 months and after that it has to be started again. Is there any way to do it programatically?
You would need to cancel the first subscription and then create a new one when you want the subscription to start again.
Related
So I have notification system in place.For example when sending a task to user, user get a notification within my system. Right now I have only "instant" notifications. so when I send a task to someone, a notification is created in the db, and via web-socket the user is notified with the data of the notification.
With the Reminder I have the problem, that the notification I want to send here is not necessarily "instant". I want to set the date to next Monday on 9 am. so User should receive the notification on Monday 9 am.
Question: Is there an extension in django (or onboard methods) where I can execute stuff delayed? For example, send notification with the following data on Monday 9 am.
Celery can be used to schedule and defer tasks.
Here's and example of how to schedule for a specific time. https://docs.celeryq.dev/en/latest/userguide/calling.html#eta-and-countdown
I have read through the Budget Alert document here: https://cloud.google.com/billing/docs/how-to/budgets#delivery_guarantees has said that:
Budget notifications will be sent multiple times per day with the current status of your budget.
And here: https://cloud.google.com/blog/products/gcp/better-cost-control-with-google-cloud-billing-programmatic-notifications
also mentioned that Cloud Billing sends budget notifications multiple times per day
Set up a Cloud Function to listen to budget notifications and trigger an action.
Cloud Billing sends budget notifications multiple times per day, so you will always have the most up-to-date information on your spending.
I want to ask what "sends budget notifications multiple times per day" mean?
For example:
I have a threshold rule of 50%. When I break the rule of 50%, I will get budget notifications and this notification will be sent multiple times a day, right. Can I know the exact time when they send? (eg. 3 hours at a time or what...)
How can I configure the time to send budget notifications? (eg: once per day)
=========== UPDATE 29.11
After one day from the time I enabled budget-alert, I received budget notifications multiple times (about 30 min at a time)
like this
and my Slack always have a new message (look like spam)
Please help me, how can I configure the time to send budget notifications? (eg: once per day)
Thankyou!
Why do you want to receive budget notification only once per day or specific time?
It would be good if you get notification instantly when configured threshold is reached so you can review or take some action.
You can programmatically receive budget notifications. Budget events can be pushed to PubSub and then can be consumed by Cloud function (event-driven) or Scheduler (specific time).
Cloud Function or Scheduler can then send notification to email/slack or other channel.
This article should be helpful https://cloud.google.com/billing/docs/how-to/notify
You can do this programmatically in the cloud function. Set it to only post messages on slack if a condition is satisfied.
Example code from google documentation:
exports.notifySlack = async pubsubEvent => {
const pubsubAttrs = pubsubEvent.attributes;
const pubsubData = Buffer.from(pubsubEvent.data, 'base64').toString();
const budgetNotificationText = `${JSON.stringify(
pubsubAttrs
)}, ${pubsubData}`;
if({someCondtion} {
await slack.chat.postMessage({
token: BOT_ACCESS_TOKEN,
channel: CHANNEL,
text: budgetNotificationText,
});
return 'Slack notification sent successfully';
}
return 'Function triggered';
};
I am implementing in-app subscriptions with Google Play and synchronize the status of those through polling to Google Play API. The subscriptions have a trial period of 3 days and I expect Google API to return paymentState=0(Pending) or 1(Received) after the trial period has expired. This does not always happen for customers that have a payment failure, as Google keeps returning paymentState=0(Free trial).
It seems Google is giving a grace period, although I don't have any grace period configured for this subscription type.
Do you know why this happens and how should I update the trial period status when the 3 days of trial have expired?
Thanks
Reported this several times to google, the issue is still present, from my experience for some orders the SUBSCRIPTION_GRACE is sent >20 hours after the current cycle ends, and if you send validation request before this notification paymentState will still have value 1 or 2 instead of 0.
so I am looking into the postmates API and I have been able to create a delivery. This was great, I also setup a webhook url with ngrok to test the response from postmates but I am totally stumped as to how to determine when the pickup was actually completed and the dropoff/delivery was actually completed.
I saved all of the responses in a database and each time I did the test delivery, I received exactly 70 calls from the webhook endpoint. And each time 47 of them were in regards to the 'kind': 'event.delivery_status'. Here are the stats:
THIS IS ALL IN TEST MODE WITH THE SANDBOX...
11 of those are 'status':'pickup_complete'
14 of those are 'status':'pickup'
11 of those are 'status':'dropoff'
11 of those are 'status':'delivered'
all of the webhook responses for status=delivered have a 'data.courier_imminent':false value.
I went to the webpage for the 'data.tracking_url' and when the webpage showed that the delivery was complete, I immediately updated the database to see how many records that I had saved and I was only at 32 total records. this means that the webhook was continuing to send me updates after it was supposedly complete.
Lastly, all of these statuses are not in order, they are totally random, in fact the 6th to last record that was received was a pickup_complete status..
The real question:
how will I know what is actually a picked=completed, delivered=complete etc..
You'll receive a webhook of type event.delivery_status. One of the field within the body of the payload will be {status: "delivered"}. This has been accurate so far. Postmates doesn't return adelivered_at` timestamp, but you could create your own timestamp and store it along with the delivery for reporting.
As for the number of webhooks, Postmates has a delivery robot (called robo) that moves as if it was a real postmate. You'll receive a lot of webhooks of type event.courier_update with the updated location.
my app has list of events with start time (date and time). I want to make a scheduled task to send reminder via email to all user participate in event 1 hour before event start. (Note: Admin can change time of event).
I currently use celery to send email to list of participants when admin change the time of event.
Please suggest me some solution for this. Thanks.
Here's a recent(ish) discussion where a potential solution is proposed for celery: https://github.com/celery/celery/issues/4522.
I built Posthook to make solving these kinds of problems easier for developers. In your case, when a new event is created or the event time changes you can schedule a request back to your app for 1 hour before the start time. Then when you get the request from Posthook you can send out the reminder after validating that it still needs to be sent out.