Pro sites payment Gateway integration.

I am developing a payment gateway(Quickpay) for your plugin "Pro sites". Unfortunately, Quickpay is not supporting auto recurring at their end so we have to maintain recurrence at our end. Can you please suggest how can I achieve this?

  • Panos

    Hey there Hazem Tasmem ,

    It seems that you have managed the payment part with your gateway, but just to be sure here's a general description:

    In your payment method I suppose there is a way to pass a webhook or return url. You'd want this t be for example:
    http://yoursite.com/wp-admin/admin-ajax.php?action=psts_quickpay_webhook

    So now you can use the psts_quickpay_webhook ajax hook:

    add_action( 'wp_ajax_nopriv_psts_quickpay_webhook', 'your_webhook_handler_function' );
    add_action( 'wp_ajax_psts_quickpay_webhook', 'your_webhook_handler_function' );

    to confirm payments or cancellations and do what you need there.

    Depending on the gateway, you can either pass your custom params or the gateway would return a unique transaction key which you can store.

    Either way you'll probably need a custom table (eg PREFIX_quickpay_transactions ) where you store this information. Ideally you should have the blog id stored, the level id and the expiration date. If your gateway sends the transaction or some unique identifier store that too.

    Since your gateway does not support subscriptions with recurring payments, you can create a wp scheduled event ( wp_schedule_event() ) which should run daily or twicedaily which should check for expired dates in the PREFIX_quickpay_transactions table.

    This way you should be able to add a notification to site admin, or send an email or cancel level.

    Hope this helps :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.