Braintree

Authentication

To connect your Braintree account on Leapfin Platform. Following information is required:

  • Merchant ID
  • Public Key
  • Private Key

The information can be retrieved by following steps below:

Step 1: Log into your Braintree account

Step 2: Select "API" from the setting dropdown menu on top-right corner of screen

Step 3: If you want to use an existing API key, click on the "View" button. Otherwise, you can click on "Generate New API Key".

Step 4: All required information: Merchant ID, Public Key, and Private Key is listed on the screen.

Step 5: Enter the information on Leapfin Platform, and click on Submit

Data Sources

Once authenticated, Leapfin fetches information related to transactions, fees, discounts, plans and customers from Braintree. A combination of Braintree SDK and GraphQL API are is used in order to fetch all necessary information.

Transaction

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, refer to Braintree Transaction.

Each transaction object is imported as a braintree-transaction record on Leapfin Platform.

sample data

{
    "id": "fqnycvx",
    "type": "sale",
    "addOns": [
    ],
    "amount": "57.60",
    "planId": null,
    "status": "settled",
    "billing": {
        "id": null,
        "region": null,
        "company": null,
        "lastName": null,
        "locality": null,
        "firstName": null,
        "postalCode": null,
        "countryName": null,
        "streetAddress": null,
        "extendedAddress": null,
        "countryCodeAlpha2": null,
        "countryCodeAlpha3": null,
        "countryCodeNumeric": null
    },
    "channel": "Spreedly_BT",
    "orderId": "156837e8-ab08-11e9-944f-0242dd998877",
    "applePay": {
        "bin": "465876",
        "debit": "No",
        "last4": "1037",
        "token": null,
        "payroll": "No",
        "prepaid": "No",
        "cardType": "Apple Pay - Visa",
        "globalId": null,
        "imageUrl": "https://assets.braintreegateway.com/payment_method_logo/apple_pay.png?environment=production",
        "productId": "A",
        "commercial": "No",
        "healthcare": "No",
        "issuingBank": "U.S. Bank National Association-Credit",
        "cardholderName": null,
        "expirationYear": "2022",
        "durbinRegulated": "No",
        "expirationMonth": "04",
        "countryOfIssuance": "USA",
        "sourceDescription": "Visa 1037",
        "paymentInstrumentName": "Visa 1037"
    },
    "customer": {
        "id": null,
        "fax": null,
        "email": null,
        "phone": null,
        "company": null,
        "website": null,
        "lastName": null,
        "firstName": null
    },
    "disputes": [
    ],
    "globalId": "dHJhbnNhY3Rpb25fZnFueTJ8888",
    "refundId": null,
    "retryIds": [
    ],
    "shipping": {
        "id": null,
        "region": null,
        "company": null,
        "lastName": null,
        "locality": null,
        "firstName": null,
        "postalCode": null,
        "countryName": null,
        "streetAddress": null,
        "extendedAddress": null,
        "countryCodeAlpha2": null,
        "countryCodeAlpha3": null,
        "countryCodeNumeric": null
    },
    "createdAt": "2019-07-20T16:04:42Z",
    "discounts": [
    ],
    "recurring": false,
    "refundIds": [
    ],
    "taxAmount": null,
    "taxExempt": false,
    "updatedAt": "2019-07-20T17:53:18Z",
    "creditCard": {
        "bin": null,
        "debit": "Unknown",
        "last4": null,
        "token": null,
        "payroll": "Unknown",
        "prepaid": "Unknown",
        "cardType": null,
        "globalId": null,
        "imageUrl": "https://assets.braintreegateway.com/payment_method_logo/unknown.png?environment=production",
        "venmoSdk": false,
        "productId": "Unknown",
        "commercial": "Unknown",
        "healthcare": "Unknown",
        "accountType": null,
        "issuingBank": "Unknown",
        "accountBalance": null,
        "cardholderName": null,
        "expirationYear": "",
        "durbinRegulated": "Unknown",
        "expirationMonth": "",
        "customerLocation": null,
        "countryOfIssuance": "Unknown",
        "uniqueNumberIdentifier": null
    },
    "descriptor": {
        "url": null,
        "name": null,
        "phone": null
    },
    "pinVerified": false,
    "customFields": "",
    "debitNetwork": null,
    "escrowStatus": "released",
    "installments": [
    ],
    "merchantName": "Company X",
    "subscription": {
        "billingPeriodEndDate": null,
        "billingPeriodStartDate": null
    },
    "statusHistory": [
        {
            "statusEvent": {
                "user": "usexxx",
                "amount": "57.60",
                "status": "authorized",
                "timestamp": "2019-07-20T16:04:43Z",
                "transactionSource": "api"
            }
        },
        {
            "statusEvent": {
                "user": "usexxx",
                "amount": "57.60",
                "status": "submitted_for_settlement",
                "timestamp": "2019-07-20T16:05:25Z",
                "transactionSource": "api"
            }
        },
        {
            "statusEvent": {
                "amount": "57.60",
                "status": "settled",
                "timestamp": "2019-07-20T17:53:18Z",
                "transactionSource": ""
            }
        }
    ],
    "discountAmount": null,
    "paymentReceipt": {
        "id": "fqny2vtx",
        "type": "sale",
        "amount": "57.60",
        "globalId": "dHJhbnNhY3Rpb25fZnFueTJ8888",
        "pinVerified": false,
        "merchantName": "Company X",
        "processingMode": null,
        "currencyIsoCode": "USD",
        "merchantAddress": {
            "phone": "888-888-8888",
            "region": "NY",
            "locality": "New York",
            "postalCode": "10003",
            "streetAddress": null
        },
        "processorResponseCode": "1000",
        "processorResponseText": "Approved",
        "processorAuthorizationCode": "110999",
        "merchantIdentificationNumber": "445373412134",
        "terminalIdentificationNumber": "00000001"
    },
    "processingMode": null,
    "retryGlobalIds": [
    ],
    "shippingAmount": null,
    "subscriptionId": null,
    "amountRequested": null,
    "currencyIsoCode": "USD",
    "cvvResponseCode": "I",
    "merchantAddress": {
        "phone": "888-888-8888",
        "region": "NY",
        "locality": "New York",
        "postalCode": "10003",
        "streetAddress": null
    },
    "refundGlobalIds": [
    ],
    "responseEmvData": null,
    "installmentCount": null,
    "serviceFeeAmount": "14.40",
    "threeDSecureInfo": null,
    "merchantAccountId": "xya_instant_ccdegeh",
    "settlementBatchId": "2019-07-20_xya_instant_ccdegeh",
    "disbursementDetails": {
        "success": true,
        "fundsHeld": false,
        "disbursementDate": "2019-07-22",
        "settlementAmount": "57.60",
        "settlementCurrencyIsoCode": "USD",
        "settlementCurrencyExchangeRate": "1",
        "settlementBaseCurrencyExchangeRate": null
    },
    "networkResponseCode": "00",
    "networkResponseText": "Successful approval/completion or V.I.P. PIN verification is successful",
    "purchaseOrderNumber": null,
    "shipsFromPostalCode": null,
    "voiceReferralNumber": null,
    "avsErrorResponseCode": null,
    "networkTransactionId": "309201578899999",
    "refundedInstallments": [
    ],
    "retriedTransactionId": null,
    "subMerchantAccountId": "xya_instant_ccdegeh",
    "paymentInstrumentType": "apple_pay_card",
    "processorResponseCode": "1000",
    "processorResponseText": "Approved",
    "processorResponseType": "approved",
    "refundedTransactionId": null,
    "scaExemptionRequested": null,
    "authorizationExpiresAt": "2019-07-27T16:04:43Z",
    "gatewayRejectionReason": null,
    "acquirerReferenceNumber": "24492159201713957109880",
    "authorizedTransactionId": null,
    "masterMerchantAccountId": "complay_x_plat",
    "authorizationAdjustments": [
    ],
    "retrievalReferenceNumber": null,
    "accountFundingTransaction": false,
    "avsPostalCodeResponseCode": "I",
    "processedWithNetworkToken": false,
    "processorAuthorizationCode": "110240",
    "retriedTransactionGlobalId": null,
    "additionalProcessorResponse": null,
    "refundedTransactionGlobalId": null,
    "avsStreetAddressResponseCode": "I",
    "merchantIdentificationNumber": "445373412134",
    "terminalIdentificationNumber": "00000001",
    "authorizedTransactionGlobalId": null,
    "partialSettlementTransactionIds": [
    ],
    "processorSettlementResponseCode": "4000",
    "processorSettlementResponseText": "Confirmed",
    "partialSettlementTransactionGlobalIds": [
    ]
}

sample data (with disputes)

{
    "id": "fqnycvx",
    "type": "sale",
    "addOns": [
    ],
    "amount": "57.60",
    ....
    "disputes": [
      {
         "dispute":{
            "id":"5c8hmhdb43y4n7xx",
            "kind":"chargeback",
            "amount":"5.00",
            "reason":"product_unsatisfactory",
            "status":"won",
            "dateWon":"2018-12-14",
            "evidence":[
               {
                  "evidence":{
                     "id":"6mr6ytwtmv37rc7h",
                     "url":"https://bt-production-arbiter-evidence-files.s3.amazonaws.com/foo",
                     "comment":null,
                     "category":"PROOF_OF_POSSESSION_OR_USAGE",
                     "createdAt":"2018-12-05T18:02:56Z",
                     "sequenceNumber":null,
                     "sentToProcessorAt":null
                  }
               },
               {
                  "evidence":{
                     "id":"py433w6bdgqzk752",
                     "url":"https://bt-production-arbiter-evidence-files.s3.amazonaws.com/bar",
                     "comment":null,
                     "category":null,
                     "createdAt":"2018-12-05T18:03:04Z",
                     "sequenceNumber":null,
                     "sentToProcessorAt":null
                  }
               },
               {
                  "evidence":{
                     "id":"59fydnpyxpqtx5k9",
                     "url":null,
                     "comment":"OTHER",
                     "category":"EVIDENCE_TYPE",
                     "createdAt":"2018-12-05T18:02:54Z",
                     "sequenceNumber":null,
                     "sentToProcessorAt":null
                  }
               }
            ],
            "globalId":"ZGlzcHV0ZV81YzhobWhkYjQzeTRuN3h4",
            "amountWon":"5.00",
            "createdAt":"2018-12-05T15:52:59Z",
            "updatedAt":"2018-12-14T00:18:48Z",
            "caseNumber":"PP-007-615-241-883",
            "dateOpened":"2018-12-05",
            "reasonCode":null,
            "replyByDate":"2018-12-28",
            "transaction":{
               "id":"825g0cpf",
               "amount":"5.00",
               "orderId":"charge104388776",
               "globalId":"dHJhbnNhY3Rpb25fODI1ZzBjcGY",
               "createdAt":"2018-12-04T13:09:23Z",
               "purchaseOrderNumber":null,
               "paymentInstrumentSubtype":"paypal_account"
            },
            "receivedDate":"2018-12-05",
            "statusHistory":[
               {
                  "statusHistory":{
                     "status":"won",
                     "timestamp":"2018-12-14T00:18:48Z",
                     "effectiveDate":"2018-12-14",
                     "disbursementDate":null
                  }
               },
               {
                  "statusHistory":{
                     "status":"disputed",
                     "timestamp":"2018-12-05T18:02:57Z",
                     "effectiveDate":"2018-12-05",
                     "disbursementDate":null
                  }
               },
               {
                  "statusHistory":{
                     "status":"open",
                     "timestamp":"2018-12-05T15:53:00Z",
                     "effectiveDate":"2018-12-05",
                     "disbursementDate":null
                  }
               }
            ],
            "amountDisputed":"5.00",
            "currencyIsoCode":"USD",
            "referenceNumber":null,
            "responseDeadline":"2018-12-27T05:59:59Z",
            "merchantAccountId":"Patreon_instant",
            "originalDisputeId":null,
            "processorComments":"Buyer (2018-12-05T15:41:56.000Z): 商品存在严重漏洞,导致封停账号,要求退钱!\n\nBuyer (2018-12-05T15:47:08.000Z): 商品存在严重漏洞,导致封停账号,要求退钱!",
            "reasonDescription":null,
            "processorReplyByDate":"2018-12-29"
         }
      }
    ],
    ...
}

Payment-Level Fee Report

The payment-level fee report, formerly known as the transaction-level fee report, provides a breakdown of fees per individual payments, encompassing transactions and refunds. For more details, refer to Braintree document here.

Each row of the report is imported as a braintree-fee record on Leapfin Platform. Unfortunately, Braintree provides on documentation about the data schema of the payment-level fee report. So far, Leapfin have 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 end of the month. For more details, refer to Braintree document here.

Though such estimated interchange fees are available on Leapfin Platform, accurate reconciliation is not achievable.

📘

Where are Braintree Fees

The fee information is spread across both Braintree transaction object and the Payment-level fee report. For payment instrument type "paypal_account", the fee information is contained in Braintree transaction object. All other types are included in the fee report.

sample data - with interchange fees

{
    "OrderID": "9qeJGA3Rry4pYWQSG5rPGjPPIs6",
    "CardType": "Credit",
    "Discount": "0.08",
    "CardBrand": "American Express",
    "First6OfCC": "379777",
    "IssuingBank": "",
    "ExchangeRate": "1.00",
    "TransactionID": "jbq2abct",
    "DiscountCredit": "0",
    "RefundedAmount": "0.00",
    "SettlementDate": "2018-03-24",
    "TransactionType": "sale",
    "DisbursementDate": "2018-03-26",
    "SettlementAmount": "1.00",
    "MerchantAccountID": "company_x",
    "PaymentInstrument": "credit_card",
    "PerTransactionFee": "0.05",
    "CardIssuingCountry": "USA",
    "Est.TotalFeeAmount": "0.07",
    "SettlementCurrency": "USD",
    "Est.InterchangeRate": "",
    "InterchangeCurrency": "",
    "PresentmentCurrency": "USD",
    "BraintreeTotalAmount": "0.07",
    "Est.InterchangeFixed": "",
    "OriginalTransactionID": "",
    "InterchangeDescription": "",
    "AcquirerReferenceNumber": "",
    "PerTransactionFeeCredit": "0.00",
    "Est.InterchangeRateCredit": "",
    "Est.InterchangeFixedCredit": "",
    "Est.InterchangeTotalAmount": ""
}

sample data - without interchange fees

{
    "OrderID": "",
    "CardType": "Credit",
    "Discount": "0.0290",
    "CardBrand": "Visa",
    "First6OfCC": "426999",
    "RefundType": "",
    "IssuingBank": "JPMorgan Chase Bank N.A.",
    "ExchangeRate": "1.000000000",
    "TransactionID": "1aqs8752",
    "DiscountCredit": "0.0000",
    "RefundedAmount": "0.00",
    "SettlementDate": "2022-01-30",
    "TotalFeeAmount": "0.44",
    "TransactionType": "sale",
    "DisbursementDate": "2022-02-01",
    "SettlementAmount": "5.00",
    "MerchantAccountID": "company_x_y",
    "PaymentInstrument": "credit_card",
    "PerTransactionFee": "0.30",
    "CardIssuingCountry": "USA",
    "OriginalSaleAmount": "",
    "SettlementCurrency": "USD",
    "PresentmentCurrency": "USD",
    "BraintreeTotalAmount": "0.44",
    "OriginalTransactionID": "",
    "MulticurrencyFeeAmount": "0.00",
    "MulticurrencyFeeCredit": "0.00",
    "AcquirerReferenceNumber": "24493332030715701799999",
    "PerTransactionFeeCredit": "0.00"
}

Discount

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 Leapfin Platform.

📘

Discount information is already included as parts of braintree-transaction record. Leapfin imports it as a separate record for quick reference since braintree-transaction contains lots of information.

sample data

{
    "id": "discount-build-from-scratch",
    "kind": "discount",
    "name": "discount-build-from-scratch",
    "amount": "49.97",
    "createdAt": "2017-10-11T17:54:36Z",
    "updatedAt": "2017-10-11T17:54:36Z",
    "merchantId": "vg80yw7vz9sxxxxc",
    "description": "",
    "neverExpires": false,
    "numberOfBillingCycles": 1
}

Plan

Plan object from Braintree contains details of the plan associated with a transaction. For more details, refer to Braintree Plan.

Each plan object is imported as a braintree-plan record on Leapfin Platform.

sample data

{
    "id": "proYear",
    "name": "Company X Pro",
    "price": "199.99",
    "addOns": [
    ],
    "createdAt": "2016-02-01T21:49:10Z",
    "discounts": [
    ],
    "updatedAt": "2016-02-01T21:49:10Z",
    "merchantId": "vgc6yw7vz9s1234c",
    "description": "",
    "trialPeriod": false,
    "trialDuration": null,
    "currencyIsoCode": "USD",
    "billingFrequency": 12,
    "billingDayOfMonth": null,
    "trialDurationUnit": null,
    "numberOfBillingCycles": null
}

Customer

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 Leapfin Platform.

📘

PII information, such as address, email, name, and phone, are removed by default during import process.

sample data

{
    "id": "101059999",
    "company": "company x y",
    "website": null,
    "globalId": "Y3VzdG9tZXJfMTAxMDUkd8Ne",
    "createdAt": "2016-08-06T19:52:31Z",
    "updatedAt": "2016-08-06T19:52:31Z",
    "merchantId": "6zjs2n92yxcpo0w8",
    "customFields": ""
}

Mapping Logics

braintree-transaction

Leapfin imports each Braintree transaction object as a braintree-transaction record. The record is rich in contents, covering payment, refund, dispute, payout and fee information. When mapping data, Leapfin creates multiple Financial Records from each braintree-transaction record.

Create a Payment

A Payment record is created for each braintree-transaction record with type = "sale".

Target: LeapfinPayment (schema)Source: braintree-transaction (schema)
objectType"payment"
idbraintree-transaction.id
amountbraintree-transaction.amount
currencyCodebraintree-transaction.currencyIsoCode
datebraintree-transaction.createdAt
statusfetch 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".
succeededDatefetch the latest statusEvent from braintree-transaction.statusHistory[]. If statusEvent.status = "settled", then set succeededDate as statusEvent.timestamp.
descriptionbraintree-transaction.orderId
exchangeRatesif braintree-transaction.disbursementDetails.settlementCurrencyIsoCode exists and differs from braintree-transaction.currencyIsoCode, then add following exchange rate:
-- rate = braintree-transaction.disbursementDetails.settlementCurrencyExchangeRate
-- currencyCode = braintree-transaction.disbursementDetails.settlementCurrencyIsoCode
customFieldsThe following fields from source record are added:
-- paymentInstrumentType = braintree-transaction.paymentInstrumentType
-- serviceFeeAmount = braintree-transaction.serviceFeeAmount
-- settlementAmount = braintree-transaction.disbursementDetails.settlementAmount
-- settlementCurrencyCode = braintree-transaction.disbursementDetails.settlementCurrencyIsoCode
linksNone

Create a Refund

A Refund record is created for each braintree-transaction record with type = "credit".

Target: LeapfinRefund (schema)Source: braintree-transaction (schema)
objectType"refund"
idbraintree-transaction.id
amountbraintree-transaction.amount
currencyCodebraintree-transaction.currencyIsoCode
datebraintree-transaction.createdAt
statusfetch 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".
exchangeRatesif braintree-transaction.disbursementDetails.settlementCurrencyIsoCode exists and differs from braintree-transaction.currencyIsoCode, then add following exchange rate:
-- rate = braintree-transaction.disbursementDetails.settlementCurrencyExchangeRate
-- currencyCode = braintree-transaction.disbursementDetails.settlementCurrencyIsoCode
customFieldsThe following fields from source record are added:
-- paymentInstrumentType = braintree-transaction.paymentInstrumentType
-- settlementAmount = negative braintree-transaction.disbursementDetails.settlementAmount
-- settlementCurrencyCode = braintree-transaction.disbursementDetails.settlementCurrencyIsoCode
linksAdd a link to the associated Payment record with:
-- objectType = "payment"
-- id = braintree-transaction.refundedTransactionId

Create a Dispute

A Dispute record is created for each item in braintree-transaction.disputes[].

Target: LeapfinDispute (schema)Source: braintree-transaction (schema)
objectType"dispute"
idbraintree-transaction.disputes\[].id
amountbraintree-transaction.disputes\[].amountDisputed
currencyCodebraintree-transaction.disputes\[].currencyIsoCode
datebraintree-transaction.disputes\[].createdAt
statusif 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".
descriptionbraintree-transaction.disputes\[].reason
initiatedDateif 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.
resolvedDatefetch 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.
exchangeRatesNone
customFieldsNone
linksAdd a link to the associated Payment record with:
-- objectType = "payment"
-- id = braintree-transaction.id

Create a Fee

A Fee record is be created for each braintree-transaction record with paymentInstrumentType = "paypal_account".

Target: LeapfinFee (schema)Source: braintree-transaction (schema)
objectType"fee"
iduse braintree-transaction.id as id. Add braintree-transaction.paymentInstrumentType as suffix.
amountbraintree-transaction.paypal.transactionFeeAmount
currencyCodebraintree-transaction.paypal.transactionFeeCurrencyIsoCode
dateif 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.
descriptionbraintree-transaction.paypal.description
exchangeRatesNone
customFieldsThe following fields from source record are added:
-- paymentInstrumentType = braintree-transaction.paymentInstrumentType
-- refundFromTransactionFeeAmount = braintree-transaction.paypal.refundFromTransactionFeeAmount
-- refundFromTransactionFeeCurrencyCode = braintree-transaction.paypal.refundFromTransactionFeeCurrencyIsoCode
linksif braintree-transaction.type = "sales", add a link to the associated Payment record with:
-- objectType = "payment"
-- id = braintree-transaction.id
if braintree-transaction.type = "credit", add a link to the associated Payment record with:
-- objectType = "refund"
-- id = braintree-transaction.id

Create a Payout

A Payout record is created for each braintree-transaction record which has non-empty value in disbursementDetails.disbursementDate.

Target: LeapfinSettlement (schema)Source: braintree-transaction (schema)
objectType"payout"
idbraintree-transaction.id
amountbraintree-transaction.disbursementDetails.settlementAmount
currencyCodebraintree-transaction.disbursementDetails.settlementCurrencyIsoCode
datebraintree-transaction.disbursementDetails.disbursementDate
statusif braintree-transaction.disbursementDetails.success is true, set status as "paid". Otherwise, set status as "failed".
description""
exchangeRatesNone
customFieldsNone
linksif braintree-transaction.type = "sales", add a link to the associated Payment record with:
-- objectType = "payment"
-- id = braintree-transaction.id
if braintree-transaction.type = "credit", add a link to the associated Payment record with:
-- objectType = "refund"
-- id = braintree-transaction.id

braintree-fee

Leapfin imports each row in the payment-level fee report as a braintree-fee record. There are two possible schema 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 schema.

Create a Fee

A Fee record is be created for each braintree-fee record.

Target: LeapfinFee (schema)Source: braintree-fee (schema)
objectType"fee"
iduse braintree-fee.TransactionID as id. Add braintree-fee.PaymentInstrument as suffix.
amountuse braintree-fee."Est.TotalFeeAmount" if exists (for records with interchange fee). Otherwise, use braintree-fee.TotalFeeAmount (for record without interchange fee).
currencyCodebraintree-fee.PresentmentCurrency
datebraintree-fee.SettlementDate.
description""
exchangeRatesNone
customFieldsThe following fields from source record are added:
-- paymentInstrumentType = braintree-fee.PaymentInstrument
-- braintreeTotalAmount = braintree-fee.BraintreeTotalAmount
-- interchangeTotalAmount = braintree-fee."Est.InterchangeTotalAmount"
-- multicurrencyFeeAmount = braintree-fee.MulticurrencyFeeAmount
linksif braintree-fee.TransactionType = "sales", add a link to the associated Payment record with:
-- objectType = "payment"
-- id = braintree-fee.TransactionID
if braintree-fee.TransactionType = "credit", add a link to the associated Payment record with:
-- objectType = "refund"
-- id = braintree-fee.TransactionID

...