Skip to content

Commit

Permalink
Merge pull request #289 from getlago/cashfree-integration
Browse files Browse the repository at this point in the history
cashfree(integration): add Cashfree integration
  • Loading branch information
sarkissianraffi authored Jan 14, 2025
2 parents 689f728 + 7cf4f09 commit ad78e39
Show file tree
Hide file tree
Showing 6 changed files with 239 additions and 103 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
173 changes: 120 additions & 53 deletions integrations/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,58 +1,9 @@
---
title: "Introduction"
description:
"Find all Lago native integrations with third party tools, whether it's related to payment providers,
alerting systems or data integrations."
"Find all Lago integrations with third-party tools—whether for payment providers, alerting systems, or data integrations. Note that some integrations are native and actively maintained by Lago, while others are community-developed and come with limited support."
---

## Usage tracking integrations

<CardGroup cols={2}>
<Card
title="Segment.com"
iconType="brand"
icon={
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="32" height="32" rx="8" fill="#49B881"/>
<path d="M17.9688 18.6368H8.76831C8.34574 18.6368 8 18.3015 8 17.8916C8 17.4818 8.34574 17.1465 8.76831 17.1465H17.9688C18.3914 17.1465 18.7371 17.4818 18.7371 17.8916C18.7371 18.3015 18.3914 18.6368 17.9688 18.6368Z" fill="white"/>
<path d="M16.0096 23.2001C15.2605 23.2001 14.5114 23.0884 13.8007 22.8835C13.3974 22.7531 13.1669 22.3432 13.3013 21.952C13.4358 21.5608 13.8583 21.3373 14.2617 21.4677C14.8187 21.6353 15.4142 21.7285 16.0096 21.7285C18.6219 21.7285 20.8884 20.1078 21.6375 17.686C21.7527 17.2948 22.1945 17.0713 22.5978 17.1831C23.0012 17.2948 23.2317 17.7233 23.1164 18.1145C22.1369 21.151 19.2941 23.2001 16.0096 23.2001Z" fill="white"/>
<path d="M23.2317 14.8555H14.0312C13.6087 14.8555 13.2629 14.5202 13.2629 14.1104C13.2629 13.7006 13.6087 13.3652 14.0312 13.3652H23.2317C23.6543 13.3652 24 13.7006 24 14.1104C24 14.5202 23.6543 14.8555 23.2317 14.8555Z" fill="white"/>
<path d="M9.63265 14.8551C9.55582 14.8551 9.47899 14.8365 9.40216 14.8179C8.99879 14.7061 8.7683 14.2776 8.88355 13.8864C9.86314 10.8499 12.7059 8.80078 16.0096 8.80078C16.7587 8.80078 17.5078 8.91255 18.2185 9.11747C18.6218 9.24787 18.8523 9.6577 18.7179 10.0489C18.5834 10.4401 18.1609 10.6637 17.7575 10.5333C17.2005 10.3656 16.605 10.2724 16.0096 10.2724C13.3974 10.2724 11.1308 11.8931 10.3817 14.3149C10.2665 14.6502 9.95918 14.8551 9.63265 14.8551Z" fill="white"/>
<path d="M20.5618 12.0235C20.9861 12.0235 21.3301 11.6899 21.3301 11.2784C21.3301 10.8668 20.9861 10.5332 20.5618 10.5332C20.1375 10.5332 19.7935 10.8668 19.7935 11.2784C19.7935 11.6899 20.1375 12.0235 20.5618 12.0235Z" fill="white"/>
<path d="M11.4382 21.4864C11.8625 21.4864 12.2065 21.1528 12.2065 20.7412C12.2065 20.3297 11.8625 19.9961 11.4382 19.9961C11.0138 19.9961 10.6699 20.3297 10.6699 20.7412C10.6699 21.1528 11.0138 21.4864 11.4382 21.4864Z" fill="white"/>
</svg>
}
href="/integrations/usage/segment"

>

Segment is used to track and ingest events that can be sent to Lago as
usage.

</Card>
<Card
title="Hightouch"
icon={
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="32" height="32" rx="8" fill="#4FC26B"/>
<g clip-path="url(#clip0_4694_561)">
<path d="M23.7159 19.0013H12.9987V8.28307C12.9987 8.12656 13.1253 8 13.2818 8H23.7169C23.8734 8 24 8.12656 24 8.28307V18.7182C23.999 18.8747 23.8725 19.0013 23.7159 19.0013Z" fill="white"/>
<path d="M12.7157 24.0007H8.28307C8.12656 24.0007 8 23.8741 8 23.7176V19.285C8 19.1285 8.12656 19.002 8.28307 19.002H12.9987V23.7176C12.9987 23.8741 12.8722 24.0007 12.7157 24.0007Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_4694_561">
<rect width="16" height="16" fill="white" transform="translate(8 8)"/>
</clipPath>
</defs>
</svg>
}
href="/integrations/usage/hightouch"
>
Reverse-ETL helping you sync data from any sources (database, warehouses,
spreadsheet...) to Lago.
</Card>
</CardGroup>

## Payments integrations

<CardGroup cols={2}>
Expand Down Expand Up @@ -85,9 +36,11 @@ description:
</defs>
</svg>
}
href="/integrations/payments/gocardless-integration"
>
href="/integrations/payments/gocardless-integration">
GoCardless is the global leader of direct debits bank payments.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="Stripe Payments"
Expand All @@ -110,6 +63,9 @@ description:
>
Stripe is a suite of APIs powering online payment processing, especially
card payments.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="Adyen"
Expand All @@ -134,6 +90,20 @@ description:
>
Adyen is an omnichannel payment processing company providing multiple ways
to accept payments.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="Cashfree Payments"
icon={
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="32" height="32"><path fill="#1f074f" d="M10.41-.02h19.11a11.3 11.3 0 0 1 10.46 10.43v19.11a11.31 11.31 0 0 1-10.43 10.46h-19.1A11.3 11.3 0 0 1-.02 29.55v-19.1A11.3 11.3 0 0 1 10.41-.02Zm0 0"></path><path fill="#04aa60" d="M15.57 26.9h-.29V13.06a3.65 3.65 0 0 1 3.07-3.18c4.65-.02 9.3-.02 13.95-.02a3.59 3.59 0 0 1-3.2 3.6c-3.4.02-6.8.02-10.2.02 0 3.37 0 6.74-.02 10.11a3.65 3.65 0 0 1-2.03 2.96c-.4.2-.83.3-1.28.33Zm0 0"></path><path fill="#faaf16" d="M10.67 31.73h-.29V18.06c.16-1.5.94-2.56 2.34-3.15.41-.16.84-.23 1.28-.2.02 4.66 0 9.34-.05 14a3.58 3.58 0 0 1-3.28 3.02ZM20.05 14.7h7.8v.23a3.64 3.64 0 0 1-2.14 3.09c-.36.14-.73.23-1.12.27h-4.54V14.7Zm0 0"></path></svg>
}
href="/integrations/payments/cashfree-payments"
>
Cashfree Payments is India's leading payments and API banking company.
<br />
<Tooltip tip="This integration is community-maintained, and therefore Lago provides only limited support.">Community</Tooltip>
</Card>
</CardGroup>

Expand Down Expand Up @@ -195,6 +165,9 @@ description:
>
NetSuite is the leading integrated cloud business software for business
accounting.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="Xero"
Expand All @@ -218,6 +191,9 @@ description:
href="/integrations/accounting/xero"
>
Xero is a cloud-based accounting software for small businesses.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="QuickBooks (Beta)"
Expand All @@ -238,6 +214,9 @@ description:
}
>
Quickbooks is a cloud-based accounting software for small businesses.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
</CardGroup>

Expand Down Expand Up @@ -284,6 +263,9 @@ description:
>
Lago now features an automatic European tax detection integration for your
customers.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="Anrok"
Expand All @@ -305,6 +287,9 @@ description:
href="/integrations/taxes/anrok"
>
Anrok is the global sales tax platform for software companies.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
</CardGroup>

Expand Down Expand Up @@ -340,6 +325,9 @@ description:
href="/integrations/crm/salesforce-crm"
>
Salesforce CRM integration is used to sync data from Lago to Salesforce.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="Salesforce CPQ"
Expand Down Expand Up @@ -370,6 +358,9 @@ description:
href="/integrations/crm/salesforce-cpq"
>
Salesforce CPQ extension for Lago's native Salesforce package.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="HubSpot"
Expand All @@ -383,6 +374,9 @@ description:
href="/integrations/crm/hubspot"
>
HubSpot CRM integration is used to sync data from Lago to HubSpot.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
</CardGroup>

Expand Down Expand Up @@ -431,6 +425,9 @@ description:
>
Quickly list, transact, and co-sell on AWS Marketplace with Lago, via
Suger.io integration.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="Azure Marketplace"
Expand Down Expand Up @@ -504,6 +501,9 @@ description:
>
Quickly list, transact, and co-sell on Azure Marketplace with Lago, via
Suger.io integration.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="GCP Marketplace"
Expand Down Expand Up @@ -539,6 +539,62 @@ description:
>
Quickly list, transact, and co-sell on GCP Marketplace with Lago, via
Suger.io integration.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
</CardGroup>

## Usage tracking integrations

<CardGroup cols={2}>
<Card
title="Segment.com"
iconType="brand"
icon={
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="32" height="32" rx="8" fill="#49B881"/>
<path d="M17.9688 18.6368H8.76831C8.34574 18.6368 8 18.3015 8 17.8916C8 17.4818 8.34574 17.1465 8.76831 17.1465H17.9688C18.3914 17.1465 18.7371 17.4818 18.7371 17.8916C18.7371 18.3015 18.3914 18.6368 17.9688 18.6368Z" fill="white"/>
<path d="M16.0096 23.2001C15.2605 23.2001 14.5114 23.0884 13.8007 22.8835C13.3974 22.7531 13.1669 22.3432 13.3013 21.952C13.4358 21.5608 13.8583 21.3373 14.2617 21.4677C14.8187 21.6353 15.4142 21.7285 16.0096 21.7285C18.6219 21.7285 20.8884 20.1078 21.6375 17.686C21.7527 17.2948 22.1945 17.0713 22.5978 17.1831C23.0012 17.2948 23.2317 17.7233 23.1164 18.1145C22.1369 21.151 19.2941 23.2001 16.0096 23.2001Z" fill="white"/>
<path d="M23.2317 14.8555H14.0312C13.6087 14.8555 13.2629 14.5202 13.2629 14.1104C13.2629 13.7006 13.6087 13.3652 14.0312 13.3652H23.2317C23.6543 13.3652 24 13.7006 24 14.1104C24 14.5202 23.6543 14.8555 23.2317 14.8555Z" fill="white"/>
<path d="M9.63265 14.8551C9.55582 14.8551 9.47899 14.8365 9.40216 14.8179C8.99879 14.7061 8.7683 14.2776 8.88355 13.8864C9.86314 10.8499 12.7059 8.80078 16.0096 8.80078C16.7587 8.80078 17.5078 8.91255 18.2185 9.11747C18.6218 9.24787 18.8523 9.6577 18.7179 10.0489C18.5834 10.4401 18.1609 10.6637 17.7575 10.5333C17.2005 10.3656 16.605 10.2724 16.0096 10.2724C13.3974 10.2724 11.1308 11.8931 10.3817 14.3149C10.2665 14.6502 9.95918 14.8551 9.63265 14.8551Z" fill="white"/>
<path d="M20.5618 12.0235C20.9861 12.0235 21.3301 11.6899 21.3301 11.2784C21.3301 10.8668 20.9861 10.5332 20.5618 10.5332C20.1375 10.5332 19.7935 10.8668 19.7935 11.2784C19.7935 11.6899 20.1375 12.0235 20.5618 12.0235Z" fill="white"/>
<path d="M11.4382 21.4864C11.8625 21.4864 12.2065 21.1528 12.2065 20.7412C12.2065 20.3297 11.8625 19.9961 11.4382 19.9961C11.0138 19.9961 10.6699 20.3297 10.6699 20.7412C10.6699 21.1528 11.0138 21.4864 11.4382 21.4864Z" fill="white"/>
</svg>
}
href="/integrations/usage/segment"

>

Segment is used to track and ingest events that can be sent to Lago as
usage.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="Hightouch"
icon={
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="32" height="32" rx="8" fill="#4FC26B"/>
<g clip-path="url(#clip0_4694_561)">
<path d="M23.7159 19.0013H12.9987V8.28307C12.9987 8.12656 13.1253 8 13.2818 8H23.7169C23.8734 8 24 8.12656 24 8.28307V18.7182C23.999 18.8747 23.8725 19.0013 23.7159 19.0013Z" fill="white"/>
<path d="M12.7157 24.0007H8.28307C8.12656 24.0007 8 23.8741 8 23.7176V19.285C8 19.1285 8.12656 19.002 8.28307 19.002H12.9987V23.7176C12.9987 23.8741 12.8722 24.0007 12.7157 24.0007Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_4694_561">
<rect width="16" height="16" fill="white" transform="translate(8 8)"/>
</clipPath>
</defs>
</svg>
}
href="/integrations/usage/hightouch"
>
Reverse-ETL helping you sync data from any sources (database, warehouses,
spreadsheet...) to Lago.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
</CardGroup>

Expand Down Expand Up @@ -606,6 +662,9 @@ description:
>
Use Zapier and Lago to trigger billing automations, such as an invoice
alerting system.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
<Card
title="N8N"
Expand All @@ -628,6 +687,9 @@ description:
>
Use n8n and Lago to trigger billing automations, such as an overconsumption
alerting system.

<br />
<Tooltip tip="This integration is maintained by Lago.">Official</Tooltip>
</Card>
</CardGroup>

Expand Down Expand Up @@ -657,6 +719,9 @@ description:
>
Send billing data to any warehouses by using our integration with Airbyte
ETL services.

<br />
<Tooltip tip="This integration is community-maintained, and therefore Lago provides only limited support.">Community</Tooltip>
</Card>
</CardGroup>

Expand Down Expand Up @@ -707,5 +772,7 @@ description:
href="/integrations/entitlements/osohq"
>
Oso is an Authorization as service used for entitlements

<Tooltip tip="This integration is community-maintained, and therefore Lago provides only limited support.">Community</Tooltip>
</Card>
</CardGroup>
</CardGroup>
87 changes: 87 additions & 0 deletions integrations/payments/cashfree-payments.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: "Cashfree Payments"
description: "Make your users pay Lago invoices with Cashfree Payments, India's leading payments and API banking company."
---


<Info>
This integration is community-maintained, and therefore Lago provides only limited support.
</Info>


## Payments in India
Cashfree is a leading payment platform in India, offering an end-to-end suite of payment and payout products tailored to the country's needs.
Its extensive coverage of payment methods—including credit/debit cards, net banking, UPI, and popular wallets like Paytm, PhonePe, and Amazon Pay—enables businesses to seamlessly collect payments from Indian customers with minimal friction.
This integration streamlines the collection of Lago invoices in India by leveraging multiple local payment methods.

## Connect Cashfree to Lago

To connect Cashfree to Lago, navigate to your Lago UI, then go to **Integrations** > **Built by community**, and add a new **Cashfree Payments** connection:

1. Click **Add a connection**.
2. Type a connection **name**.
3. Type a unique connection **code**.
4. Paste your Cashfree **Client ID**.
5. Paste your Cashfree **Client Secret**.
6. Provide the **redirect URL** to redirect your users when a payment is processed.

<Frame caption="Connect your Cashfree account from Lago UI">
<img src="/integrations/images/cashfree-payment-connection-flow.png" />
</Frame>

## Create a webhook endpoint
<Tip>
To complete this process, you will need:

- Your Lago **organization ID**, available in the **"API keys & ID"** tab of the
**"Developers"** section;
- The **connection code** you created during the Cashfree setup process.
</Tip>

If you want Lago to automatically retrieve the status of the payments processed
via Cashfree Payments, you must create a webhook endpoint in Cashfree. To do so:

1. Log in to your Cashfree Payments account;
2. Add the following Webhook URL in the **Webhooks** > **Payment Link** section of the Cashfree Payments dashboard;
3. Enter the following URL: `https://api.getlago.com/webhooks/cashfree/{{__YOUR_ORG_ID__}}?code={{__YOUR_CONNECTION_CODE}}` (you must replace `organization_id` with your Lago organization ID, and the `connection_code` by the targeted Lago connection); and
4. Save the creation of this webhook endpoint.

<Frame caption="Webhook endpoint creation in Cashfree Payments">
<img src="/integrations/images/cashfree-webhook-connection.png" />
</Frame>

## Collect payments via Cashfree

### Connect a Lago Customer to Cashfree
To begin collecting payments for your Lago invoices via Cashfree, you need to link a Lago customer to a Cashfree connection.
When creating or editing a customer in Lago, simply select the relevant Cashfree connection under **external apps** to enable invoice payments.

<Frame caption="Link Lago Customers to Cashfree Payments">
<img src="/integrations/images/cashfree-link-lago-customer.png" />
</Frame>

### Generate a checkout link
Note that payments through Cashfree does not automatically proceed when Lago generates an invoice. You need to programmatically generate a checkout link by calling the [following endpoint](/api-reference/invoices/payment-url):

```bash Request
curl --request POST \
--url https://api.getlago.com/api/v1/invoices/{lago_id}/payment_url \
--header 'Authorization: Bearer <token>'
```

By generating this checkout link, you can forward it to your customer to complete payment using their preferred method from India. Once the payment is processed, Lago automatically retrieves the invoice status from Cashfree.

```json Response
{
"invoice_payment_details": {
"lago_customer_id": "13b901a90-1a90-1a90-1a90-1a901a901a90",
"lago_invoice_id": "1e501a90-938s-1a90-1a90-1a901a901a80",
"external_customer_id": "53dj371e-4ea2-bcf9-57d3a41bc6ba",
"payment_provider": "cashfree",
"payment_url": "https://cashfree.payment_link"
}
}
```

### Cashfree payment errors
If an error occurs during the Cashfree payment process for a Lago invoice, Lago sends a [`payment_request.payment_failure`](https://docs.getlago.com/api-reference/webhooks/messages#param-payment-request-payment-failure) webhook containing the error details.
Loading

0 comments on commit ad78e39

Please sign in to comment.