Skip to main content

SaaS Companies

Lunar was built with the primary goal of making accepting payments with cryptocurrency as easy as possible. Due to this, integrating lunar into your SaaS product is as simple as copy pasting a few lines of code. Here are the steps to follow to integrate Lunar into your product:

Step 1:

Go to lunarpay.in, authenticate using Metamask,once you've authorized into the lunar dashboard, head to the product section and create a product. The following modal with popup. Set the recurrence according to how often you want to bill your clients.

alt text

Step 2:

In your application, create a new link in your checkout page, which redirects to [app.lunarpay.in/{product_id}/{user_email}]. You could choose to dynamically render the product_id of the product and the user_email of your customers.

Step 3:

In your application, create a new webhook endpoint with the following syntax:

@app.route('/lunar_webhooks', methods=['POST'])
def webhook():
lunar_payload = request.json
user_email = lunar_payload.email
lunar_customer_id = lunar_payload.Customer_id
if(lunar_payload.status=='Success'):
// Handle
if(lunar_payload.status=='Failed'):
// Handle

Step 4:

Setup your callback and Webhook URL on the Lunar Dashboard. This is extrememly essential.

Step 5:

Setup the logic for handling Callback URLs, which have the same payload as webhook, and you are done integrating Lunar!

Now you will be able to keep track of all the transactions from the webhooks and the transaction page on your Lunar Dashboard.