2015-10-22 112 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貨幣支付方式。

希望它有幫助