#ashish846955

1 messages · Page 1 of 1 (latest)

oak canyonBOT
slim belfry
tawdry crag
#

req_5Da9aBj5BopvPa

slim belfry
#

Only live keys can access this method.
As the error message suggests, you need to use live key

tawdry crag
#

Yes but i need test first

#

how can i use test access

slim belfry
#

can you tell me what you want to achieve with Stripe API/products?

tawdry crag
#

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

slim belfry
#

What you mean by adding another Stripe account to the main Stripe account?

tawdry crag
#

this functionality

slim belfry
#

I see, so you want to connect another Stripe account through OAuth

tawdry crag
#

Yes

slim belfry
#

Then you can just edit the redirct_url through Dashboard.

tawdry crag
#

Here I have to add url using php code

#

But it gives me an error that Only live keys can access this method.

slim belfry
#

There's a button called "Add URL", you can click on it to add an URL

tawdry crag
#

Yes, but I don't want to do it since then, I want to do it using php code

slim belfry
#

Why?

tawdry crag
#

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.

slim belfry
#

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.

tawdry crag
#

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!

tawdry crag
#

@slim belfry There?

slim belfry
#

Discord is busy

#

is there a problem that you need me to take a look?

oak canyonBOT
tawdry crag
#

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"
}
}

#

above code provide me some error

slim belfry
#

Is this a new stripe account that you create and connect with your platform in test mode?

tawdry crag
#

Yes

slim belfry
#

I've checked and this account is connected to WooCommerce Inc. I don't think that's your platform account.

tawdry crag
#

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.

slim belfry
#

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.

tawdry crag
#

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

slim belfry
#

It's the same question so I'd suggest you to refer to the my previous answers in this chat

tawdry crag
#

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

slim belfry
#

If you prefer to talk to someone else, pleaes reach out to support https://support.stripe.com/contact/email

tawdry crag
#

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