【发布时间】:2019-05-24 17:06:02
【问题描述】:
根据文档,我必须在 POST 请求中发送从 Google Pay 接收并以 Base64 编码的令牌。但银行以错误“[paymentToken] 参数的值无效”作为响应。我如何获得这个令牌?
//if you try it like this, then the answer is the same error.
PaymentMethodToken token = paymentData.getPaymentMethodToken().getToken();
//the same error
byte[] data = token.getBytes();
String base64 = Base64.encodeToString(data, Base64.DEFAULT);
【问题讨论】:
-
这在很大程度上取决于银行方面的后端 API 的预期。银行通常会提供一个测试或“游乐场”环境,您可以在其中使用已知有效的值来测试您的代码……如果可以,请尝试一下。
标签: android token payment google-pay