Limit on number of Paypal Billing Agreements - paypal-sandbox

I am implementing Paypal express checkout (using paypal rest sdk for php )in one of my projects for recurring billing (for subscription), every thing is working fine for the initial requests (about 10 checkouts) after that I start to get Error 400 for few days and then everything starts working again.
I just wanted to confirm if there is any sort of limit on creating billing agreement in sandbox environment?
Thanks in advance

Finally found the solution, the reason I was getting error 400 after some times was because I was setting a static time while creating billing agreement.
$agreement = new Agreement();
$agreement->setName('My Billing Agreement')
->setDescription('Subscription to My Billing Agreement')
->setStartDate(date('Y-m-d').'T9:45:04Z');
The reason this snippet was resulting in error is because the start date/time of the billing agreement can only be a future time.
All I needed to do was replace
setStartDate(date('Y-m-d').'T9:45:04Z')
with
setStartDate(date("c", time() + 1800))
and everything started working as expected. Hope this helps some one.

Related

How to setup web hooks to send message to Slack when Firebase functions crash?

I need to actively receive crash notifications for firebase functions.
Is there any way to set up Slack webhooks to receive a message when Firebase Functions throw an Error, functions crash, or something like that?
I would love to receive issue messages by velocity ie: Firebase Functions crash 50 times a day.
Thank you so much.
First you have to create a log based (counter) metric that will be counting specific error occurencies and second - you create alerting policy with Slack notification channel.
Let's start from finding corresponding logs that appear when the function throws an error. Since I didn't have one that would crash I used logs that indicated that it was started.
Next you have to create a log based metric. Ignore the next screen and go to Monitoring > Alerting. Click on "Create new policy", find your metric and select "Rolling Window" to whatever time period you need. For testing I used 1 minute. Then set "Rollind windows function" to "mean".
Now configure when the alert has to be triggered - I chose over 3 (within 1 minute window).
On the next screen you select notification channel. In case of Slack it has to be configured first in "Notification Channels".
You can save policy the policy now.
After a few minutes I gathered enough data to generate two incidents:
And here's some alerting related documentation that may help you understand how to use them.

Amazon Advertising API: report is 'in progress' forever, until 'server is busy'

Is anybody else having trouble with Amazon Advertising reports this week or am I doing something wrong?
This was working just fine last week, then all of a sudden I couldn't get reports any more. Instead of requesting a report and it being available max 10 seconds later, I get this response:
{'reportId': 'snip', 'status': 'IN_PROGRESS', 'statusDetails': 'Report generation is in progress.'}
Which is nothing out of the ordinary. Then a few minutes later I start getting this:
{'reportId': 'snip', 'status': 'IN_PROGRESS', 'statusDetails': 'Report generation job has been submitted.'}
And then eventually:
{'code': 'SERVER_IS_BUSY', 'details': 'Server is busy. Try again later.', 'requestId': 'snip'}
Authentication seems to be fine, I think I wouldn't be able to request a report without that working. And I think if I was getting throttled it would tell me that. FYI this is happening in the US and CA stores.
Aside: the Advertising API is such a hard one to google, given that its name is a subset of the Product Advertising API, which is completely different. Hopefully Amazon, given how often they change the names of things, decide to rename this one too.
EDIT: only having this problem with Sponsored Products reports. Sponsored Brands seems to be ok.
We use the same API as well, we are getting the same issue and their API has not been stable lately.

Using Firebase-Functions to Send Notifications Only When A Condition Is Met

I am working on a project that's supposed to send notifications to it's users when current date is equal to a given date specified by the user. So which firebase-function method is best suited for such kind of application: onUpdate, onWrite, onCreate or https.onRequest?
Note: the app or firebase-function should always check and compare the currentDate to the dates of every record in the database and send notifications if they match.
If I understand correctly that you want to regularly check if today's date (i.e. current date) is equal to a specific field date of one or more records in the database, you could indeed call a dedicated Cloud Function via an HTTP Request every day with an online CRON job like https://www.easycron.com/
You would then, in this Cloud Function, make a query to retrieve all records having this field equal to today's date and send a notification to the user.
If you give more details on your database structure and on the code you have already written, the community may be able to help you further.
PS: look also this answer from Frank van Puffelen: Cloud Functions for Firebase trigger on time?
I think I got a better site for this. Please try https://cron-job.org/en/. It's free and works / worked fine for me.
Thanks to everyone who spared there time to check out and possibly try to answer this question.

Firebase Remote Config A/B testing shows no results after 24 hours

I configured Firebase Remote Config A/B testing for Android, and we did rollout on at least 10K devices.
For some reason, I see "0 users" in my A/B test after more than 24 hours.
Firebase GMS version is: 11.8.0
Should it show A/B participants in real-time or it's ok to see 0 users after 24 hours?
P.S: We are able to get AB test variants on test devices through Firebase Instance Id, it works well.
The simplest experiment which is running has only app package as a target, with no additional filters. And it shows 0 users as well.
Finally, we found an answer!
Maybe somebody will find it helpful:
For now, it happens (no data in Firebase remote config A/B test experiment) if you have an activation event configured for A/B test experiment.
If you have 2 different experiments, both will fail to get results even if you have "activation event" configured only in 1 of them.
Additionally, remote config will not work as well, you'll be able to get only default values.
We already reported to Google about, so they'll fix it at some point I hope.
Another useful info which is really hard to get:
How long is it ok to see "0 Total Users" in experiment I've just
started?
It takes many hours before you can see any data in your experiment. We were able to see results only after 21 hours after experiment start, so if you configured everything well, don't worry and wait for at least 24 hours. It will show 0 "Total Users" for many hours after the start.
Should I use app versionName or versionCode in "Version" field of
experiment setup?
You should use versionName.
Some useful info from support:
Firebase SDK
Make sure your users have the version of your app with the latest SDK.
Since your experiment is with Remote Config
When activateFetched() is called, all events from that point on will be tagged with the experiment. If you have a goal or activation event that happens before activateFetched(), such as automatic events like first_open, session_start, etc., the experiment setup might be wrong.
Are you using an Activation Event?
Make sure to call fetch() and activateFetched() before the activation event occurs.
Experiment ID of the experiments (if support asks you about)
It's the number at the end of the URL while viewing experiment results.
This debugging log could be useful to get what is going on
Also:
The good way to check if your experiment is working now is to set it to a specific version you didn't publish yet and check logs from remote config with the fresh app install(or erase all app data & restart).
It should show different variant every time you reinstall the app, since your Firebase Instance ID changes after app reinstall/app data erase.
If you see variants change - then A/B test is running well.
In your "build.graddle": don't forget to set the same versionName which you set in experiment setup.
In my case, I was receiving results of A/B testing but suddenly, it stopped to appear. It had continued for 7 days and then results appeared. Firebase Support manager said:
what I suspected here is just a delay in showing the result in the
experiments
Additionally, she said that
With that, I would suggest always using the latest SDK version and
enabling Google Analytics data sharing.
In my case, I used I wasn't using the latest SDK version, but Google Analytics was enabled for "Benchmarking", "Technical Support", "Account Specialists" except for "Google products & services". I believe these settings were enabled by default (the screenshot from Google Analytics):

Authentication suddenly stopped working?

I am using the authentication API as directed here: http://docs.microsofttranslator.com/oauth-token.html
Everything was working fine for about a week and suddenly today at around 11:55pm eastern time, all calls to get a new token give 500 errors with the following stack:
http://pastebin.com/uQ3VL6Am
We simply make a POST request to https://api.cognitive.microsoft.com/sts/v1.0/issueToken
with header 'Ocp-Apim-Subscription-Key' set to our key
I tried using our second API key, and it still does not work. I tried regenerating another key, and it still does not work. Our account manager says that the account should be in good standing.
Thank you
This issue has been resolved by Microsoft as of 6pm PST 1/30/17.

Resources