#mahraamir

1 messages · Page 1 of 1 (latest)

final quiverBOT
midnight knoll
robust cosmos
#

I am not sure if there any request generating to stripe but let me check

midnight knoll
#

Then how are you sure there's a 5xx returned?

robust cosmos
#

it seems to me that there is something missing in the sdk for financeial connection

midnight knoll
#

I need more details on the API request you're actually trying to make

robust cosmos
#

public function get_fc_balance($request)
{
try {
$this->util->log_exception(json_encode($request),'get_fca_balance');

            $stripe = new \Stripe\StripeClient($this->dc_sec_key);

            $response = $stripe->financialConnections->sessions->create([
                'account_holder' => [
                    'type' => 'customer',
                    'customer' => $request['stp_customerid'],
                ],
                'permissions' => ['balances'],
                'prefetch' => ['balances'],
            ]);
            $this->util->log_exception($response,'get_fca_balance_resp');
            return $response;

        } catch (Exception $exception){
            $this->util->log_exception($exception->getMessage(),'get_fca_balance_err');
            return false;
        }
    }
#

first statement is for logging the data

#

it is logging the request

midnight knoll
#

Ok, so there should be a req_xxx ID. Can you share that please

robust cosmos
#

nothing is hitting fo rfinancial connection in the logs

midnight knoll
#

Then:

  • You're looking at the logs of the wrong account.
  • The 500 error is thrown else where in your code.
#

You need to catch the exception/error and share it here

robust cosmos
#

I have doubt the sdk I have may be not have methods for financial connection?

midnight knoll
#

Depends what version you're using

robust cosmos
#

I am already handling the errors but it's throwing 500

#

how can I check version?

midnight knoll
#

via Composer I guess

robust cosmos
#

{
"name": "stripe/stripe-php",
"description": "Stripe PHP Library",
"keywords": [
"stripe",
"payment processing",
"api"
],
"homepage": "https://stripe.com/",
"license": "MIT",
"authors": [
{
"name": "Stripe and contributors",
"homepage": "https://github.com/stripe/stripe-php/contributors"
}
],
"require": {
"php": ">=5.6.0",
"ext-curl": "",
"ext-json": "
",
"ext-mbstring": "*"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"php-coveralls/php-coveralls": "^2.1",
"squizlabs/php_codesniffer": "^3.3",
"symfony/process": "~3.4",
"friendsofphp/php-cs-fixer": "2.17.1"
},
"autoload": {
"psr-4": {
"Stripe\": "lib/"
}
},
"autoload-dev": {
"psr-4": {
"Stripe\": [
"tests/",
"tests/Stripe/"
]
}
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
}
}

#

cat VERSION

7.69.0

midnight knoll
#

That tells me nothing. Try:

composer show "stripe/stripe-php" --all
midnight knoll
robust cosmos
#

will that affect old integration?

midnight knoll
#

Shouldn't do as you're not doing a major upgrade so shouldn't any breaking changes

robust cosmos
#

I didn't get you

#

should I upgrade or not?

midnight knoll
#

Yes. You asked me if it will break your integration

#

And I said it shouldn't no

robust cosmos
#

ok let me try

robust cosmos
#

$response = $stripe->financialConnections->sessions->create([
'account_holder' => [
'type' => 'customer',
'customer' => $request['stp_customerid'],
],
'permissions' => ['balances'],
'prefetch' => ['balances'],
]);

#

this code is generating exception

midnight knoll
#

Ok, but what's the actual error message?

#

Did you update to the required version?

robust cosmos
#

Yes, I updated but getting same 500 error when access this method, I am using ARC to test the API

midnight knoll
#

I don't know what that is

#

But you need to share the actual error in the exception

#

Is there an API request in your logs now?

#

If not then Stripe isn't returning a 500 error and there's an error being thrown elsewhere in your code

robust cosmos
#

req_jQdccnIjeT0GHB

#

is this related to financial connection?

midnight knoll
#

Nope, plus that request didn't error

#

Everything indicates that this is not an error thrown by the Stripe API but something else in your code. You need to debug that

robust cosmos
#

system is returning 500 when it is calling

#

$stripe->financialConnections->sessions->create([