Magento 2 Integration - Setup Payment Profile Webhook


Your Magento 2 installation must be setup to consume several webhooks from Subscribe Pro to keep payment profiles in sync.

The Subscribe Pro Magento 2 extension includes webhook handlers for the payment_profile.created, payment_profile.updated, and payment_profile.redacted webhooks. These trigger a request to Magento when a customer's payment profile has been created, updated, or redacted (deleted) from within the Subscribe Pro Merchant App, so that the changes can be reflected back to Magento.

Setup in Subscribe Pro

Step 1

To set up the webhook in Subscribe Pro, you will need to login to to the Subscribe Pro Merchant App, select the desired Environment, and go to System > Webhook Endpoints.

Webhook Endpoints Dropdown

Click on the New button on the bottom left side of the page.

New Webhook Endpoints Button

Step 2

In the Endpoint URL field, enter the URL of your Magento installation, and append /subscribepro/webhook onto the end of it.

Then, optionally un-check the Subscribe To All Event Types box.

Ensure that the payment_profile.created, payment_profile.updated, and payment_profile.redacted event types remain selected.

Create a new Webhook Endpoint

Finally, click the Save button.

Step 3

For your newly created endpoint integration, click on the Enable action button on the right side of the table.

Enable Your New Webhook Endpoint

Advanced Setup in Magento 2 (Optional)

The webhook feature in the Magento 2 extension allows you to specify IP Addresses from which the webhook request must originate or else it will be blocked. By default, this is unnecessary and you can skip this step because the Subscribe Pro server IPs come pre-filled into the extension. However, if you require a webhook request to be sent from another server, or if the Subscribe Pro API IP addresses ever need to be changed, there is a setting for the extension that allows you to specify those IP addresses.

Restrict IP Addresses

Sign into Magento, and go to Stores > Configuration. Be sure to select your preferred configuration scope. Expand the Swarming section, and click on Subscribe Pro.

Expand the Advanced section and un-check the Use Default checkbox next to Allowed Webhook IP Address. That field will become editable. In that field, append or replace the existing list of IP addresses with the correct IP addresses that need to have webhook access to your server. Each IP address must be separated by a single comma, with no comma at the end.

Finally, click Save Config.