I'm trying to redirect if connected account doesn't have the right credentials for transfers. The results according to documentation is boolean.

require_once 'subscription/stripe-php/init.php';
\Stripe::setApiKey($STRIPE_API_KEY);
$account = \Stripe\Account::retrieve($STRIPE_DEST);
if ($account->transfers_enabled == FALSE){
header('Location: http://www.site.com');
}

https://stripe.com/docs/api/accounts/retrieve

    That's good to hear. One niggle I can see (as described on the header manual page is that you should exit after sending a Location header, or your script will continue to run.

      Write a Reply...