2015-10-22 148 views
0

我正在使用Python的PayPal Api付款。贝宝货币MXN问题

我有美元和一切它的确定领域的货币一个简单的请求......

,但如果我更改MXN(我需要此货币)支付宝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支持需要为MXN货币启用

回答

0

您的帐户。如果在验证后仍然出现错误,您应该联系Merchant Technical Support并在回复中使用debug_id。他们将能够看到您帐户实际发生的情况。

0

Theres是item_list中价格的一个问题,因为它应该具有float格式(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."}]}) 

你也试图建立一个信用卡付款方式,但贝宝只接受贝宝 MXN货币支付方式。

希望它有帮助