#ashish846955
1 messages · Page 1 of 1 (latest)
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_5Da9aBj5BopvPa
Only live keys can access this method.
As the error message suggests, you need to use live key
can you tell me what you want to achieve with Stripe API/products?
I want to add another strip account in main strip account in my plugin the plugin can be in multiple site so i need to add url dynamically
What you mean by adding another Stripe account to the main Stripe account?
I see, so you want to connect another Stripe account through OAuth
Yes
Then you can just edit the redirct_url through Dashboard.
Here I have to add url using php code
But it gives me an error that Only live keys can access this method.
There's a button called "Add URL", you can click on it to add an URL
Yes, but I don't want to do it since then, I want to do it using php code
Why?
Because I want to be a plugin, it should be dynamic so that the user will not be able to manually add it to the plugin.
OK. maybe you want to create a new Standard connected account in test mode, so that you can use your platform's test mode key to create API requests on it.
Yes
By using live key I can add but by using test key I can't
<?php
require_once('Stripe/stripe-php/init.php');
try{
\Stripe\Stripe::setApiKey("secrete_key");
$clientId = "account_id";
$redirectUri = "https://project-management.webcase.me/";
$response = \Stripe\Account::update(
$clientId,
[
'settings' => [
'dashboard' => 'custom',
'dashboard_settings' => [
'redirect_url' => $redirectUri
]
]
]
);
print_r($response);
}catch( Exception $e ){
echo "<pre>";
print_r($e);
echo "</pre>";
}
?>
This code is not working for test credentials
using live credetials it's workng fine!
@slim belfry There?
Hello
Stripe\Exception\InvalidRequestException Object
(
[message:protected] => Only live keys can access this method.
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => C:\xampp\htdocs\str\Stripe\stripe-php\lib\Exception\ApiErrorException.php
[line:protected] => 38
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => C:\xampp\htdocs\str\Stripe\stripe-php\lib\Exception\InvalidRequestException.php
[line] => 35
[function] => factory
[class] => Stripe\Exception\ApiErrorException
[type] => ::
[args] => Array
(
[0] => Only live keys can access this method.
[1] => 400
[2] => {
"error": {
"message": "Only live keys can access this method.",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_5Da9aBj5BopvPa?t=1689656302",
"type": "invalid_request_error"
}
}
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
above code provide me some error
Is this a new stripe account that you create and connect with your platform in test mode?
Yes
I've checked and this account is connected to WooCommerce Inc. I don't think that's your platform account.
have you understand my question?This is not the answer to the question I am asking you
My query is that I want to set redirect URL using PHP code to but using the test key in it but I can't.
I believe I've already explained to you and I suggest you to create and connected a standard connected account with your platform in test mode, so that you can use the platform's test mode API key to set redirect URL on the newly created standard account.
But it seems like you don't take my advices.
I need to add the redirect url using above php code but this is only allow to live credentilas use
i need to use test crednetials
It's the same question so I'd suggest you to refer to the my previous answers in this chat
No I don't want to do that
You are not understanding my question
Please add to other developer in this chat
This is very important thing for me
If you prefer to talk to someone else, pleaes reach out to support https://support.stripe.com/contact/email
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I have created a new stripe account in which I want to set redirect url using php code and using leave credentials it allows me to add but from test credentials if I go to add redirect url it gives me an error