android - 从 Google Pay 中排除信用卡

标签 android google-pay

最近宣布,自 2020 年 4 月起,英国将禁止通过信用卡进行赌博。因此,我需要从 Google Pay 中排除信用卡,以便用户无法选择信用卡作为付款方式。

我知道我可以排除特定的卡网络,如下所示:

private static JSONArray getAllowedCardNetworks() {
  return new JSONArray()
      .put("AMEX")
      .put("DISCOVER")
      .put("INTERAC");
      .put("JCB")
      .put("MASTERCARD")
      .put("VISA");
}

但是,鉴于卡网络可以同时提供借记卡和信用卡,排除使用网络是没有意义的。

还可以选择通过

排除预付卡
allowPrepaidCards

但我看不到任何有关排除信用卡或借记卡的信息,这是否不受支持?

编辑:

与 Google 交谈后,他们给了我以下答复,我会在该功能可用时进行更新。同时遵循 Sams 的建议。

Thank you for reaching out. Unfortunately, we currently don't have a way of excluding credit cards from Google Pay API. We are aware of this and we are reviewing the possible options we have to enable this feature. Please let us check with the product the roadmap of this feature and we will get back to you.

最佳答案

尽管文档尚未更新,但此功能现已可用。

查看示例 Web 实现:https://jsfiddle.net/6983ofu2/

const baseCardPaymentMethod = {
  type: 'CARD',
  parameters: {
    allowedAuthMethods: allowedCardAuthMethods,
    allowedCardNetworks: allowedCardNetworks,
    allowCreditCards: false
  }
};

看看它是否也适用于 Android 会很有趣。

关于android - 从 Google Pay 中排除信用卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59755436/

相关文章:

android - Google Pass 标签未显示在 iPhone 上的 Google Pay 应用中

ReactJS:Stripe Google 和 Apple Pay

java - 代码似乎阻止 xml 布局在 Android Studio 中显示

java - Android OpenGL ES 2.0 多个对象

android - PendingIntent 不适用于参数

java - 使用 Web View 清除 1 个以上 Activity 中的 Web 缓存

java - Android/Java 及多个 "view states"

google-pay - Google 钱包 API 权限被拒绝

flutter - 如何创建 Google Pay 链接以汇款或收款?