我尝试按照https://stripe.com/docs/api#account_create_card将卡片作为目标添加到托管帐户。请求是这样的:
HTTP Method POST
HTTP URI https://api.stripe.com/v1/accounts/<acct_id>/external_accounts
HTTP Protocol HTTP/1.1
HTTP Header Accept : application/json
HTTP Header Authorization : Basic <auth_value>
HTTP Header Stripe-Version : 2016-07-06
HTTP Content application/x-www-form-urlencoded
HTTP Body external_account[object]=card
HTTP Body external_account[cvc]=121
HTTP Body external_account[exp_month]=11
HTTP Body external_account[exp_year]=2018
HTTP Body external_account[number]=4000056655665556
HTTP Body external_account[currency]=usd`
服务器回复了这样的json:
{
"error" : {
"type" : "invalid_request_error",
"message" : "Requests made on behalf of a connected account must use card tokens from Stripe.js, but card details were directly provided.",
"param" : "external_account"
}
}
我错过了什么?我们不使用stripe.js,所有与Stripe的交互都发生在后端。
答案 0 :(得分:-3)
您正在使用卡详细信息并将其传递给external_account参数,该参数仅接受卡的令牌。要使用卡详细信息,只需直接传递对象,cvc等参数即可。请勿将这些详细信息发送至external_account参数