Using Webhooks with Qualpay Plugin for WooCommerce

Use Qualpay’s webhooks to keep your WooCommerce orders up-to-date with the latest transaction statuses. You will need to retrieve your webhook secret from the Qualpay Manager and paste it into your WooCommerce plugin configuration page for the Qualpay plugin.

To add webhooks to either your sandbox or production Qualpay account:

  1. Go to the WooCommerce Plugins page, and click Settings under the Qualpay plugin. A unique webhook notification URL will be generated and displayed. Copy this URL for use in step six.
  2. Log into the Qualpay Manager, in either sandbox or production, depending on the environment you are configuring. You will need to retrieve a unique secret key for use with either environment.  
  3. Go to Administration, and then click Webhook Configuration.
  4. Click the green + sign to add a new webhook.
  5. Add a Label of your choosing. 
  6. Paste the Notification URL copied from the admin control panel into the Notification URL field. 
  7. Add the email address into the Email field that is to receive notification from Qualpay if an issue sending notifications to the provided Notification URL arises. 
  8. Add the Authentication Type to secure the webhook POST request to your server. To do so, select HTTP Basic Authentication. If you do not want to secure the webhook POST request, select None from the drop-down.
  9. Click Create Webhook.
  10. Now you can subscribe to specific webhooks events. Make sure you enable the following webhook events:
  • Transaction_status_updated, this webhook will keep the order status up-to-date with information on settled transactions from Qualpay. 
  • Qp_manager_void_success, If you void a transaction in Qualpay Manager, your WooCommerce order status will change to Void.
  • Qp_manager_refund_success, If you refund a transaction in Qualpay Manager, your WooCommerce order status will change to Refunded or Partial Refund. 
  • Qp_manager_capture_success, If you capture a transaction in Qualpay Manager, your WooCommerce order status will change to Captured.
  • If you are processing recurring payments, enable the Subscription_payment_success webhook, this webhook indicates that the recurring charge to the cardholder was successful, and your WooCommerce order status will change to Captured.

11. To enable the webhooks, click the toggle. Once enabled, the toggle option will show in green. If disabled, the toggle will show in white.
12. Click Done.
13. A popup with a New Webhook Secret key will appear. Copy the key by clicking on the copy icon.
14. Click Close.
15. Go to your WooCommerce Qualpay settings page in the plugin settings page, and paste the key in the Webhook Secret field.
16. Click Save Changes.

Testing Webhooks
Now that you have added webhooks to your Qualpay account, you can test the webhook event:

  1. Process an order from the web store.
  2. Log in to your sandbox or production Qualpay account (depending on which environment you are testing). 
  3. Click Transactions
  4. Locate the processed transaction. 
  5. Issue a Void, Refund, or Capture this transaction by clicking on the Transaction Detail, then click one of the Action buttons on the right.

Once the transaction is voided, refunded, or captured, verify that the order status has been updated in WooCommerce:

  1. Log in to your WordPress admin dashboard.
  2. Click Orders
  3. Locate the updated order in the Qualpay Manager
  4. Compare and verify that the status has been updated on the WooCommerce Orders page. 

Note: Once any transaction is voided, refunded, or captured from the Qualpay Manager, it may take 5 minutes for the order status to be updated in WooCommerce. 

Click here for information on reconciling WooCommerce Orders and Qualpay transactions.