[英]how to validate credit card details without doing transaction in braintree payment gateway?
我想在一个阶段中验证信用卡详细信息,并注册我们的网站用户,然后使用同一张信用卡进行交易。 是否可以在不使用braintree付款网关进行交易的情况下验证信用卡详细信息?
全面披露:我为Braintree工作。
是的,可以在付款之前验证信用卡。 首先,请确保在控制面板中设置了您的帐户以进行卡验证 。 对于您所描述的流程,您可以将verifyCard
标志设置为true
来创建一个客户:
$result = Braintree_Customer::create([
'firstName' => 'Your',
'lastName' => 'Customer',
'email' => 'customer@example.com',
'creditCard' => [
'options' => [
'verifyCard' => 'true'
],
],
'paymentMethodNonce' => 'the-nonce',
]);
如果成功创建了客户,则可以检查结果以查看CreditCardVerification对象 。
$verification = $result->customer->creditCards[0]->verification
然后,您可以从创建的客户处提取付款方式令牌并使用它来创建交易。
$token = $result->customer->creditCards[0]->token
如果您对集成有其他疑问,请联系Braintree支持 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.