我是使用点燃/拉拉-万能套餐的万能在拉拉。我正在尝试使用条带来实现令牌计费,如这里所示,https://github.com/thephpleague/omnipay#token-billing。客户正在创建成功的条纹,但我无法支付与返回的客户身份。
这是我的密码
$token = Input::get('stripetoken');
$gateway = Omnipay::create('Stripe');
$gateway->setApiKey('My Key');
$gateway->setTestMode(true);
$cardresponse = $gateway->createCard(array('token' =>$token))->send();
if ($cardresponse->isSuccessful()) {
$card_id = $cardresponse->getCardReference();
$data = $cardresponse->getData();
$customerid = $data['id'];
$cardid = $data['default_source'];
}
$paymentresponse = $gateway->purchase(array('amount' => '10.00','currency' => 'USD', 'cardReference' => $card_id))->send();
echo $paymentresponse->getMessage();我得到了后续的回应。
No such token: cus_8FwPaLNKdWcfRW当我检查我的条纹仪表板时,使用这个id的客户就会存在,并分配了一张卡片。谢谢你的帮助。
发布于 2016-04-12 12:41:01
由于您正在创建一个customer对象,所以需要更新您的费用产生请求,以在customer参数中传递客户ID,而不是在source参数中传递客户ID(这将导致您正在看到的错误)。
我对Omnipay并不熟悉,但我认为这应该是可行的:
$paymentresponse = $gateway->purchase(array('amount' => '10.00','currency' => 'USD', 'customerReference' => $card_id))->send();https://stackoverflow.com/questions/36573231
复制相似问题