我正在尝试实现此处提到的内容,但出现错误:
Array ([type] => invalid_request_error [message] => No such customer: 92 [param] => customer)
我正在使用 Laravel 收银员:
$user = User::find($current_user_id);
if ($user->charge(100, [
'customer' => 92,
'source' => $token,
'description' => "Testing Payment Deduction for Brief"
])
) {
print "Awesome";
} else {
print "it failed";
}
使用此代码创建客户失败,因为它尝试在users
表中创建不需要的记录,因为我已经创建了一个用户:
$customer = $user->create(array(
'email' => 'customer@example.com',
'card' => $token
));
如何将我现有的客户 ID 和电子邮件发送到 Stripe?