#ashish846955

1 messages · Page 1 of 1 (latest)

smoky gobletBOT
cloud bolt
#

hello! how can I help?

signal agate
#

require_once('stripe-php-sdk/init.php');
use Stripe\Stripe;
use Stripe\AccountLink;

Stripe::setApiKey('Secret Key');

/* Create an Account Link */
$accountLink = AccountLink::create([
'account' => 'acct_1NIpF5Kt1T925T2i',
'type' => 'account_onboarding',
'refresh_url' => 'https://dashboard.stripe.com/',
'return_url' => 'https://dashboard.stripe.com/',
]);
echo 'Copy this link and connect your account: ' . $accountLink->url . '<br>';

#

I have write the code on core php

#

this code is working fine for me

cloud bolt
#

please redact the secret key. This is a public channel.

signal agate
#

Okay

#

I have try to convert the wordpress code

#

require_once(PLUGIN_DIR_FUNDRAISER_PATH.'/Stripe/stripe-php/init.php');
try{
\Stripe\Stripe::setApiKey('Secret Key');

    /* Create an Account Link */
    $accountLink = \Stripe\AccountLink::create([
        'account' => 'acct_1NIpF5Kt1T925T2i',
        'type' => 'account_onboarding',
        'refresh_url' => 'https://dashboard.stripe.com/',
        'return_url' => 'https://dashboard.stripe.com/',
    ]);
    $account_link_url = $accountLink->url;

    echo  'Copy this link and connect your account: ' . $account_link_url;
}catch( Exception $e ){
    echo "<pre>";
    print_r($e);
    echo "</pre>";
}

Here is my wordpress code

#

tripe\Exception\InvalidRequestException Object
(
[stripeParam:protected] =>
[error:protected] => Stripe\ErrorObject Object
(
[charge] =>
[code] =>
[decline_code] =>
[doc_url] =>
[message] => You requested an account link for an account that is not connected to your platform or does not exist.
[param] =>
[payment_intent] =>
[payment_method] =>
[setup_intent] =>
[source] =>
[type] => invalid_request_error
[request_log_url] => https://dashboard.stripe.com/test/logs/req_pwb3FsgGw0ogPe?t=1686807114
)

[httpBody:protected] => {

"error": {
"message": "You requested an account link for an account that is not connected to your platform or does not exist.",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_pwb3FsgGw0ogPe?t=1686807114",
"type": "invalid_request_error"
}
}

#

showing this error

#

how can i resolve it!

#

because core php code is working fine

cloud bolt
#

how did you create the account : acct_1NIpF5Kt1T925T2i?

signal agate
#

This id getting for backend

cloud bolt
signal agate
#

This link creating the new account

#

but i need exsting account connect

cloud bolt
#

Account Links is not meant to be used for connecting an existing account.

signal agate
#

If so, I want to connect the existing account, how can I do it?

#

Yes i have checked but this is not working

#

properly

#

could you please provide me php code only

#

so i will try

#

because i have lots of try

cloud bolt
#

what specifically doesn't work? The page already shows an example of an OAuth link.

signal agate
#

Yes but my user only enter stripe secret key

#

here is client id using

#

how can i get client id using secret key

cloud bolt
signal agate
#

Yes but how can i get using api?

cloud bolt
#

The client id is only listed on your Dashboard. There's no Stripe API to retrieve the client id of your account if that's what you're asking.

signal agate
#

OK

signal agate
#

Hey

#

why my account is inreview?