简体   繁体   English

带有dropin的Braintree Paypal结帐流程失败

[英]Braintree Paypal checkout flow with dropin fails

I'm trying to use the paypal checkout flow with the braintree dropin. 我正在尝试将Brainpal Dropin与PayPal结帐流程配合使用。 The vault flow works without issues but I'd prefer to use the checkout flow. 保管库流程工作正常,但我更喜欢使用结帐流程。

The client code: 客户端代码:

braintree.dropin.create({
  paymentOptionPriority: paymentOptionPriority,
  authorization: client_token,
  container: '#bt-dropin',
  paypal: {
    flow: 'checkout',
    amount: 300.00,
    currency: 'EUR'
  }
}, function (createErr, instance) {
  form.addEventListener('submit', function (event) {
  event.preventDefault();
  instance.requestPaymentMethod(function (err, payload) {
    if (err) {
      console.log('Error', err);
      return;
    }

    document.querySelector('#nonce').value = payload.nonce;
      form.submit();
    });
  });
});

After pressing the Paypal checkout button the user gets directed to Paypal and the result is successful. 按下Paypal结帐按钮后,用户将被定向到Paypal,并且结果成功。 The paypal payment method gets a green check mark in the dropin. 贝宝(PayPal)付款方式在下拉菜单中显示一个绿色的复选标记。 When I then submit the form and the server sends the transaction request to braintree I get the following result: 然后,当我提交表单并且服务器将交易请求发送到braintree时,我得到以下结果:

Transaction.Status.FAILED
ProcessorResponseCode: 3000
ProcessorResponseText: Processor Network Unavailable - Try Again

It was actually a silly mistake. 这实际上是一个愚蠢的错误。 My hard coded test value in the client code was not matching up with the amount on the server side so Paypal was authorizing a different amount than was sent to the Braintree Gateway. 我在客户端代码中使用硬编码的测试值与服务器端的amount不匹配,因此Paypal授权的金额与发送到Braintree网关的金额不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM