python - 在家庭服务器上处理 Stripe 付款时出现禁止 (403) 错误

标签 python ios stripe-payments http-status-code-403

我是一名 iOS 开发者,希望将 Stripe 支付添加到我的应用程序中。我在我的 SSL 站点上创建了一个页面,其中包含来自以下链接的建议代码:

https://stripe.com/docs/charges

当我尝试处理付款时,收到“禁止 (403)”错误。谁能告诉我我可能做错了什么?我的 Ruby 文件中的所有代码如下:

stripe.api_key = "MySecretKeyGoesHere"

token = request.POST['stripeToken']

try:
  charge = stripe.Charge.create(
    amount=1000, # amount in cents, again
    currency="gbp",
    source=token,
    description="Example charge"
  )
except stripe.error.CardError, e:
 # The card has been declined
 pass

在许多主要语言中都有这方面的例子,我很乐意使用其中的任何一种,但目前正在尝试 Ruby 和 Python 版本。

最佳答案

整数数量 = 10000;//$100.00 int applicationFee = int(金额 * 0.3);//30% 份额

Map<String, Object> chargeParams = new HashMap<String, Object>();
chargeParams.put("amount", amount);
chargeParams.put("currency", "usd");
chargeParams.put("description", "Example charge");
chargeParams.put("customer", customerId); // customerId is the ID of the customer object for the paying person    
chargeParams.put("destination", accountId); // accountId is the ID of the account object for the vendor that should be paid
chargeParams.put("application_fee", applicationFee);
Charge.create(chargeParams);
  1. Please also verify if you are using correct Live Secret Key and Live Publishable Key in your server side setup.

  2. Check account logs to verify what is the exact problem you are facing while processing payments at https://dashboard.stripe.com/logs?method=not_get

  3. Verify your Connected Account on Stripe

    Account Details: https://dashboard.stripe.com/account/details
    Identity Verification: https://stripe.com/docs/connect/identity-verification

  4. Documentation Links:-
    [1] https://stripe.com/docs/api#create_charge
    [2] https://stripe.com/docs/api#create_transfer
    [3] https://stripe.com/docs/api#create_refund
    [4] https://stripe.com/docs/api#balance_object
    [5] https://stripe.com/docs/connect/payments-fees#charging-directly
    [6] https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header
    [7] https://stripe.com/docs/connect/payments-fees#charging-through-the-platform

关于python - 在家庭服务器上处理 Stripe 付款时出现禁止 (403) 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36827454/

相关文章:

python - 多索引上的重新索引会更改结构并删除索引名称

python线程模块: Is overriding run() necessary

ios - 如何使用普通按钮而不是条形按钮项目

javascript - 从 Stripe Webhook 更新 Parse.com 用户

api - 如何在 Stripe 中更改结帐表单的语言?

python - 在 numpy 中采用特定间距的数组差异

python - 图像检测的嵌套循环需要永远运行 1 亿次

iphone - iOS 帮助 : loaded the nib but the view outlet was not set

objective-c - 核心情节符号悬停/点击样式更改

django - 使用价格时出现错误 "You must provide at least one recurring price in ` 订阅模式。”