始终清空贝宝 IPN 自定义字段
Always empty paypal IPN custom field
我正在尝试像这样发送我的自定义字段(使用沙箱):
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: dataResponse.value
},
custom: 'SOME_DATA',
}]
});
},
// Finalize the transaction
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
// Show a success message to the buyer
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
}
}).render('#paypal-button-container');
就像我在服务器上得到响应(我使用 paypal/ipn-code-samples):
$data_text = "";
foreach ($_POST as $key => $value) {
$data_text .= $key . " = " . $value . "\r\n";
}
这是 IPN 的样子(部分):
paypal_ipn_status = RECEIVER EMAIL MISMATCH
paypal_ipn_date = 2020-02-20 12:20:53 +05
mc_gross = 27.00
protection_eligibility = Eligible
address_status = confirmed
payer_id = 6F3VC36BWPQ7J
address_street = \u0443\u043B\u0438\u0446\u0430 \u041F\u0435\u0440\u0432\u0430\u044F
payment_date = 23:20:41 Feb 19, 2020 PST
payment_status = Completed
charset = KOI8_R
address_zip = 127001
first_name = John
mc_fee = 11.05
address_country_code = RU
address_name = Doe John
notify_version = 3.9
custom =
payer_status = verified
business = sb-gvgju1033031@business.example.com
谁能告诉我我做错了什么?
谢谢!
嗯,我发现错了
而不是这个:
return actions.order.create({
purchase_units: [{
amount: {
value: dataResponse.value
},
custom: 'SOME_DATA',
}]
});
需要使用这个(prop named - custom_id):
return actions.order.create({
purchase_units: [{
amount: {
value: dataResponse.value
},
custom_id: 'SOME_DATA',
}]
});
现在我终于在 IPN 中获得了我的自定义字段
address_country_code = RU
address_name = Doe John
notify_version = 3.9
custom = SOME DATA
我希望这对某人有所帮助。
我正在尝试像这样发送我的自定义字段(使用沙箱):
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: dataResponse.value
},
custom: 'SOME_DATA',
}]
});
},
// Finalize the transaction
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
// Show a success message to the buyer
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
}
}).render('#paypal-button-container');
就像我在服务器上得到响应(我使用 paypal/ipn-code-samples):
$data_text = "";
foreach ($_POST as $key => $value) {
$data_text .= $key . " = " . $value . "\r\n";
}
这是 IPN 的样子(部分):
paypal_ipn_status = RECEIVER EMAIL MISMATCH
paypal_ipn_date = 2020-02-20 12:20:53 +05
mc_gross = 27.00
protection_eligibility = Eligible
address_status = confirmed
payer_id = 6F3VC36BWPQ7J
address_street = \u0443\u043B\u0438\u0446\u0430 \u041F\u0435\u0440\u0432\u0430\u044F
payment_date = 23:20:41 Feb 19, 2020 PST
payment_status = Completed
charset = KOI8_R
address_zip = 127001
first_name = John
mc_fee = 11.05
address_country_code = RU
address_name = Doe John
notify_version = 3.9
custom =
payer_status = verified
business = sb-gvgju1033031@business.example.com
谁能告诉我我做错了什么? 谢谢!
嗯,我发现错了
而不是这个:
return actions.order.create({
purchase_units: [{
amount: {
value: dataResponse.value
},
custom: 'SOME_DATA',
}]
});
需要使用这个(prop named - custom_id):
return actions.order.create({
purchase_units: [{
amount: {
value: dataResponse.value
},
custom_id: 'SOME_DATA',
}]
});
现在我终于在 IPN 中获得了我的自定义字段
address_country_code = RU
address_name = Doe John
notify_version = 3.9
custom = SOME DATA
我希望这对某人有所帮助。