Rebutdesk connects to Stripe and PayPal with the merchant's own API keys, opens a support case when a dispute arrives, and sends the evidence back. Until this week every test ran against local doubles of both APIs. On October 28 we ran the whole flow against a Stripe test-mode account and the PayPal sandbox, with real signed webhooks reaching a local server through a tunnel. This is what we found.

The setup

  • A local Rebutdesk server behind a temporary public tunnel, so Stripe and PayPal could deliver webhooks to it.
  • Stripe: a test-mode secret key. Disputes come from Stripe's test payment methods pm_card_createDispute (fraudulent) and pm_card_createDisputeProductNotReceived.
  • PayPal: a sandbox REST app as the merchant and a sandbox personal account as the buyer, who paid through the normal checkout and then opened an "item not received" dispute from the buyer's side.

1. Stripe's charge search cannot filter by email

Our order sidebar looked up a buyer's Stripe payments with the Search API, filtering charges on billing_details.email. Against the double it worked. Against Stripe it never did: charge search does not support that field, nor receipt_email. The fake API accepted a query the real one rejects.

What works is two steps: list customers with GET /v1/customers?email=, then list charges for each customer. One buyer often has several customers, one per checkout, so merge them and drop duplicates. A guest checkout that never created a customer still cannot be found by email; the payment on the dispute itself is the reliable link.

2. The buyer's name is often on the customer, not the charge

A dispute case opened with no buyer name, although the Stripe dashboard showed one. The charge had empty billing details; the name was on the customer. When a dispute webhook arrives we now read the dispute again with expand[]=charge and expand[]=charge.customer and fall back to the customer's name, email and phone.

Reading the dispute again instead of trusting the webhook body has a second benefit: events can arrive late or out of order, and the fresh object is the current state.

3. Staging is real, and test outcomes need exact text

Updating a Stripe dispute with submit=false stores the evidence on it without sending it to the bank. We confirmed that the fields and the PDF were on the dispute while evidence_details.submission_count stayed at 0, and went to 1 only after the real submit. That makes a "save now, review, then submit" flow safe.

In test mode, evidence with uncategorized_text set to winning_evidence closes the dispute as won, and losing_evidence as lost. It has to be exactly that text: a statement that merely starts with it stays under review. Accepting a dispute closes it as lost on both sides immediately.

4. PayPal evidence is a multipart upload with a specific shape

PayPal's provide-evidence call takes multipart/form-data with a JSON part named input and the files as file1, file2and so on. A multipart/related request we had seen elsewhere keeps the JSON and silently drops the files. Tracking-type evidence such asPROOF_OF_FULFILLMENT needs carrier and tracking number in evidence_info.tracking_info; carriers outside PayPal's list go incarrier_name_other. Our sandbox submission arrived as proof of fulfillment with a USPS tracking number and the PDF attached.

Two smaller things: sandbox dispute webhooks arrived minutes after the event, so a UI should not assume they are instant; and verifying a PayPal webhook signature needs the webhook ID, so keep it when you create the webhook.

5. Clean up the webhooks you create

Connecting an account creates a webhook at the processor. Stripe returns the endpoint's signing secret only in the create response, so it has to be stored then. Removing the account in Rebutdesk did not delete the webhook, and PayPal allows ten webhooks per app, so a few reconnects would have filled the list. Removing a payment account now deletes the webhook Rebutdesk created; if the processor refuses, the account is still removed and the console says which webhook to delete by hand.

What this changed

  • Three fixes shipped the same day: payments found by email through customers, buyer details from the customer, and webhook removal on disconnect.
  • A rule for ourselves: a test double proves our code calls an API the way we think it works. Only the real API proves it works that way.

Going through a dispute yourself? The Stripe evidence checklist and the reason code library list what to send for each reason.

About Rebutdesk

Rebutdesk is an open-source helpdesk for online stores where Stripe and PayPal disputes open inside the buyer's support case. See how it works, or read the changelog.

Start free trial

14 days free, no card needed. Already have an account? Sign in