Stripe payments 从条带中检索要存储在数据库中的客户Id

Stripe payments 从条带中检索要存储在数据库中的客户Id,stripe-payments,Stripe Payments,我正在使用Stripe作为我设计的网站的支付网关。我已经能够创建并向客户收费,但是,我还希望将客户ID存储在我的数据库中。如何检索客户id?以下是我的代码片段: 这是我收到的错误消息: Notice: Undefined variable: charge Fatal error: Uncaught exception 'Stripe\Error\InvalidRequest' with message 'Could not determine which URL to request: S

我正在使用Stripe作为我设计的网站的支付网关。我已经能够创建并向客户收费,但是,我还希望将客户ID存储在我的数据库中。如何检索客户id?以下是我的代码片段:

这是我收到的错误消息:

Notice: Undefined variable: charge 

Fatal error: Uncaught exception 'Stripe\Error\InvalidRequest' with message 'Could not determine which URL to request: Stripe\Charge instance has invalid ID: ' in ....
 1. enter code here

将customer对象分配给
$customer
变量后,可以通过
$customer->ID
访问其ID。这是您在费用创建请求中传递客户ID所做的操作


您也应该这样做,以便将ID保存到数据库中。

您是如何解决此问题的?我需要一点帮助
Notice: Undefined variable: charge 

Fatal error: Uncaught exception 'Stripe\Error\InvalidRequest' with message 'Could not determine which URL to request: Stripe\Charge instance has invalid ID: ' in ....
 1. enter code here