paypal ipn交易数组中缺少字母
有人能告诉我这是IPN的正确回答吗?我没有发现任何文件表明缺少字母的索引事务。有没有人遇到过这个问题paypal ipn交易数组中缺少字母,paypal,paypal-ipn,paypal-sandbox,paypal-adaptive-payments,Paypal,Paypal Ipn,Paypal Sandbox,Paypal Adaptive Payments,有人能告诉我这是IPN的正确回答吗?我没有发现任何文件表明缺少字母的索引事务。有没有人遇到过这个问题 { "payment_request_date": "Wed Nov 20 18:27:12 PST 2013", "return_url": "https://www.xxxx.com/payment/confirmation?tid=6cabb650-5254-11e3-b556-417057e4769f", "fees_payer": "EACHRECEIVER",
{
"payment_request_date": "Wed Nov 20 18:27:12 PST 2013",
"return_url": "https://www.xxxx.com/payment/confirmation?tid=6cabb650-5254-11e3-b556-417057e4769f",
"fees_payer": "EACHRECEIVER",
"ipn_notification_url": "https://www.xxxx.com/payment/paypal/ipn?tid=6cabb650-5254-11e3-b556-417057e4769f",
"sender_email": "sender@xxxx.com",
"verify_sign": "Axib8Qr9snmjWbcBJ4CIf7btl81aAI8SG1XiXJt3ayuBCZlhX9OfmLc6",
"test_ipn": "1",
"transaction": {
"0].id_for_sender_tx": "730140804D999991E",
"0].receive": "bob-facilitator@gmail.com",
"0].is_primary_receive": "false",
"0].i": "2YM92644S8890074S",
"0].statu": "Completed",
"0].paymentTyp": "SERVICE",
"0].status_for_sender_tx": "Completed",
"0].pending_reaso": "NONE",
"0].amoun": "USD 15.00",
"__proto__": {}
},
"cancel_url": "https://www.xxxx.com/payment/canceled?tid=6cabb650-5254-11e3-b556-417057e4769f",
"pay_key": "AP-2KN00752WL371LLSA",
"action_type": "PAY",
"transaction_type": "Adaptive Payment PAY",
"status": "COMPLETED",
"log_default_shipping_address_in_transaction": "false",
"charset": "windows-1252",
"notify_version": "UNVERSIONED",
"reverse_all_parallel_payments_on_error": "false",
"__proto__": {}
}
传输格式不正确:
"transaction": {
"0].id_for_sender_tx": "730140804D999991E",
"0].receive": "bob-facilitator@gmail.com",
"0].is_primary_receive": "false",
"0].i": "2YM92644S8890074S",
"0].statu": "Completed",
"0].paymentTyp": "SERVICE",
"0].status_for_sender_tx": "Completed",
"0].pending_reaso": "NONE",
"0].amoun": "USD 15.00",
"__proto__": {}
},
谢谢,我已经检查了原始数据,它是正确的。问题是sails express bodyParser以错误的方式解析。我已将bodyParser更改为:
module.exports = {
express: {
'bodyParser' : function(options){
var _urlencoded = urlencoded(options)
, _multipart = multipart(options)
, _json = json(options);
return function bodyParser(req, res, next) {
var buf = '';
req.setEncoding('utf8');
req.on('data', function(chunk){ buf += chunk });
req.on('end', function(){
req.rawBody = buf;
});
_json(req, res, function(err){
if (err) return next(err);
_urlencoded(req, res, function(err){
if (err) return next(err);
_multipart(req, res, next);
});
});
}
}
}
以及使用新的req.rawBody属性的ipn验证函数
谢谢大家