我正在我的网站上测试 Stripe,但无法通过下面看到的“尝试”。基本上,我从来没有在“尝试”之后看到“测试”。
我在这里做错了吗?
try {
$charge = Stripe_Charge::create(array(
"amount" => 50, // amount in cents, again
"currency" => "usd",
"customer" => $customer->id,
"card" => $token,
"description" => $email));
echo "TEST1";
} catch (Stripe_CardError $e) {
// Since it's a decline, Stripe_CardError will be caught
$body = $e->getJsonBody();
$err = $body['error'];
echo 'Status is:' . $e->getHttpStatus() . "\n";
echo 'Type is:' . $err['type'] . "\n";
echo 'Code is:' . $err['code'] . "\n";
// param is '' in this case
echo 'Param is:' . $err['param'] . "\n";
echo 'Message is:' . $err['message'] . "\n";
}
echo "TEST";
谢谢!