我正在使用Python PayPal Api付款。
我有一个简单的请求,使用美元的现场货币,一切都可以......
但如果我换了MXN(我需要这个货币),paypal WS会返回这个错误:
{u'message': u'Invalid request - see details', u'debug_id': u'2c9a227257a86', u'information_link': u'https://developer.paypal.com/webapps/developer/docs/api/#VALIDATION_ERROR', u'name': u'VALIDATION_ERROR', u'details': [{u'field': u'transactions[0].amount.currency', u'issue': u'Value is not supported at this time'}]}
我也尝试过欧元(EUR)和日元(JPY)。它与这些值完美配合......问题在于我使用MXN。
这是我在Python中的请求:
ayment = paypalrestsdk.Payment({
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [{
"credit_card": {
"type": "visa",
"number": "xxxxxxxxxxxxxxxx",
"expire_month": "11",
"expire_year": "2018",
"cvv2": "xxx",
"first_name": "Brad",
"last_name": "John"}}]},
"transactions": [{
"item_list": {
"items": [{
"name": "item",
"sku": "item",
"price": "1",
"currency": "MXN",
"quantity": 1 }]},
"amount": {
"total": "1",
"currency": "MXN"},
"description": "This is the payment transaction description."}]})
有什么建议吗?
PD:文档提到了支持的货币类型之间的MXN
答案 0 :(得分:0)
您的帐户需要为MXN货币启用。如果您在验证后仍然收到错误,则应与响应中的debug_id
联系Merchant Technical Support。他们将能够看到您的帐户实际发生了什么。
答案 1 :(得分:0)
Theres是item_list中价格的一个问题,因为它应该具有浮动格式(1.00),并且对于items数组中的项目也是如此。
payment = paypalrestsdk.Payment({
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [{
"credit_card": {
"type": "visa",
"number": "xxxxxxxxxxxxxxxx",
"expire_month": "11",
"expire_year": "2018",
"cvv2": "xxx",
"first_name": "Brad",
"last_name": "John"}}]},
"transactions": [{
"item_list": {
"items": [{
"name": "item",
"sku": "item",
"price": "1.00",
"currency": "MXN",
"quantity": 1 }]},
"amount": {
"total": "1.00",
"currency": "MXN"},
"description": "This is the payment transaction description."}]})
此外,您尝试创建信用卡付款方式,但Paypal只接收MXN货币的 paypal 付款方式。
希望有所帮助