[英]how to validate credit card details without doing transaction in braintree payment gateway?
I want to validate credit card details in one stage and register our website user and then do transaction with same credit card. 我想在一个阶段中验证信用卡详细信息,并注册我们的网站用户,然后使用同一张信用卡进行交易。 Is there any way to validation credit card details without doing transaction in braintree payment gateway? 是否可以在不使用braintree付款网关进行交易的情况下验证信用卡详细信息?
Full disclosure: I work for Braintree. 全面披露:我为Braintree工作。
Yes, it's possible to verify a credit card before charging it. 是的,可以在付款之前验证信用卡。 First, make sure your account is set up for card verification in the control panel . 首先,请确保在控制面板中设置了您的帐户以进行卡验证 。 For the flow you are describing, you can create a customer with the verifyCard
flag set to true
: 对于您所描述的流程,您可以将verifyCard
标志设置为true
来创建一个客户:
$result = Braintree_Customer::create([
'firstName' => 'Your',
'lastName' => 'Customer',
'email' => 'customer@example.com',
'creditCard' => [
'options' => [
'verifyCard' => 'true'
],
],
'paymentMethodNonce' => 'the-nonce',
]);
If the customer is created successfully, you can inspect the result for a CreditCardVerification object . 如果成功创建了客户,则可以检查结果以查看CreditCardVerification对象 。
$verification = $result->customer->creditCards[0]->verification
You can then pull the payment method token off the created customer and use it to create a transaction. 然后,您可以从创建的客户处提取付款方式令牌并使用它来创建交易。
$token = $result->customer->creditCards[0]->token
If you have additional questions about your integration, please reach out to Braintree support . 如果您对集成有其他疑问,请联系Braintree支持 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.