ZezoPay Docs

Getting Started with ZezoPay

"Payment gateway into your application"

✍️ Naresh Dhamu

📅 02/03/2025

Getting Started with ZezoPay

Welcome to ZezoPay! This guide will walk you through the steps to set up ZezoPay, authenticate your API requests, and integrate the payment gateway into your application.

Step 1: Create an Account

First, sign up for a ZezoPay account on our website. After signing up, you will be able to generate your API Key to authenticate your requests.

Step 2: Store Your Provider's Secret

After obtaining your API Key, securely store your provider's secrets.

Example of Saving the Secret

ZezoPay Dashboard

Step 3: Generate API Key or Secret Key in ZezoPay

To generate your API Key or Secret Key for ZezoPay, follow these steps:

  1. Go to the ZezoPay API Keys Page.
  2. In the API Keys section, click on the Generate API Key or Generate Secret Key button to create your keys.
  3. Copy the generated key and securely store it.
  4. Save the secret by clicking the submit button.

Example of Saving the ZezoPay Secret

ZezoPay Secret Key

Step 4: Configure Razorpay Webhook

Webhook ek HTTP callback hai jo payment gateway (Razorpay) se real-time notifications receive karne ke liye use hota hai, jaise payment success, failure, refund, etc.

Steps to Add Razorpay Webhook:

  1. Login to Razorpay Dashboard:

  2. Navigate to Webhooks:

    • In the Razorpay Dashboard, click on Settings in the sidebar.
    • Under the API Keys section, click on Webhooks.
    • Click on the Add Webhook button.
  3. Set the Webhook URL:

    • In the Webhook URL field, enter the following URL for ZezoPay:
      https://payapi.zezo.in/api/v1/payments/verify/razorpay
      
      This is the URL where Razorpay will send the webhook notifications.
  4. Add Razorpay Webhook Secret Key:

    • Go to the ZezoPay Dashboard and log in.
    • Navigate to Settings > Payments.
    • Under the Razorpay Settings, find the Webhook Secret field.
    • Enter your Webhook Secret Key in this field and click Save.
  5. Select the Events to Subscribe:

    • Razorpay provides multiple events you can subscribe to, like payment.captured, payment.failed, payment.authorized, etc.
    • Choose the events based on the notifications you want to receive. Typically, you would subscribe to:
      • payment.captured: Payment successfully captured.
      • payment.failed: Payment failed.
      • refund.created: A refund has been initiated.
  6. Save Webhook:

    • After selecting the desired events, click Save to add the webhook.
  7. Verify Webhook Signature:

    • Razorpay will send a signature with each webhook notification for security.
    • You need to verify the signature to ensure that the request is from Razorpay. Use the Razorpay Webhook Secret Key to verify the signature.
    • To get the Webhook Secret, go to the Webhook Settings page in the Razorpay Dashboard and click Show Secret.
    • Add the following code snippet to verify the webhook signature:

Razorpay Webhook Setup

Step 5: Configure Stripe Webhook

Webhook ek HTTP callback hai jo payment gateway (Stripe) se real-time notifications receive karne ke liye use hota hai, jaise payment success, failure, refund, etc.

Steps to Add Stripe Webhook:

  1. Login to Stripe Dashboard:

  2. Navigate to Webhooks:

    • In the Stripe Dashboard, click on Developers in the left sidebar.
    • Under the Webhooks section, click on Add endpoint.
  3. Set the Webhook URL:

    • In the Endpoint URL field, enter the following URL for ZezoPay:
      https://payapi.zezo.in/api/v1/payments/verify/stripe
      
      This is the URL where Stripe will send the webhook notifications.
  4. Select Events to Subscribe:

    • Stripe provides multiple events you can subscribe to, such as payment_intent.succeeded, payment_intent.payment_failed, charge.refunded, etc.
    • Choose the events based on the notifications you want to receive. Typically, you would subscribe to:
      • payment_intent.succeeded: Payment successfully completed.
      • payment_intent.payment_failed: Payment failed.
      • charge.refunded: A charge has been refunded.
  5. Save Webhook:

    • After selecting the desired events, click Add endpoint to save the webhook.

Stripe Webhook Setup