Amazon FPS 400 Invalid Subscrption when Cancelling Valid Subscription - django

Thank you for taking the time to look at my question.
I'm using django on an ubuntu box.
I developed an 'upgrade account' feature for a client. The user clicks a button which then sends an api request to cancel their current subscription and redirects the user to amazon to create a new one.
It worked perfectly in sandbox.
In the first couple of weeks after deployment I've gotten a few errors from the cancel method: invalid subscription id. I checked the subscription id that was reported as invalid and it matches exactly to the subscription id on the client's amazon payment interface.
Does anyone have any idea why this would happen?
Below is the error message I received:
Error Message:
FPS Response Error: 400 ResponseError
Undefined response error.
Subscription Id xxxxxxxxxx is invalid.
This has never been successful in production.
I've also posted this question in the aws forum, with no response.
Please help!!

Just in case anyone comes up with the same question:
The boto app uses the fps sandbox as the default endpoint. I needed to change this in order
for it to work.
Like so:
kwargs = {'host' : simplepay.FPS_HOST}
fps_conn = FPSConnection(simplepay.ACCESS_KEY,
simplepay.SECRET_KEY, **kwargs)
Where FPS_HOST,ACCESS_KEY AND SECRET_KEY are defined in my apps' init.py and determined by whether debug is true or not.

Related

Twilio REST Exception HTTP 429 error: Unable to create record: Too many requests

I have created an app in Django. Using Twilio Verify API (free trial) for OTP.
Problem:-
It's working fine but when a user try to get the OTP multiple times, Twilio creates an exception "HTTP 429 error: Unable to create record: Too many requests". After this I was not able to use this for the whole day even for different mobile number or device.
How to bypass this issue and precisely what is the reason behind this issue?
Twilio Developer Evangelist here. The Verify API has rate limits for sending SMS codes to the same phone number, ~5 requests within 10 minutes. I'm not sure why it wasn't working with a different phone number, though - let me know if you're still having issues after you try the below.
You're definitely not the first person to run into this issue, so I have a blog post that should answer the question: How to test Twilio Verify without getting rate limited
tl;dr your options include -
Complete a verification lifecycle by calling the Verification Check endpoint
Wait for the verification to expire (in 10 minutes)
I also recommend spinning up a Verification Testing Dashboard that will help you check/cancel a verification during development.
Here's another blog post about managing retry logic that's also designed to prevent hitting API rate limits: https://www.twilio.com/blog/best-practices-retry-logic-sms-2fa
This may have been solved by now but for anyone else it's possible that the free Twilio trial account has expired or used up it's allocated requests. This happened me as I had forgotten I was using a trial account in a test environment, and when tests started to fail this was the issue.
I encountered the same problem with email channel when a user tries to send verify api multiple times and gets this error. All other emails would get the same error, and nobody can get verified. This looks to me that one user gets rate limited and it could affect all other users.

Notification endpoint validation timeout when deployed to AWS

When renewing a subscription to a user's mail inbox via Microsoft Graph API, we periodically get the following error from the Microsoft Graph API (a few times a day):
{
'error': {
'code': 'ValidationError',
'message': 'Subscription validation request timed out.',
'innerError': {...}
}
}
Since the request often times succeeds, it's doesn't look like an issue on our side. There are no issues in our logs and the response time is < 1s all the time.
Instead it seems like sometimes the validation request from Microsoft Graph API doesn't even come through to our endpoint. We use an AWS API Gateway. Is Microsoft Graph API sometimes blocking requests to https://subdomain.execute-api.eu-central-1.amazonaws.com?
The above error tells that its related to subscription. So check at your subscription level something changed or not. For troubleshooting, you can try, ngrok or POSTMAN.
Looks like the issue been resolved without doing any changes in your side. If there is any issue you can check with Microsoft support.

Production app: Invalid or unknown client (ID copied from credentials page)

I went through the sandbox testing and graduation procedure. My application got approved (for internal use), but I've been unable to use the new client ID.
The OAuth callback URL contains the error message:
GET /oauth2callback?error=invalid_request&error_description=OAU-230%3AInvalid%20or%20unknown%20client%3A%20xxxxxxxclientIdxxxxx
I copied my client ID several times from the application credentials page, it is correct and complete. The ID is repeated correctly inside the error message as well, so I know it's received on the production server. The production server URL is correct too.
What's going on here?
Apparently, all I had to do is wait. After graduating my application and getting the Approved message, RingCentral took a while longer for the new credentials to start working. I don't know how long it took, as I've waited 28 days to try again.

Issue in redirecting back to our Site from sandbox test authorize net

After processing the payment, control is not directing back to our site(x_relay_url) from https://test.authorize.net/gateway/transact.dll.
The URL mentioned in the x_relay_url cannot be accessed directly it requires session id and other details to access it which was passed to Authorize net page using merchantDefinedData variables.
I checked the following article also but our URL seems to be fine and we checked our code there is nothing wrong in that.
I tried multiple URLs in "x_relay_url" but nothing seems to be working.
Any help is appreciated.
Error Message:
An error occurred while trying to report this transaction to the
merchant. An e-mail has been sent to the merchant informing them of
the error. The following is the result of the attempt to charge your
credit card.
This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the product or service.

Transaction Failure in payment gateway Authorize.net

I have installed authorize.net sdk(PHP) and changed config file. I am running the sample app that comes along with the bundle.
When I proceed with the payment, the transaction fails and responses below error
"We're sorry, but we can't process your order at this time due to the following error:
The merchant login ID or password is invalid or the account is inactive.
response code 3
response reason code 13"
Naturally you need to verify your login credentials are correct. Also, make sure you are using the right server. You can use the production server or development server for testing. If you mix up your credentials that will cause this also.