查詢中心 - 個人帳戶
  • 主頁
  • 付款和轉帳
  • 糾紛申訴和限制
  • 我的帳戶
  • 我的錢包
  • 登入和安全資訊
  • 賣家工具

How do I avoid duplicate transactions?

Blocking duplicate invoice IDs

To avoid duplicate transactions, you need to pass an invoice number to the PayPal system. This feature is available for PayPal Payments Standard (also known as Website Payments Standard) and PayPal Payments Pro (SOAP and NVP). Once you configure your profile to block duplicate invoice numbers, PayPal will check whether each passed invoice number has already been paid in your account. For example, if invoice 1001 has been paid, 1001 will be denied if it is passed to the PayPal account a second time.

Here's how to block duplicate invoice IDs in your profile:
  1. Log in to your PayPal account.
  2. Select the gear next to Log out in the upper right corner of the page.
  3. Click Account Settings.
  4. Under Account & Security, click Payment Preferences.
  5. Click Update next to Block payments.
  6. Select Yes, block multiple payments per invoice ID under Block accidental payments.
  7. Click Save.
Passing invoice numbers to PayPal Payments Standard To pass an invoice number to PayPal Payments Standard, add a line of code to your existing button code, similar to the following example:
 
<input type="hidden" name="invoice" value="001">

Note: You can't add this code to a button originally created as encrypted.

Passing invoice IDs to PayPal Payments Pro
For PayPal Payments Pro, the parameter you pass depends on the type of API calls you're making.
  • For SOAP, use InvoiceID.
  • For NVP, use INVNUM.
Preventing duplicate transactions and retrying REST API transactions using PayPal-Request-Id To prevent duplicate REST API transactions, use the variable PayPal-Request-Id. When you add this variable to your integration, it prevents duplicate transactions with the same value. It also allows you to resubmit transactions if the system times out before you get an API response back to verify that a previous transaction completed. 

When a duplicate transaction uses the same PayPal-Request-Id, it will return the following example response:
 
    [name] => DUPLICATE_REQUEST_ID
    [message] => The value of PayPal-Request-Id header has already been used
    [information_link] => https://developer.paypal.com/webapps/developer/docs/api/#DUPLICATE_REQUEST_ID
    [debug_id] => b008929a73c5f

See REST API authentication and headers for more information on using PayPal-Request-Id.

PayPal Payments Pro returns API error code 10412 if it detects a duplicate invoice number. For a complete list of API error codes, and details regarding the 10412 error, see API error codes.

我們可以透過更多方式提供協助

如你繼續瀏覽,我們將使用 Cookie 來改善和提供為你而設的體驗。可否讓我們同時使用 Cookie 向你展示個人化廣告?了解更多並管理你的 Cookie