目前正在使用大脑树与支付网关合作。当我像上面一样点击贝宝假随机数“fake-paypal-one-time-nonce”时,会收到一条错误消息处理器网络不可用 - 再试一次,但 Braintree 随机数正在工作。我将我的贝宝与大脑树集成我使用以下 java 代码来点击
谢谢。
TransactionRequest request = new TransactionRequest();
CustomerRequest customerRequest = request.customer();
customerRequest.email(nonceDetails.getString("email"))
.firstName(nonceDetails.getString("name"))
.phone(nonceDetails.getString("mobileNumber"));
request.amount(new BigDecimal(nonceDetails.getFloat("amount")))
.paymentMethodNonce(nonceDetails.getString("nonce"))//<-- Here I put my nonce
.options()
.submitForSettlement(true)
.paypal()
.done();
try {
Result<Transaction> result = bt.transaction().sale(request);
if (result.isSuccess()) {
Transaction transaction = result.getTarget();
future.complete(transaction);
} else if (result.getTransaction() != null) {
Transaction transaction = result.getTransaction();
logger.error("Error in BrainTreeGateWay::paymentConfirmationWithNonce - " + transaction.toString());
future.fail(result.getErrors().toString());
} else {
for (ValidationError error : result.getErrors().getAllDeepValidationErrors()) {
logger.error("Error in BrainTreeGateWay::paymentConfirmationWithNonce - " + error.getMessage());
}
future.fail(result.getErrors().toString());
}