在WHMC中禁用PayPal Black借记卡或信用卡按钮

发布于 2025-01-22 09:37:38 字数 183 浏览 4 评论 0原文

我需要在WHCMS中禁用PayPal的借记卡或信用卡按钮。我已经使用Stripe作为信用卡选项,因此使我的客户感到困惑。谁能为此建议解决方案? ScreenShot

I need to disable the Debit or Credit Card button from PayPal in WHCMS. I have used Stripe for credit card option, so it confuses my customers. Can anyone suggest the solution for this?
screenshot

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

ゝ偶尔ゞ 2025-01-29 09:37:38

要禁用黑色借记卡或信用卡按钮,请添加& disable-gunding = card src< script>加载加载该结帐页面上的PayPal JS SDK。

因此,例如:

<script src="https://www.paypal.com/sdk/js?client-id=test¤cy=USD&disable-funding=card"></script>

您可以在演示中对此进行测试: https:// https:// developer.paypal.com/demo/checkout/#/pattern/server

To disable the black Debit or Credit Card button, add &disable-funding=card to the src of the <script> that loads the PayPal JS SDK on that checkout page.

So, for example:

<script src="https://www.paypal.com/sdk/js?client-id=test¤cy=USD&disable-funding=card"></script>

You can test this in the demo at: https://developer.paypal.com/demo/checkout/#/pattern/server

清风不识月 2025-01-29 09:37:38

添加disable-gunding =信用,卡到脚本的SRC。

例子:

<script src="https://www.paypal.com/sdk/js?client-id=test&components=buttons,marks&disable-funding=credit,card"></script>

Add disable-funding=credit,card to the src of the script.

example:

<script src="https://www.paypal.com/sdk/js?client-id=test&components=buttons,marks&disable-funding=credit,card"></script>
孤独难免 2025-01-29 09:37:38

我创建了一个挂钩,该挂钩删除了购物车上的.express-checkout buttons元素。它不是理想的,还删除了“默认”贝宝结帐按钮。 To implement the same solution create a file called DisableExpressCheckout.php in whmcs\includes\hooks and put the following content in it:

<?php

add_hook('ShoppingCartViewCartOutput', 1, function() {
    $HTML = "<script> 
        window.addEventListener('load', function () {
            const elements = document.getElementsByClassName('express-checkout-buttons');
            if (elements) {
                elements[0].remove();
            }
        });
    </script>";
    return $HTML;
});

The above script will create a script element on the卡车页面将等待整个页面加载,然后从DOM上删除Express Checkout按钮。这样做,即使使用CSS将按钮放开按钮,用户也无法使用它们。

您也可以在模板中添加自定义CSS类,以隐藏元素在JavaScript删除之前。您可以通过将以下CSS放置在模板自定义CSS文件中来做到这一点。否则,您可以在上面的钩子中添加样式标签。

.express-checkout-buttons {
    display: none!important;
}

I created a hook that removes the .express-checkout-buttons element on the Cart. It is not ideal and also removes the "default" PayPal checkout button. To implement the same solution create a file called DisableExpressCheckout.php in whmcs\includes\hooks and put the following content in it:

<?php

add_hook('ShoppingCartViewCartOutput', 1, function() {
    $HTML = "<script> 
        window.addEventListener('load', function () {
            const elements = document.getElementsByClassName('express-checkout-buttons');
            if (elements) {
                elements[0].remove();
            }
        });
    </script>";
    return $HTML;
});

The above script will create a script element on the cart page that will wait for the entire page to load and then remove the express checkout buttons from the DOM. In doing so users won't be able to use them at all, even if they unhide the button using CSS.

You might also add a custom CSS class to your template to hide the element before it gets removed by the javascript. You could do that by placing the following CSS in your template custom CSS file. Otherwise you can add an style tag in the hook above.

.express-checkout-buttons {
    display: none!important;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文