2016-09-20 140 views
-1

我試圖與Node.js的一個singe payout with the REST API of PayPal和得到這個錯誤:貝寶支付單:TRANSACTION_LIMIT_EXCEEDED API錯誤

//... 
"errors": { 
     "name": "TRANSACTION_LIMIT_EXCEEDED", 
     "message": "Either the sender or receiver exceeded the transaction limit", 
} 
//... 

我做什麼:

我用這個example Code

var paypal = require('paypal-rest-sdk'); 

module.exports = { 
    payMe: function (req, res,next) { 

     var mail = req.param('mail'); //this email comes from the paypal sandbox 

     paypal.configure({ 
      'mode': 'sandbox', 
      'client_id': 'mycliendID', 
      'client_secret': 'myClientSecret' 
     }); 

     var sender_batch_id = Math.random().toString(36).substring(9); 

     var create_payout_json = { 
      "sender_batch_header": { 
       "sender_batch_id": sender_batch_id, 
       "email_subject": "You have a payment" 
      }, 
      "items": [ 
       { 
        "recipient_type": "EMAIL", 
        "amount": { 
         "value": 0.90, 
         "currency": "CHF" //changed from Dollar to CHF 
        }, 
        "receiver": mail, 
        "note": "Thank you.", 
        "sender_item_id": "item_3" 
       } 
      ] 
     }; 

     var sync_mode = 'true'; //for single payout 

     paypal.payout.create(create_payout_json, sync_mode, function (error, payout) { 
      if (error) { 
       console.log(error.response); 
       res.json(error.response); 
       throw error; 
      } else { 
       console.log("Create Single Payout Response"); 
       console.log(payout); 
       payout.status= "You are in the else"; 
       res.json(payout); 
      } 
     }); 

    } 

} 

=>中的電子郵件地址來自我sandbox account - 這個用戶的餘額設置爲900.00 CHF! (遠遠超過我想要支付的0.90瑞郎)

=>我在My Apps and Credentials下創建了一個新的REST API應用程序,並選擇了以前創建的用戶(使用900.00CHF餘額)。這些憑證在()中paypal.configure剪掉上面的代碼中使用

"Either the sender or receiver exceeded the transaction limit"

我在哪裏可以更改應用程序的交易限額和用戶在沙盒?

回答

-1

OK解決。

我登錄時使用的沙箱的電子郵件地址 - 那裏你可以看到所有交易。

在「拒絕」我看到了0.90CHF - 一個彈出對話框:「該接收機決定拒絕支付」

然後我意識到我用的接收者和發送者相同的電子郵件地址。那指責錯誤。 - 錯誤消息不是很清楚。

也許別人也做了同樣的錯誤,所以我讓這個在這裏。