0
我已經爲我的(沙盒)檢出以下代碼: (我已經略去了最初的變量聲明)布倫特裏DropInUI網關拒絕卡驗證沒有失敗(PHP)
require_once("braintree/braintree_init.php");
$nonceFromTheClient = 'fake-gateway-rejected-fraud-nonce';
$result = Braintree_Customer::create([
'id' => $userId,
'firstName' => $firstName,
'lastName' => $lastName,
'email' => $email,
'paymentMethodNonce' => $nonceFromTheClient,
'creditCard' => [
'billingAddress' => [
'streetAddress' => $billingAddress,
'locality' => $billingCity,
'region' => $billingState,
'postalCode' => $billingZip
]
]
]);
if ($result->success) {
echo "create: success";
$token = $result->customer->paymentMethods[0]->token;
} else {
echo "create: fail";
foreach($result->errors->deepAll() AS $error) {
echo($error->code . ": " . $error->message . "\n");
}
$verification = $result->creditCardVerification;
echo $verification->status;
echo $verification->processorResponseCode;
echo $verification->processorResponseText;
echo $verification->gatewayRejectionReason;
$verificationError = "There was a problem processing your credit card; please double check your payment information and try again.";
return false;
}
$result = Braintree_Subscription::create([
'paymentMethodToken' => $token,
'planId' => $subId
]);
if ($result->success) {
$subscriptionId = $result->subscription->id;
header("Location: transaction.php?i=".$subscriptionId."");
} else {
foreach($result->errors->deepAll() AS $error) {
echo($error->code . ": " . $error->message . "\n");
}
}
我試圖讓卡驗證失敗。我爲控制面板中的所有卡啓用了驗證。當我使用提供的$ nonceFromTheClient ='假門戶拒絕欺詐隨機數'時,客戶創建仍然成功。
如果我使用卡號4000111111111115從不成功的信用卡驗證列表,它仍然是成功的,雖然承認我不清楚卡號應使用什麼隨機數。
如果我使用'假處理器拒絕 - 簽證 - 隨機'它失敗(如預期)。
所以我不確定爲什麼卡驗證在前兩次嘗試中仍然成功?