paypal - Paypal REST API - 检测到重复的发票 ID
问题描述
即使我为每个交易请求使用唯一的 invoice_number,我也收到此错误。但我不明白为什么它报告重复。
{"name":"DUPLICATE_TRANSACTION","details":[],"message":"检测到重复的发票 ID。","information_link":" https://developer.paypal.com/docs/api/payments/#错误","debug_id":"8c24c538da594"}
这里是构建 PAYPAL REST API 的代码:-
var data_custom = new EzyWrap.Web.UI.Models.TransactionCustom
{
OrderId = orderId,
StoreName = SiteSetting.Store.Name,
Name = FirstName + LastName
};
// Adding description about the transaction
transactionList.Add(new Transaction()
{
description = SiteSetting.Store.Name, //The store name
invoice_number = orderId, //Order Id that unique each paypal request
amount = amount, //Cart Amount
item_list = new ItemList()
{
items = itemList.items, //List of Cart Item
shipping_address = shippingInfo //Shipping Information For Adddress
},
notify_url = notigyUrl,//Notify Url for IPN response
custom = JsonConvert.SerializeObject(data_custom),//Pass custom data of client information in json format
reference_id = cart.FirstOrDefault().ReferenceNumber//Pass Reference Id Of the cart
});
this.payment = new Payment()
{
intent = "sale",
payer = payer,
transactions = transactionList,
redirect_urls = redirUrls,
};
// Create a payment using a APIContext
return this.payment.Create(apiContext);
每次paypal因为重复发票而拒绝它。任何想法如何解决这一问题?
解决方案
推荐阅读
- ios - 推送通知,来自 Parse-Server 云代码
- reactjs - useLazyQuery 结果为“重新渲染过多”
- android - 如何在android中设置progressBar颜色?
- php - 解析错误:解析错误,期待 `'{'' Laravel
- log4j - 如何仅在 log4j 中保留过去 50 天的日志
- regex - 正则表达式删除多行注释中的第一行和最后一行文本
- python - 在 python 中绘制 grib 文件时是否有可能限制坐标?
- algorithm - 二叉树中的链表
- python - 加快从 pandas 数据框创建列表
- zephir - Zephir中的var和let有什么区别