简体   繁体   English

Braintree 的 PayPal 付款中未显示金额

[英]Amount not showing in PayPal payment in Braintree

Hi the amount does not display in paypal when making payment.您好,付款时金额不显示在 paypal 中。 The JavaScript code is shown below: JavaScript 代码如下所示:

  var form = document.querySelector('#payment-form');
  var client_token = '{{ client_token }}';

  braintree.dropin.create({
    authorization: client_token,
    container: '#bt-dropin',
    card: {
    cardholderName: {
      required: true
    }
    },
    applePay: {
    displayName: 'Merchant Name',
    paymentRequest: {
    label: 'Localized Name',
    total: '10.00'
    }
    },
    paypal: {
    flow: 'checkout',
    amount: '10.00',
    currency: 'USD'
    },
    paypalCredit: {
    flow: 'checkout',
    amount: '10.00',
    currency: 'USD'
    },
    venmo: true

  }, function (createErr, instance) {
        if (createErr) {
        // Handle any errors that might've occurred when creating Drop-in
        console.error(err);
        return;
        }

    form.addEventListener('submit', function (event) {
      event.preventDefault();

      instance.requestPaymentMethod(function (err, payload) {
        if (err) {
          console.log('Error', err);
          return;
        }
        // Add the nonce to the form and submit
        document.querySelector('#nonce').value = payload.nonce;
        form.submit();
      });
    });
  });

在此处输入图像描述

From the code, the amount is $10, but does not display in the PayPal payment page.从代码来看,金额为 10 美元,但未显示在 PayPal 付款页面中。 Please what am i doing wrong?请问我做错了什么?

Unless you pass line item information, an amount will not show during the PayPal checkout approval process.除非您传递行项目信息,否则在 PayPal 结帐批准过程中不会显示金额。

very simple.很简单。 I included the following to paypal option in the code:我在代码中包含以下 paypal 选项:

commit: true,承诺:真实,

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

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