Woocommerce Subscriptions get next payment date when subscription is renewed - hook-woocommerce

I’m using Woocommerce Subscriptions plugin in my Woocommerce site. I want to post the new renewal date for a subscription to an external API when a subscription is renewed. I’m trying to use the ‘woocommerce_subscription_renewal_payment_complete’ action hook so whenever a subscription is renewed I can access the $subscription object and the $last_order object. But when I try to get the $subscription->get_date(‘nex_payment’) date, it will always return the last renewal date and not the next renewal date. I looks like the $subscription has not really been updated before this hook and the ‘next_payment’ date is still not updated to the next value when firing this action hook.
Does anybody know how to get the real ‘next_payment’ date after a renewal has been completed?
Thank you!

for those that could be interested in a solution, I've finally found that there's an action hook called 'woocommerce_subscription_date_updated' that fires when a date of the subscription has been updated.
Simply add an action to this hook:
<?php
add_action('woocommerce_subscription_date_updated', 'subscription_date_update', 10, 3);
function subscription_date_update($subscription, $date_type, $datetime)
{
//Do your stuff here...
}

I believe that "woocommerce_subscription_date_updated" is an action in woosubscriptions v3 (although not in the API documentation) and was a filter in woosubscriptions v2 that is now depreciated. Since its not in the API documentation, I suppose that means it could change without notice. It is used internally in woosubscriptions.

Related

Automatically Download Apple Wallet Pass After Redemption

Is it possible to download a second wallet pass automatically after redeeming a wallet pass. We have seen that this is possible but could not find any solution for this. As i know our api can only return one kind of pass to our servers with wether you update or renewing the pass. We have attached a video where you can see that they download a second pass automatically without adding the card. As far we know the Apple Api only returns a get when want to download a new pass with a push notification
In this video you can see that
the wallet is downloading a next pass (5:39)
WalletPass Video
Would really appreciate help in this
Regards,
Oktay
The product in the video is our product. All changes are made by updating a pass already in the wallet. As long as the passTypeIdentifier and serialNumber remain the same, you can change any other content in a pass.
We have a redeem API endpoint that marks the first pass as being used, and sends an update to remove the barcode. 15 seconds later, a second update is automatically sent with the new pass details. The new details replace the old details of the original pass. The user only ever has one pass in their wallet. It is not possible to push a second pass (with a different passTypeIdentifier and serialNumber).

What can be the reason of “Unable to find subscription with identifier” in Rails ActionCable?

We have the iOS Application in which we are using the action cable to give me fast response as user like something or comment on any post. Few days back everything is working fine. But from last few days action cable is not working. And my iOS application is live on the App Store. When ever my back end developer broadcast from her side. I will not get the response. When I hit the action cable multiple times. Then I get the single response out of 4 of them.
Now if any body help me what can I do right now.
What can be the reason of “Unable to find subscription with identifier” in Rails ActionCable?
[![> Unable to find subscription with identifier:
{"channel":"CommonChannel","auth_token":"zoRGfSZhS3mH6UxENVcJ"}]]1]1
We have a single channel in which we have multiple actions because I cannot subscribe the channel every time and then hit any function it makes me irritate to do every time subscribe the channel and then call the function.
Does any body has the solution for this issue. We have tried the wait loop as well after subscribing any channel.
Please anybody help me.
Thanks in advance.
Might be a race condition, see other question: What can be the reason of "Unable to find subscription with identifier" in Rails ActionCable?
In rails the issue (https://github.com/rails/rails/issues/25381) was supposed to be fixed, but maybe you found another way to trigger it.
Try to add some wait between the initial hello request and the subscription. If you are using graphql subscriptions, try to add a sleep between the actioncable subscription and the graphql subscription

How do you modify an app that's on the app store without making your users update the app?

I am working on an mobile app that requires me to change the text displayed either on a weekly or a monthly basis, but I don't want to require the users to have to update the app every day or every week in order to see the changes. I would love suggestions on how to do this.
As a high-level answer, check the device date and display the proper text, if it is fixed and known ahead of time.
If not, have a file or api call send down the information and the next date of when the server should be checked for the next set of data.

Pubsubhubbub doesn't send push notification any more

In order to get notified whenever a channel has a new video I have implemented the Pubsubhubbub protocol as suggested here: https://developers.google.com/youtube/v3/guides/push_notifications
The server I have for the callbackUrl is a Node.js application and I use the "pubsubhubbub" package to bootstrap the creation and handling of any events.
But for whatever reason, the server doesn't receive any more requests. I've tried resubscribing to the YouTube channels but to no luck. Is there an expiration date after which all subscriptions are dropped so that I need to re-subscribe regularly?
Any help would be very much appreciated.
Short answer, YES. Unfortunately, You need to resubscribe again and again.
As I was looking for the same answer actually, after searching a bit, I found out finally that the subscription has an expiry date. See the "Subscriber Diagnostics" section for details (screenshot from "Subscriber Diagnostics" of my subscription)

Cannot publish a canceled event using Eventbrite API method event_update

everyone.
I am working with eventbrite's API for my application and am trying to update an eventbrite event using the method event_update. The call worked when I tried to cancel a live event but it doesn't work when I try to re-publish a canceled event. I can publish a canceled event from the "Quick Links" provided for each event under my account's "My Events" tab. So, I was wondering if this can be done using the API as well. The documentation for event_update says that allowed values for status field are “draft”, “live”, “canceled”, “deleted” but when I do the update, I get the following error:
Event deleted or cancelled.
Any help or input is greatly appreciated.
Thank you in advance.
At this time, a canceled event can only be made live again through the Quick Links in the My Events tab of your account. It's not possible to make a canceled event live through the Manage page or the API. This information has been passed along to the API team, and this should be resolved in the coming weeks. We'll let you know once it's been updated!

Resources