【发布时间】:2021-12-31 15:20:33
【问题描述】:
我一直在将 Stripe 集成到我的平台中,并且一切正常。我可以创建关联帐户、客户、产品、价格创建和更新订阅,一切正常。我需要做的最后一件事是让客户能够删除他们的帐户。这是我的代码:
public function remove_member() //DELETES MEMBER ACCOUNT
{
$this->api_error = '';
$this->CI =& get_instance();
$this->CI->load->config('stripe');
require APPPATH .'third_party/stripe-php/init.php'; // Include the Stripe PHP bindings library
\Stripe\Stripe::setApiKey($this->CI->config->item('stripe_api_key')); // Set API key
$customer = \Stripe\Customer::delete(
'stripeCustomerID',
[]);
}
但是它会抛出此错误:“您必须将数组作为第一个参数传递给 Stripe API 方法调用。”
但我相信我正在关注 Stripe Docs...这里:https://stripe.com/docs/api/customers/delete?lang=php
有什么建议吗?
【问题讨论】:
-
你使用的是哪个版本的stripe-php?
-
嗨亚历克斯 - 7.32.0
标签: php stripe-payments codeigniter-3