java - 我需要自己的服务器才能使用 Stripe API 吗?

标签 java android server stripe-payments

我想通过 Stripe 在我的应用中实现支付。我正在阅读他们的文档,它一直提到我将在从 Stripe 检索 token 后使用我自己的服务器向某人收费。 ( stripe documentation )

stripe documentation

为什么我需要一个服务器来向我的用户收费为什么我不能只调用 Stripe API 方法来收费 - 我在我的服务器上有什么特别之处?有没有不用自己建服务器就可以收费的方法? Firebase 是否足够?

谢谢

最佳答案

让我用我的解释来扩展他们所说的内容:

With our mobile library, we shoulder the burden of PCI compliance by eliminating the need to send card data directly to your server. Instead, our libraries send the card data directly to our servers, where we can convert them to tokens.

这意味着人们通常会收到一个信用卡号,并希望将其存储起来以备后用(例如,客户将其输入您的帐户页面以便按月收费),但这使您在法律上有义务符合 PCI 标准,这可能是一个令人头疼的问题。 Stripe 减轻了您的这种负担——他们会存储信用卡,如果您想稍后收费,您只需给他们他们生成的代表该信用卡的 token 。

Your app will receive the token back, and can then send the token to an endpoint on your server, where it can be used to process a payment, establish recurring billing, or merely saved for later use.

这将在下一节中解释,https://stripe.com/docs/mobile/android#using-tokens

Using the payment token, however it was obtained, requires an API call from your server using your secret API key. (For security purposes, you should never embed your secret API key in your app.)

(这个是drhr提到的。)

由于您需要 key 来进行 API 调用,因此需要从您自己的服务器完成,因此您确实需要一个服务器。

注意:我记得我没有使用过 Stripe,我只是想分享我对文档的阅读。

附言我认为您的第二个问题是独立的,但是托管 Java webapp 的一些流行且简单的选择是 Heroku 和 AppEngine。然而,对于这样的事情,您可能会采用无服务器方法,例如使用 AWS Lambda https://aws.amazon.com/lambda (谷歌在 Alpha 阶段有一个等价物 https://cloud.google.com/functions/ )

关于java - 我需要自己的服务器才能使用 Stripe API 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40334268/

相关文章:

JAVA:多行输入并用空格分隔

java - Android - 根据类型强制属性

java - 未检测到 JDBC MySQL 新插入

C语言编写的UDP客户端收不到数据包

Apache2 错误 : Hostname provided via SNI and HTTP do not match

java - 根据 if else 语句更改字符串数组项

java - 为什么Java的调试Hot Swap仅限于方法内的变化?

java - 如何监听关键事件?

android - actionbar setnavigationmode 弃用

android - 不支持的操作异常 : addView(View) is not supported in AdapterView