Magento 2 Integration - Webhook Endpoint
Subscribe Pro sends webhooks to your Magento 2 instance in order to keep saved credit cards (payment profiles) in sync.
We do this because Magento 2 requires tokenized customer payment data to be stored in its database. Our M2 extension sends updates from Magento to Subscribe Pro. This webhook is needed to send updates the other way, from Subscribe Pro to Magento.
To set this, configure Subscribe Pro to point to the Webhook Endpoint which is hosted on your Magento 2 server.
Webhook Endpoint Configuration
To set up a webhook endpoint, navigate in the Subscribe Pro Merchant App to System > Webhook Endpoints.
-
Click New to create a new endpoint.
-
Note the Shared Secret and save it to be entered in the Magento admin later in the process.
-
On that page, enter the following into the URL box:
https://{yourdomain.com}/subscribepro/webhook
You will need to replace
{yourdomain.com}
with the correct base domain name for your Magento installation. This is most likely the same as the URL configured in System > Configuration > Store Connection Settings. -
Uncheck the "Subscribe To All Event Types" box, and then uncheck each of the boxes under Subscribe To Specific Event Types heading, except
payment_profile.created
,payment_profile.updated
, andpayment_profile.redacted
. -
Click Save. This will store the new record and return to you to the Webhook Endpoints list page.
-
You will need to click the "Enable" button under Actions.
-
Configure shared secret in Magento 2.
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 Webhook Secret Key. Paste in the shared secret key value obtained from the Subscribe Pro Merchant App Webhook Endpoint.
Finally, click Save Config.
-
You can use the "Ping" button under Actions to send a test request to the endpoint and make sure that it responds successfully.
-
You can also confirm that the endpoint is working successfully with organic requests as change are made to payment profiles in Subscribe Pro by going to System > Webhook Event Log and seeing that the rows show "Delivered".
If you have any questions or issues setting up the endpoint, please contact [email protected].