如何禁用 Razorpay react-native 中的“稍后付款”付款选项

发布于 2025-01-09 19:34:25 字数 767 浏览 5 评论 0原文

我在我的应用程序中使用 react-native-razorpay 。 我想在 Razorpay 付款页面隐藏一些付款方式。

我可以隐藏或禁用网上银行电子钱包选项,但稍后付款选项无法禁用。

这是我使用的代码

  var options = {
    image: '',
    currency: 'INR',
    key: '***********',
    amount: Amount,
    name: 'MY APP',
    prefill: {
      email: Email,
      contact: Number,
      name: Name
    },
    theme: {color: 'red'},
    method: {
      netbanking: false,
      card: true,
      wallet: false,
      upi: true,
      paylater: false
    },
  }

  RazorpayCheckout.open(options).then((data) => {})

如何在react-native-razorpay中隐藏或禁用稍后付款付款选项

I am using react-native-razorpay in my application.
I want to hide some payment methods on the Razorpay payment page.

I am able to hide or disable Net Banking and Wallet options but the Pay Later option doesn't disable.

This the code i used

  var options = {
    image: '',
    currency: 'INR',
    key: '***********',
    amount: Amount,
    name: 'MY APP',
    prefill: {
      email: Email,
      contact: Number,
      name: Name
    },
    theme: {color: 'red'},
    method: {
      netbanking: false,
      card: true,
      wallet: false,
      upi: true,
      paylater: false
    },
  }

  RazorpayCheckout.open(options).then((data) => {})

How to hide or disable Pay Later payment option in react-native-razorpay

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

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

发布评论

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

评论(2

翻身的咸鱼 2025-01-16 19:34:25
config: {
      display: {
        hide: [
        { method: 'paylater' },
        { method: 'emi' }
      ],
      preferences: { show_default_blocks: true }
      }
    }
config: {
      display: {
        hide: [
        { method: 'paylater' },
        { method: 'emi' }
      ],
      preferences: { show_default_blocks: true }
      }
    }
故笙诉离歌 2025-01-16 19:34:25

[原生Android][Java/Kotlin]

花了一整天的时间寻找,但没有任何效果。但是,终于找到了解决办法。希望它能帮助某人。

您可以使用以下实现来隐藏 Android 中的特定选项。

        JSONObject configObj = new JSONObject();
        JSONObject displayObj = new JSONObject();
        JSONArray hideObj = new JSONArray();
        JSONObject methodObj = new JSONObject();
        JSONObject preferencesObj = new JSONObject();

        preferencesObj.put("show_default_blocks", "true");
        methodObj.put("method","paylater");
        hideObj.put(methodObj);
        displayObj.put("hide", hideObj);
        displayObj.put("preferences", preferencesObj);
        configObj.put("display",displayObj);

        options.put("config", configObj);

        checkout.open(activityContext, options);

[Native Android] [Java/Kotlin]

Spent a whole day searching, but nothing worked. But, finally found the solution. Hope it will help someone.

You can use the following implementation to hide the particular option in Android.

        JSONObject configObj = new JSONObject();
        JSONObject displayObj = new JSONObject();
        JSONArray hideObj = new JSONArray();
        JSONObject methodObj = new JSONObject();
        JSONObject preferencesObj = new JSONObject();

        preferencesObj.put("show_default_blocks", "true");
        methodObj.put("method","paylater");
        hideObj.put(methodObj);
        displayObj.put("hide", hideObj);
        displayObj.put("preferences", preferencesObj);
        configObj.put("display",displayObj);

        options.put("config", configObj);

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