• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

Integration of Custom Payment Gateway

  • Thread starter Deleted member 12173
  • Start date
Status
Not open for further replies.

What is Custom payment gateway?

A custom payment gateway is a tailor-made, specialized, and often proprietary payment processing solution created by a business or organization to handle financial transactions. Unlike off-the-shelf or third-party payment gateways, a custom payment gateway is designed and developed to meet the specific needs, requirements, and branding of the business that uses it.

1694511897283.png



Here as you click on the 'connect now' button the below page will be displayed where you can enter the details and connect the custom payment gateway.
  • Gateway Name
  • Custom
  • Enter Gateway Name
  • Gateway URL
To add the Custom Payment Gateway, please check our documentation - https://www.pabbly.com/subscriptions/docs/custom-payment-gateway/

1694521263417.png



Please follow the below steps to integrate the custom payment gateway integration:
  1. This file will be hosted on your server for handling the payments through your own custom payment gateway.
  2. When your customer submits the checkout page, the process will be redirected to your gateway URL along with the checkout(hosted) page query string.
  3. You can then run the “Verify Hosted Page API” by passing the value of the query string from the previous step to get all the check-out page data on your custom payment gateway integration page.
    Refer: https://www.pabbly.com/subscriptions/api/#section-31
  4. The pre-payment data includes all the essential fields to do your own processing through your gateway. It includes fields details below.
    1. Customers Name
    2. Customer Email
    3. Customer ID
    4. Product Name
    5. Product Price
    6. Invoice ID
  5. If you need any further customer data apart from what is provided through the “Hosted Page API”, you can also get further customer data by calling the “Get Single Customer” API. This API will fetch you data for billing address, country state, etc.
    Refer: https://www.pabbly.com/subscriptions/api/#section-3
  6. You can then use the details fetched in the steps 6 and 7 above and process the payment through your custom payment gateway integration.
  7. After completion of your payment through your payment gateway, you will be notified about the payment success through your gateway.
  8. Once the payment processing is successful, you need to update the details of the customers and record the payment for that customer in Pabbly Subscriptions.
  9. Details that need to be updated are below.
    1. Invoice: Record the payment data for the subscription to update the invoice.
    2. Payment Mode: You can add your own payment mode name. For example – Authorize.net or PayPro
    3. Transaction Data: You can store any transaction data returned from your payment gateway within Pabbly Subscriptions.
    4. Payment Note: Add your own custom payment note for the payment.
  10. Once the payment is updated, you can redirect the customer to the Pabbly Subscriptions thank you page by using the data provided by the “Record Payment API”.
  11. If required you can also redirect the customers to your own custom thank you page based on the details provided by the “Record Payment API”.
  12. Sample code for your reference is included below.
    https://github.com/MagnetBrains/pab...eway/blob/master/checkout-with-hostedpage.php
  13. We have also integrated a custom payment gateway “RazorPay” by following the steps explained above. You can checkout the integration through the link below. https://github.com/MagnetBrains/pabbly-subscription-razorpay-php

From Customers end. Here is how the payment workflow happens.

  1. Customer will fill the checkout form.
  2. Customer will choose your custom payment gateway to do the payment.
  3. They will be redirected to your payment gateway integration page.
  4. They will do the payment successfully.
  5. They will be redirected back to the thank you page.
  6. At the time of recurring billing, a payable invoice will be automatically sent to your customer and they will complete the payment from their end.

2. Integration through API –​

The second way to integrate a custom payment gateway is through the Pabbly Subscriptions API. The integration with API is fairly straightforward.

To add your own custom payment gateway integration and do perform the payment through your custom gateway via API, here is how the payment workflow takes place.

From Merchant (Sellers) end –

  1. Whenever you create a product and plan within Pabbly Subscription. You get the plan ID for each created plan.
  2. Plan ID can be fetched through your Pabbly Subscriptions account or it can also be fetched by running the “List All Products” and “List All Plans” or “List All Plans by Product Id” API.
    Refer:
    List All Products: https://www.pabbly.com/subscriptions/api/#section-14https://www.pabbly.com/subscriptions/api/#section12
    List All Plans: https://www.pabbly.com/subscriptions/api/#section-18
  3. Once the details are fetched, you can then run the “Create Customer with Subscription” API to create the subscription for the customer. This API requires all the customer details including the plan id for which you want to subscribe to the customer. The initial subscription is created with “Pending” status.
    Refer: https://www.pabbly.com/subscriptions/api/#section-2
  4. You can then capture the API response from the “Create Customer with Subscription” API and fetch data of the entire User, Customer, Product, Plan, Invoice Object.
  5. You can then use the details fetched in the step above and process the payment through your custom payment gateway integration.
  6. After completion of your payment through your payment gateway, you will be notified about the payment success through your gateway.
  7. Once the payment processing is successful, you need to update the details of the customers and record the payment for that customer in Pabbly Subscriptions.
  8. Details that need to be updated are below.
    1. Invoice: Record the payment data for the subscription to update the invoice.
    2. Payment Mode: You can add your own payment mode name. For example Authorize.net or PayPro
    3. Transaction Data: You can store any transaction data returned from your payment gateway within Pabbly Subscriptions.
    4. Payment Note: Add your own custom payment note for the payment.
  9. Once the payment is updated, you can redirect the customer to the Pabbly Subscriptions thank you page by using the data provided by the “Record Payment API”.
  10. If required you can also redirect the customers to your own custom thank you page based on the details provided by the “Record Payment API”.
  11. Sample code for your reference is included below.
    https://github.com/MagnetBrains/pabbly-subscription-custom-gateway/blob/master/checkout-with-api.php

 
Status
Not open for further replies.
Top