Disputes
Testing and Go Live
You can use the following test card number in the sandbox to create sale transactions of any amount* that are instantly disputed:
Test Value | Card Type | Description |
---|---|---|
4023898493988028 | Visa |
Creates a settled sale transaction that has a dispute with an
open status
|
*Some transaction amounts trigger specific dispute behavior in the sandbox; see
creating test disputes that require compelling evidence
below.
In addition to creating a test dispute, using this test card to create sandbox transactions will
allow you to:
- Receive a dispute email notification
- Receive a Dispute Opened webhook (if set up)
- Search for or find the dispute in the Control Panel or via the API
-
Respond to the dispute in the Control Panel or
via the API with
specific evidence that will update the dispute status to
won
orlost
Creating test disputes that require compelling evidence
The following transaction amounts will set the dispute
Transaction: Sale
accordingly:
Amount | Dispute Reason Code |
---|---|
83.00 | 83 Visa Fraud |
10.40 | 1040 Visa Fraud |
13.10 | 1310 Visa Fraud |
70.30 | 7030 Discover Fraud |
Creating test Venmo disputes
If you have Venmo enabled, you can also create disputes for Venmo transactions in the sandbox.
Creating a disputed test transaction
Use
Transaction: Sale
to
create a test transaction via the API. When specifying a credit card number for the test
transaction, you can use the test card number above.
- Ruby
result = gateway.transaction.sale(
:amount => '10.00',
:credit_card => {
:expiration_date => '01/2022',
:number => Braintree::Test::CreditCardNumbers::Disputes::Chargeback
},
)
if result.success?
# Do something with the result.transaction.disputes
end
Simulating a won dispute
Specify the string "compelling_evidence"
when
adding text evidence in
the sandbox. Once finalized, this will update the dispute status to won
.
- Ruby
dispute = gateway.dispute.find("a_dispute_id")
gateway.dispute.add_text_evidence(dispute.id, "compelling_evidence")
gateway.dispute.finalize(dispute.id)
Simulating a lost dispute
Specify the string "losing_evidence"
when
adding text evidence in
the sandbox. Once finalized, this will update the dispute status to lost
.
- Ruby
dispute = gateway.dispute.find("a_dispute_id")
gateway.dispute.add_text_evidence(dispute.id, "losing_evidence")
gateway.dispute.finalize(dispute.id)