过去几年我一直在使用c# mvc来集成PayPal支付系统。但这几天,客户投诉Paypal发来的“收到付款通知”邮件,商品描述有误。它显示“交易描述”而不是“商品名称”。
我检查了 PayPal 调试请求和响应是否正确。
{
"intent": "sale",
"payer": {
"payment_method": "paypal"
},
"redirect_urls": {
"cancel_url": "xxx",
"return_url": "xxx"
},
"transactions": [
{
"amount": {
"currency": "SGD",
"total": "50.00"
},
"description": "Big Title Descriptions",
"item_list": {
"items": [
{
"currency": "SGD",
"description": "Item Description",
"name": "Item Name",
"price": "50.00",
"quantity": "1"
}
]
}
}
]
}
但是当我查看电子邮件时,发现错误。
感谢您的帮助!
我已经尝试了很多次并硬编码了描述和单个项目名称(我尝试添加两个项目),但结果仍然相同,只显示一个并仅显示交易描述。
Amount amnt = new Amount();
amnt.currency = "SGD";
amnt.total = "50";
List<Transaction> transaction = new List<Transaction>();
Transaction trans = new Transaction();
trans.description = "Big Title Descriptions";
trans.amount = "50";
List<Item> items = new List<Item>();
Item item = new Item();
item.name = "Item Name 1";
item.description = "Item Description 1";
item.price = "40";
item.quantity = "1";
item.currency = "SGD";
items.Add(item);
item = new Item();
item.name = "Item Name 2";
item.description = "Item Description 2";
item.price = "10";
item.quantity = "1";
item.currency = "SGD";
items.Add(item);
ItemList itemList = new ItemList();
itemList.items = items;
trans.item_list = itemList;
transaction.Add(trans);
Payer payer = new Payer();
payer.payment_method = "paypal";
RedirectUrls redirect = new RedirectUrls();
redirect.cancel_url = domain + "CancelPayment?ppid=" + paymentId + "&module=" + module + "&cancel=true";
redirect.return_url = domain + "SuccessPayment?ppid=" + paymentId + "&module=" + module + "&success=true";
Payment payment = new Payment();
payment.intent = "sale";
payment.payer = payer;
payment.transactions = transaction;
payment.redirect_urls = redirect;
TempData["payment"] = payment;
Payment createdPayment = payment.Create(apiContext);
return Redirect(redirectURL + createdPayment.token);
嗨,几天后也遇到了同样的问题,我现在用的是“购物车”的商品名称,而不是“购物车”