Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Once you set up your Braintree integration, Leapfin uses a combination of Braintree SDK and GraphQL API to fetch information related to transactions, fees, discounts, plans, and customers from Braintree.
Braintree transaction object
The transaction object from Braintree is a record that includes all details of a transaction, including current status as well as status history. For more details, see Braintree Transaction.
Each transaction object is imported as a braintree-transaction record on the Leapfin Platform.
The payment-level fee report, formerly known as the transaction-level fee report, provides a breakdown of fees per individual payment, encompassing transactions and refunds. For more details, refer to the Braintree document here.
Each row of the report is imported as a braintree-fee record on the Leapfin Platform. Unfortunately, Braintree provides documentation about the data schema of the payment-level fee report. So far, Leapfin has seen two variations: one with interchange fees and one without.
Interchange Fee Estimates:
The interchange fees on Braintree's payment-level fee report are estimated values. They may be adjusted through a reclassification process. The actual interchange fees are only available in aggregated sum at the end of the month. For more details, refer to the Braintree document here.
Though such estimated interchange fees are available on the Leapfin Platform, accurate reconciliation is not achievable.
Braintree Fees:
The fee information is spread across both the Braintree transaction object and the Payment-level fee report. For payment instrument type "paypal_account", the fee information is contained in the Braintree transaction object. All other types are included in the fee report.
A discount object from Braintree contains details of discounts applied on a transaction. For more details, refer to Braintree Discount.
Each discount object is imported as a braintree-discount record on the Leapfin Platform.
Note: Discount information is already included as part of braintree-transaction record. Leapfin imports it as a separate record for quick reference since braintree-transaction contains lots of information.
The plan object from Braintree contains details of the plan associated with a transaction. For more details, refer to the Braintree Plan. Each plan object is imported as a braintree-plan record on the Leapfin Platform.
The customer object from Braintree contains details of the customer. For more details, refer to Braintree Customer. Each customer object is imported as a braintree-customer record on the Leapfin Platform.
Note: PII information, such as address, email, name, and phone is removed by default during the import process.
Leapfin imports each Braintree transaction object as a braintree-transaction record, which contains payment, refund, dispute, payout, and fee information. When mapping data, Leapfin creates multiple accounting records from each braintree-transaction record, as detailed below:
Payment record creation
A Payment record is created for each braintree-transaction record with type = "sale".
fetch the latest statusEvent from braintree-transaction.statusHistory[]. If statusEvent.status = "settled", then set status as "succeeded". Else if statusEvent.status is ”AuthorizationExpired”, “Failed”, “GatewayRejected”, “ProcessorDeclined”, “SettlementDeclined” or “Voided”, then set status as "failed". Otherwise, set status as "pending".
succeededDate
fetch the latest statusEvent from braintree-transaction.statusHistory[]. If statusEvent.status = "settled", then set succeededDate as statusEvent.timestamp.
description
braintree-transaction.orderId
exchangeRates
if braintree-transaction.disbursementDetails.settlementCurrencyIsoCode exists and differs from braintree-transaction.currencyIsoCode, then add following exchange rate:
fetch the latest statusEvent from braintree-transaction.statusHistory[]. If statusEvent.status = "settled", then set status as "succeeded". Else if statusEvent.status is ”AuthorizationExpired”, “Failed”, “GatewayRejected”, “ProcessorDeclined”, “SettlementDeclined” or “Voided”, then set status as "failed". Otherwise, set status as "pending".
exchangeRates
if braintree-transaction.disbursementDetails.settlementCurrencyIsoCode exists and differs from braintree-transaction.currencyIsoCode, then add following exchange rate:
if braintree-transaction.disputes\[].status is "lost", "accepted" or "expired" set status as "lost". else if braintree-transaction.disputes\[].status is "won", set status as "won". otherwise, set status as "pending".
description
braintree-transaction.disputes\[].reason
initiatedDate
if there is an item in braintree-transaction.disputes[].statusHistory[] with statusHistory.status = "open", then set initiatedDate as statusHistory.stimestamp. otherwise, set initiatedDate as braintree-transaction.disputes[].dateOpened.
resolvedDate
fetch is the latest statusHistory from braintree-transaction.disputes[].statusHistory[], if statusHistory.status is "won", "lost", "accepted" or "expired", then set resolvedDate as statusHistory.timestamp. if above is not available, set resolvedDate as braintree-transaction.disputes\[].dateWon.
exchangeRates
None
customFields
None
links
Add a link to the associated Payment record with:
objectType = "payment"
id = braintree-transaction.id
Fee record creation
A Fee record is created for each braintree-transaction record with paymentInstrumentType = "paypal_account".
if there is an item in braintree-transaction.statusHistory[] with statusEvent.status = "settled", then set date as statusEvent.stimestamp. otherwise, set date as braintree-transaction.createdAt.
description
braintree-transaction.paypal.description
exchangeRates
None
customFields
The following fields from the source record are added:
if braintree-transaction.disbursementDetails.success is true, set status as "paid". Otherwise, set status as "failed".
description
""
exchangeRates
None
customFields
None
links
If braintreeTransaction.type = ‘sale’, Leapfin links to the payment record.
Else, if braintreeTransaction.type = ‘credit’, Leapfin links to the refund record.
braintree-fee
Leapfin imports each row in the payment-level fee report as a braintree-fee record. There are two possible schemas for the record: one with interchange fees and one without. When mapping data, Leapfin creates a Fee record for each braintree-transaction record, considering both schemas.
Fee record creation
A Fee record is created for each braintree-fee record.
use braintree-fee.TransactionID as id. Add braintree-fee.PaymentInstrument as suffix.
amount
use braintree-fee."Est.TotalFeeAmount" if exists (for records with interchange fee). Otherwise, use braintree-fee.TotalFeeAmount (for record without interchange fee).
currencyCode
braintree-fee.PresentmentCurrency
date
braintree-fee.SettlementDate
description
""
exchangeRates
None
customFields
The following fields from the source record are added: