2017-03-04 52 views
0

我正在使用Braintree作爲我的iOS應用程序的支付網關。
我創建了一個Node.js服務器來處理付款。
我想使用用戶管理系統中使用的用戶標識的客戶ID創建客戶。Braintree:使用沙箱模式在CVV驗證中創建或更新客戶時的授權錯誤

BraintreeGateway.customer.update(req.uid, { 
    paymentMethodNonce, 
    verifyCard: process.env.NODE_ENV === 'production' 
}, (err, result) => { 
    if (err) { 
    next(err); 
    } else { 
    if (result.success) { 
     req.customer = result.customer 
     console.info('Payment Method:', result.customer.paymentMethods[0]) 
     res.send({ 
     status: HttpStatus.OK, 
     message: 'Successfully updated!' 
     }) 
    } else { 
     next({ 
     error: 'Failed to update a payment method!', 
     result 
     }) 
    } 
    } 
}) 

這裏req.uid是用戶的唯一標識符。
在Braintree控制面板中未啓用CVV驗證設置的情況下運行良好。 Here
但啓用CVV驗證設置後,我得到authorizationError: Authorization Error這意味着無效的API密鑰。 Here
我使用DropIn UI來輸入信用卡並將paymentMethodNonce正確地傳遞到服務器。
當前測試的信用卡號碼是:4242 4242 4242 4242 Exp:12/2019 CVV:123

這裏有什麼錯誤?它會在生產模式下工作嗎? (Braintree會接受生產模式下的有效信用卡號碼?)

回答

相關問題