我目前正在为我的网站编写一些集成测试,我注意到我一直在创建帐户而没有删除它们。
我刚刚用
try {
info('deauthing: ' .$accountID);
OAuth::deauthorize([
'stripe_user_id' => $accountID,
]);
} catch (\Stripe\Error\OAuth\OAuthBase $e) {
exit("Error: " . $e->getMessage());
}
当我尝试为测试帐户重用电子邮件地址时,它告诉我该帐户已经存在。但是我在仪表板的任何地方都看不到它。
我试图在测试运行结束时删除该帐户,但出现此错误
Stripe\Error\Permission : This application is not authorized to delete this account.
我正在使用的代码是这个
public function deleteAccount($accountID)
{
$account = \Stripe\Account::retrieve($accountID);
$account->delete();
}
我错过了什么?