Ben*_*van 6 python http-status-code-403 ios stripe-payments
我是一名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
Run Code Online (Sandbox Code Playgroud)
在许多主要语言中都有这样的例子,我很乐意使用它们中的任何一种,但我目前正在尝试使用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);
Run Code Online (Sandbox Code Playgroud)
另请验证您在服务器端设置中是否使用了正确的实时密钥和实时可发布密钥。
检查帐户日志,以验证您在处理付款时遇到的确切问题是什么:https://dashboard.stripe.com/logs ?method=not_get
验证您在 Stripe 上连接的帐户
帐户详细信息: https: //dashboard.stripe.com/account/details
身份验证:https://stripe.com/docs/connect/identity-verification文档链接:-
[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
| 归档时间: |
|
| 查看次数: |
1439 次 |
| 最近记录: |