代码之家  ›  专栏  ›  技术社区  ›  bbusdriver

使用checkout隐藏PayPal按钮。js

  •  0
  • bbusdriver  · 技术社区  · 7 年前

    我在用 PayPal's checkout.js 在视图中,我展示了PayPal按钮和信用卡的小按钮。但如果我只想显示信用卡按钮和隐藏贝宝按钮,我该如何实现这一点?

    html:

      <div id="paypal-button" class="m-t-20"></div>
    

    js:

    paypal.Button.render({
        env: '@Model.Env',
        locale: '@Model.CurrentCulture',
        style: {
            size: 'medium',
            height: 48,
            color: 'silver',
            shape: 'rect',
            label: 'checkout',
            tagline: 'true',
            fundingicons: 'true',
            layout: 'horizontal'
        },       
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   Amessihel    7 年前

    如果禁用资金来源,按钮将不会显示。看到贝宝了吗 page .

    我希望您想要的代码如下所示:

    <script src="https://paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&disable-funding=credit">
    </script>