Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(braintree): sync dispute links and transaction card details (#116496)

Kyle Swankbe0868b9db6d
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/braintree/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/braintree/canonical_descriptions.py
index 5e98f33a239c..778c6eff7d91 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/braintree/canonical_descriptions.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/braintree/canonical_descriptions.py
@@ -21,7 +21,12 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
"amount": "Monetary amount of the transaction, with value and currency code.",
"orderId": "Merchant-supplied order identifier associated with the transaction.",
"merchantAccountId": "Identifier of the merchant account the transaction was processed under.",
- "paymentMethodSnapshot": "Snapshot of the payment method used at the time of the transaction.",
+ "paymentMethodSnapshot": "Snapshot of the payment method used at the time of the transaction. For cards, includes the brand code, last 4 digits and BIN.",
+ "customer": "Customer associated with the transaction, with its id and legacy id. Joins to the customers table.",
+ "paymentMethod": "Vaulted payment method used for the transaction. Its legacyId is the payment method token. Absent for single-use or deleted payment methods.",
+ "disbursementDetails": "Disbursement details, including the date funds were disbursed. Only present once the transaction is settled on an eligible merchant account.",
+ "installmentDetails": "Installment details, including the number of installments.",
+ "processorAuthorizationResponse": "Authorization response from the processor, including the AVS postal code, AVS street address and CVV response codes.",
},
},
"refunds": {
@@ -49,6 +54,15 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {
"type": "Type of dispute (e.g. CHARGEBACK, PRE_ARBITRATION, RETRIEVAL).",
"caseNumber": "Case number assigned to the dispute by the processor.",
"amountDisputed": "Monetary amount being disputed, with value and currency code.",
+ "amountWon": "Amount awarded back to the merchant if the dispute was reversed, with value and currency code.",
+ "replyByDate": "Date by which the merchant must submit a response to the dispute.",
+ "responseDeadline": "Deadline for the merchant to submit a response to the dispute.",
+ "referenceNumber": "Transaction reference number for the dispute.",
+ "protectionLevel": "Chargeback protection level of the dispute.",
+ "processorResponse": "Information from the processor, including the dispute reason, reason code and reason description.",
+ "transaction": "The disputed transaction, with its id and legacy id. Joins to the transactions table.",
+ "originalDispute": "For a follow-up dispute such as a pre-arbitration, the original chargeback or retrieval it follows, with its id and legacy id.",
+ "statusHistory": "One entry per status change, with the status, timestamp, effective date and disbursement date.",
},
},
"customers": {
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/braintree/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/braintree/settings.py
index 1203c66fa423..721dc28d0346 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/braintree/settings.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/braintree/settings.py
@@ -22,7 +22,16 @@ _TRANSACTION_FIELDS = """
amount { value currencyCode }
orderId
merchantAccountId
- paymentMethodSnapshot { __typename }
+ customer { id legacyId }
+ paymentMethod { legacyId }
+ disbursementDetails { date }
+ installmentDetails { count }
+ processorAuthorizationResponse { avsPostalCodeResponse avsStreetAddressResponse cvvResponse }
+ paymentMethodSnapshot {
+ __typename
+ ... on CreditCardTransactionDetails { creditCard { brandCode last4 bin } }
+ ... on CreditCardDetails { brandCode last4 bin }
+ }
"""
_REFUND_FIELDS = """
@@ -40,10 +49,19 @@ _DISPUTE_FIELDS = """
legacyId
createdAt
receivedDate
+ replyByDate
+ responseDeadline
status
type
caseNumber
+ referenceNumber
+ protectionLevel
amountDisputed { value currencyCode }
+ amountWon { value currencyCode }
+ processorResponse { reason reasonCode reasonDescription }
+ transaction { id legacyId }
+ originalDispute { id legacyId }
+ statusHistory { status timestamp effectiveDate disbursementDate }
"""
_CUSTOMER_FIELDS = """