AWS Access Key Id needs a subscription for the service - php

I am getting following error when tried to create topic for amazon sns messaging.
The AWS Access Key Id needs a subscription for the service (Service: AmazonSNS; Status Code: 403; Error Code: OptInRequired; Request ID: 9b0bd34b-6ebd-5ece-a78d-8013adb25940)

It may be possible that your account is new and payment mode is still not verified by Amazon. Please re-check and try to contact with their support.

Related

Stripe CLI Connection to remote host denied

I created the localhost alias webhook on the stripe dashboard, in my command promt i ran the listener fro Stripe CLI
C:\MAMP\htdocs\bla> stripe listen --load-from-webhooks-api --forward-to https://bla.dev.com --skip-verify
> Ready! You are using Stripe API Version [2022-08-01]. Your webhook signing secret is whsec_XXXXXXXXXXXXXXXXXXXXXXXX55 (^C to quit)
when i test the payments i get this in my command prompt
2022-12-14 15:16:25 --> checkout.session.completed [evt_1MEpCWDT9pjYXXXXX]
2022-12-14 15:16:25 <-- [200] POST https://bla.dev.com/frontend/web/payment/stripe/endpoint/ [evt_3MEpCKDT9pjYPnbXXXX]
2022-12-14 15:16:25 --> charge.succeeded [evt_3MEpCKDT9pjYXXXXXX]
2022-12-14 15:16:26 <-- [200] POST https://bla.dev.com/frontend/web/payment/stripe/checkout/endpoint/ [evt_1MEpCWDT9pXXXXX]
but when i check my stripe dashboard, it shows this error
Connection to remote host denied (please contact support at https://support.stripe.com/contact/)
The url https://bla.dev.com/frontend/web/payment/stripe/endpoint/ is valid Alias, when i type it into browser i get a 405 error, because it only allows POST
Any idea how to fix this? it worked before, not sure what broke.
Forwarding the events in CLI to Webhook URL and setting Webhook URL in Dashboard are two different locations to Stripe and the event will be sent to both.
Forwarding the event from CLI goes through: Stripe -> local -> Your
webhook URL
Setting Webhook URL in Dashboard has events goes through: Stripe -> Your webhook URL
With Connection to remote host denied, it's likely that your Webhook URL is not publicly accessible. Common reason can be that the domain is not accessible from external and only works in your location machine.

Google Server-to-Server OAuth2 PHP example not working

I am following this example to get server-to-server access working between my PHP application and Google Cloud API's,
https://developers.google.com/api-client-library/php/auth/service-accounts. In particular, I need to access the Drive API.
When I run the application though I get the following error:
Google_Service_Exception : {
"error": "unauthorized_client",
"error_description": "Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested."
}
Here's what I have done:
Created a GCP project
Added a service account to the project, with domain wide delegation, and a set of keys
Enabled the Google Drive API in the project
In my G Suite account, under 'Manage API client access', I have added the Client ID of my service account, with the permission of https://www.googleapis.com/auth/drive
Have I missed a step?
Here's my code:
putenv('GOOGLE_APPLICATION_CREDENTIALS=my_storage/secure/my-app-service-account.json');
$client = new \Google_Client();
$client->setScopes(\Google_Service_Drive::DRIVE_METADATA_READONLY);
$client->useApplicationDefaultCredentials();
$client->setSubject('my_email#my_domain.com');
$drive = new \Google_Service_Drive($client);
echo $drive->about->get();
The example does not include the setScopes() call, however I was getting a scope-related error without it. (The example is not based on the Drive API, so perhaps it's not required in that case?)
UPDATE: In the IAM settings for the GCP, I added the email address of the service account as a Project Owner, but that made no difference.
I found the problem.
In the setScopes() call above, the value passed needs to be the same as the value given when setting up the client in G Suite, in this case https://www.googleapis.com/auth/drive

Not able to configure change object notification for php application in google app engine

I am getting the following error when I try to setup notification using gsutil command:
gsutil notification watchbucket https://APPLICATION-ID.appspot.com/cron gs://bucket
Watching bucket gs://APPLICATION-ID.appspot.com/ with application URL https://APPLICATION-ID.appspot.com/cron ...
Watch bucket attempt failed:
AccessDeniedException: 403 Forbidden
You attempted to watch a bucket with an application URL of:
https://APPLICATION-ID.appspot.com/cron
which is not authorized for your project. Please ensure that you are using
Service Account authentication and that the Service Account's project is
authorized for the application URL. Notification endpoint URLs must also be
whitelisted in your Cloud Console project. To do that, the domain must also be
verified using Google Webmaster Tools. For instructions, please see:
https://cloud.google.com/storage/docs/object-change-notification#_Authorization
AccessDeniedException: 403 Forbidden
I have followed all the steps from the url below for Notification Authorization:
https://cloud.google.com/storage/docs/object-change-notification
But I am still getting the above error. What step am I missing ?
Thanks
I have fixed the issue myself. I had missed "https://" while adding the domain name.
Thanks

Wechat : Sandbox API config Failed

Hi please support to troubleshoot the below error in Wechat Sandbox API Config:
I am integrating Wechat API in PHP application. I have created a test account in Wechat Sandbox API. But when configuring the API with URL and token its shows "Unable to configure".
When checking the ajax response it throws : {"errcode":-106,"errmsg":"token check fail"}
Thank you.
I got the "Unable to configure" message when testing the Getting Started wiki sample too. Trying to reach wx_sample.php returned a 500 Internal Server Error.
It was fixed after changing the owners for my directory and file, after that the token could be set in the sandbox - 'API Config'.

Failed Amazon SQS request

I am setting up SQS using Amazon's SDK 2 for PHP.
There appears to be very little existing content on the web using the new SDK.
This is the newest Amazon Services SDK built on top of Guzzle.
I am able to successfully:
Create queue
Get queue URL
List all queues
Get a queue ARN
But I cannot get any queue attributes or send a message to a queue.
My call to get the queue attributes is:
$attr = $sqs->getQueueAttributes(
array(
'QueueUrl' => 'test_18_16-36-57'
)
);
When attempting to the the queue attributes I get the following response:
The request signature we calculated does not match the signature you
provided. Check your AWS Secret Access Key and signing method. Consult
the service documentation for details.
The Canonical String for this request should have been 'POST
/100404228159/test_18_16-36-57
content-type:application/x-www-form-urlencoded
host:sqs.us-east-1.amazonaws.com user-agent:aws-sdk-php2/2.1.0
Guzzle/3.1.2 curl/7.22.0 PHP/5.3.10-1ubuntu3.5
x-amz-date:20130218T213657Z
content-type;host;user-agent;x-amz-date
a70e8dd76245fc6631c1b051623a90752c7cec0cd55fa636000c47ad3d8e4e06'
The String-to-Sign should have been 'AWS4-HMAC-SHA256 20130218T213657Z
20130218/us-east-1/sqs/aws4_request
7695e40b612379da5025fca80e26ed6c29f95428e244d2b083764d203d369e36'
Any ideas?
Does upgrading to the latest version fix the issue?

Categories