我不确定为什么我会收到这个错误。我在提交作业时创建一个令牌,并将其发送到关联客户的数据库。在作业完成后,我使用数据库中的令牌来完成交易。下面是我的事务处理代码。
if(isset($_GET["job"])){
$status = $_GET["status"];
if($_GET["status"] == 1){
$jobq = 'SELECT * from jobsubmission WHERE ID='.$_GET["job"];
$jobres = mysqli_query($conn, $jobq);
$data = mysqli_fetch_object($jobres);
$token = $data->stripetoken;
$bookdetail = 'SELECT driver from booking WHERE job='.$_GET["job"];
$res = mysqli_query($conn, $bookdetail);
$data1 = mysqli_fetch_object($res);
$driver = $data1->driver;
$driverdetail = 'SELECT stripe_account from driverinformation WHERE ID='.$driver;
$res = mysqli_query($conn, $driverdetail);
$data2 = mysqli_fetch_object($res);
$accountid = $data2->stripe_account;
$amount = $data->jobpay*100;
require_once('Stripe/lib/Stripe.php');
Stripe::setApiKey($key);
$charge = Stripe_Charge::create(array(
"amount" => $amount,
"currency" => "usd",
"card" => $token,
"description" => "Charge for the booked job in Swift job"
), array('stripe_account' => $accountid));
if($charge->status == "succeeded"){
$transid = $charge->id;
$jobid = $_POST["job"];
$conn = dbconnection();
$updqry = 'UPDATE booking set paid=1, paiddate='.time().', transactionid="'.$transid.'" WHERE job='.$jobid;
$update = mysqli_query($conn, $updqry);发布于 2016-02-16 15:08:03
条带费用ID用于立即捕获费用(从创建之日起最多5分钟)。如果您想稍后捕获费用,则应将费用ID附加到一个Customer对象(即shown here)。
https://stackoverflow.com/questions/35423242
复制相似问题