Paypal REST API-检测到重复的发票ID

时间:2019-05-02 13:40:49

标签: paypal paypal-sandbox paypal-rest-sdk

即使我为每个交易请求都使用唯一的发票编号,也遇到了此错误。但是我不明白为什么它报告重复项。

{“ name”:“ DUPLICATE_TRANSACTION”,“ details”:[],“ message”:“检测到重复的发票ID。”,“ information_link”:“ https://developer.paypal.com/docs/api/payments/#errors”,“ debug_id”:“ 8c24c538da594” }

查看异常:- enter image description here

以下是构建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)都会拒绝它。任何想法如何解决这个问题?

0 个答案:

没有答案