Subscription - wrunivapay/UnivaPay-for-EC-CUBE4 GitHub Wiki

This page guides you through setting up and managing subscription payments with Univapay in your EC-CUBE 4 plugin.


1. Univapay Console Setup

  • Webhook URL:
    Register the following URL as the webhook endpoint in your Univapay console:

    https://ecsite.xxx/univapay/hook
    

    Univapay will send subscription-related events to this endpoint.

  • Webhook Triggers:
    Enable these triggers for your webhook:

    • Subscription Payment (triggered on successful recurring payments)
    • Subscription Failure (triggered on failed recurring payments)
  • Webhook Authorization Header:
    For security, set an Authorization header in the Univapay plugin configuration. This ensures that only Univapay can access your EC site’s webhook endpoint.


2. Product Subscription Settings

  • Set the subscription schedule for your products in the EC-CUBE admin panel.

3. Cart Behavior

  • The cart supports only one subscription product per transaction.
  • If you add a subscription product to the cart, you cannot add other products (including other subscription products or one-time purchase items) in the same checkout.
  • For one-time payments, multiple products can be added to the cart as usual.

4. Subscription Payment


5. Important Notes

  • Webhook Response Time:
    Your webhook endpoint must respond within 3 seconds.
    If it takes longer, Univapay will retry the webhook event automatically.