1. Getting started
Tight recognizes that payment processing is critical to the business model of many FinTechs. As such, the Tight API allows you to connect your existing accounts, from any payment processor, including but not limited to:- Stripe (native integration, which requires simply sharing keys)
- Moov (native integration, which requires simply sharing keys)
- Maast (native integration, which requires simply sharing keys)
- ProPay
- PayPal
- Square
- Braintree
- WePay
2. How it works
If you have already implemented your own payment processing mechanism (e.g. to allow your users to accept credit card payments, ACH, etc.), then you’ll want to follow the steps outlined below to get your payment processing integrated with the Tight API. Once integrated, your users will be able to send out invoices, and their clients will be able to pay those invoices using your payment processor of choice. Your back-end will communicate with the Tight API to let it know of any updates to payments. The Tight API, as always, will take care of all the double-entry accounting behind the scenes. And the burden of creating a robust invoicing engine to pair with your payment processing is taken off of your dev team’s shoulders.👍 Automatic income reconciliation Once you hook up your users’ income data sources (e.g. bank accounts) to Tight, Tight’s algorithms will automatically find and reconcile the bank deposits to the associated invoice payments (from your payment processor), in real-time.
3. Creating a merchant account for your user
When connecting a third party payment processor to the Tight API, you own the experience around creating a merchant for your user. As such, the UX for creating a merchant account sits inside your product. If you are using Tight’s Embeddable Invoice Dashboard, then you will also need to register a listener. By registering a listener, the Tight SDK will invoke the callback function you provide when users perform key actions, so that you can route the user to the proper place within your own UI. To register the listener, simply add the following line of JS to be ran once afterHurdlr.init({...}):
b) the user presses a CTA to refund an invoice that was already paid for through your payment processing Now that you have registered the listener, you are ready to handle when a user wants to set up payment processing (e.g. to accept credit card payments). Whenever a user presses a CTA to set up payment processing,
myPaymentProcessingCallback will be invoked with a JSON object as the single argument.
When that CTA is clicked, we recommend you take the following actions:
a) route the user to your payment processing (or merchant account creation) flow, so they can complete their merchant setupb) once complete, update the user’s invoice setup record to set
thirdPartyPaymentsEnabled to true
An example implementation of myPaymentProcessingCallback is shown below:
4. Processing a payment
If you are using Tight’s Embeddable Client-facing Invoice, then you will also need to register a listener. By passing in apaymentCallbackFunction into the Hurdlr.renderClientInvoice() function, the Tight SDK will invoke the callback function you provide when the user’s client performs key actions, such as pressing a CTA to pay the invoice, so that you can route the user to the proper place within your own UI.
When the “pay invoice” CTA is clicked, we recommend you take the following actions:
a) route the user to your payment capture flowb) process the payment for the specific invoice (using
data.invoiceId) via your payment processorc) alert the Tight API that the payment was processed An example implementation of
myClientInvoiceCallback is shown below:
| Field | Description | Format |
|---|---|---|
| invoiceId | Id of the invoice to mark paid | Numeric |
| grossPaymentAmount | Total amount paid by the client | Numeric, with 2 decimal places |
| feePaymentAmount | Service fee to process the payment (subtracted out of the grossPaymentAmount) | Numeric, with 2 decimal places |
| apiPaymentId | Id of the payment in your DB (or from your payment processor) | Any string |
| paymentSource | Display name for the payment | Any string (e.g. “Visa *4747 Charge”) |
| status | Status of the payment (especially useful for ACH) | Must be one of the following: “PENDING”, “PROCESSED”, “CANCELED”, “REFUNDED”, “FAILED” |
5. Refunding a payment
Now that you have registered the listener, you are ready to handle when a user wants to refund a paid invoice. Whenever a user presses a CTA to refund a paid invoice,myPaymentProcessingCallback will be invoked with a JSON object as the single argument.
When that CTA is clicked, we recommend you take the following actions:
a) process the refund for the specific invoice (using data.invoiceId) via your payment processorb) alert the Tight API that the refund was processed, by marking the invoice as refunded An example implementation of
myPaymentProcessingCallback is shown below:
| Field | Description | Format |
|---|---|---|
| apiPaymentId | Id of the payment in your DB (or from your payment processor) | Numeric |