Artikel über: Directories

How to create a custom payment provider integration for my coupon directory?

We offer an integration with Stripe and PayPal. In some situations you want to develop your own payment integration.
In this article we explain you how to setup it.


Step 1: Your directory needs to have "REGISTRATION" enabled.





Go to "registration" and enable "require user registration".
A payment is always linked to a user profile so registration is needed prior to purchasing.


Step 2: Enable payments for your directory





You can find it in the "advanced Settings" -> Payment tab.
Select "Custom" as a payment method and enter the URL to your custom payment page.
You do not need to enter any other settings like currency and amount on the payment page because you will have to developer your own payment page.



If you do not see the "Custom" feature please contact support. We can activate this in your account.


Step 3: Consumer view





The consumer will see a "Buy now" button after registration.
This will redirect him to the URL you have setup + additional parameters:

Example: https://yourwebsite.com/domains/?code=ZgbCVHMak3njLWKFXQj6x&dir=dir_123456&client=reg_12345

Code= the unique code from your directory
Dir= ID from the directory
Client= ID from the user

You are now able to display a payment page to the user.


Step 4: API call after succesful payment.





After a succesful payment you'll need to update the status for that user through the API.
We have an API endpoint to handle that.

after successful payment you make an API call


API endpoint:
https://www.coupontools.com/en/api-and-webhooks&action=update_user_payment_status
You have to set here the status and expiry date.
If you made a recurring payment solution you have to update the expiry date after each payment.

You can redirect back to the coupon directory after purchase and API update:

The redirect URL looks like: https://couponapp.directory/index.php?dir=CODE
Replace CODE with the code (ZgbCVHMak3njLWKFXQj6x) we have passed to your URL as you can see in the example above.

Aktualisiert am: 27/01/2022

War dieser Beitrag hilfreich?

Teilen Sie Ihr Feedback mit

Stornieren

Danke!