【问题标题】:How to integrate Google Pay?如何整合 Google Pay?
【发布时间】:2019-07-11 12:15:53
【问题描述】:

我想将 Google Pay 集成到我的 Android 应用程序中。我试过this repo。收到以下错误。

此商家未启用 google pay

这是我的一些导致错误的代码。

public static final HashMap<String, String> PAYMENT_GATEWAY_TOKENIZATION_PARAMETERS = new HashMap<String, String>() {

   put("gateway", "example"); // WHAT SHOULD I WIRTE INSTED OF EXAMPLE?
          put("gatewayMerchantId", "MerchantIdexample"); //found from https://merchants.google.com 
          // Your processor may require additional parameters.
        }
};

【问题讨论】:

  • 错误解释清楚,你需要在google pay开一个商家账户。
  • 我已经在google pay中开通并验证了商户账户
  • 我认为您应该有一个需要放入代码中的商家 ID。你也这样做了吗?
  • 是的,我已经这样做了。还有其他设置吗? // 我应该写什么 示例我写了商家名称,可以吗?
  • 现在我面临 unexpected developer 错误

标签: android payment-gateway payment android-pay google-pay


【解决方案1】:

您需要将此添加到您的清单(在应用程序内部)::

<meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true"/>

【讨论】:

  • 你拯救了我的一天
【解决方案2】:
out_marginLeft="50dp"
            android:layout_marginTop="50dp"
            android:layout_marginRight="50dp"
            android:gravity="center"
            android:orientation="vertical">

            <ProgressBar
                android:id="@+id/progressBar"
                style="?android:attr/progressBarStyleHorizontal"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_above="@+id/txtProgress"
                android:layout_centerHorizontal="true"
                android:layout_marginLeft="16dp"
                android:layout_marginRight="16dp"
                android:progress="50"
                android:progressTint="@android:color/black" />

            <TextView
                android:id="@+id/txtProgress"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:text="Progress"
                android:textColor="@android:color/black" />
        </LinearLayout>  

Java

【讨论】:

  • 我想你只是把你的剪贴板丢在了这条评论里
【解决方案3】:

交易可能有风险。为了您的安全,目前无法完成我在使用此代码时也收到此错误

      </a>

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-05-05
  • 1970-01-01
  • 2022-07-15
  • 2019-01-09
  • 1970-01-01
  • 2018-07-03
  • 1970-01-01
相关资源
最近更新 更多