【发布时间】:2020-06-04 15:56:53
【问题描述】:
我正在尝试像这样发送我的自定义字段(使用沙盒):
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
谁能告诉我我做错了什么? 谢谢!
【问题讨论】:
-
实际发送的 HTTP 请求是什么?在不知道
actions.order.create()到底做了什么的情况下,不可能从中猜到。
标签: paypal paypal-sandbox paypal-ipn