【问题标题】:Stripe Payments API : Charge card from the iOS App instead of using a serverStripe Payments API:从 iOS 应用程序而不是使用服务器收费卡
【发布时间】:2015-07-09 22:54:51
【问题描述】:

这是关于 Stripe Payments API “https://stripe.com/docs/mobile/ios

我想知道是否有人能够使用 iOS 应用程序中的 Stripe API 向信用卡收费,而不是将 stripeToken 发送到服务器。

一位开发人员可以在我们的应用程序的 android 版本上通过将条带 Java 客户端库添加到他的应用程序中来做到这一点。在 android/java 上是这样的

 Stripe.apiKey = "sk_test_apikey";

 Map<String, Object> chargeParams = new HashMap<String, Object>();
 chargeParams.put("amount", 400);
 chargeParams.put("currency", "usd");
 chargeParams.put("source", "tok_321jlkj54545B");
 chargeParams.put("description", "Charge for test@example.com");

 Charge.create(chargeParams);

对于 Stripe Payments API,我需要上述 Android/Java 代码的 iOS 等价物。它可能是一个 post http 请求,或者可能在内置的 Stripe iOS 库中已经有一个方法。

我想知道是否有人能够做到这一点,或者我真的需要创建一个服务器来从 iOS 应用程序向信用卡收费。

谢谢!

【问题讨论】:

  • 有 3rd 方工具可以为你处理服务器端的东西(基本上它们将你的公钥链接到你的私钥),stripe.com/docs/integrations 会列出一些

标签: objective-c swift stripe-payments


【解决方案1】:

您应该这样做。要创建费用,您必须使用您的 Secret API 密钥。如果您的 API 密钥到达您的应用程序,那么有人可以在他的终端检索它,然后使用它代表您进行任何 API 调用。这意味着他们可以创建费用、退款、转账等。

必须在服务器端执行此操作,并且您的 iOS(或 Android)应用程序应该永远拥有您的 Secret API 密钥。

【讨论】:

    猜你喜欢
    • 2016-07-03
    • 1970-01-01
    • 2021-05-12
    • 2015-12-23
    • 1970-01-01
    • 2016-08-04
    • 2021-05-29
    • 2019-03-16
    • 2019-04-09
    相关资源
    最近更新 更多