Enrollment Notification
About this guide
This guide shows you how to work with enrollment notification. Due to the nature of some payment methods, a previous ennrollment is needed, specially for recurrent payments. We'll guide you through the steps to handle this type of calls.
How it works
Verify the notification signature
When an enrollment status is changed to accepted or revoked, EBANX sends a notification to the merchant system through the Notification URL that should be set in the Dashboard (It's the same URL for payments notification). For more details on setting your notification URL, you can refer to the Settings Tab on your EBANX Dashboard.
The available certificates and their fingerprints are shown on the table below:
Fingerprint Certificate 4ABAD89CF66B99998465470550EB15E3E271A246 Download EBANX will send the following headers in the notification request:
Parameter Description X-SignatureType
The signing algorithm. EBANX will always use RSA/SHA1. X-SignatureFingerprint
The signature fingerprint. It indicates which certificate was used to sign the notification. X-SignatureContent
The signed payload, encoded as a Base64 string. X-SignatureType: rsa,sha1X-SignatureFingerprint: 4ABAD89CF66B99998465470550EB15E3E271A246X-SignatureContent: xh5hstzZt5Rf5ihNzbfFfkmN89askd...DrHJAnzHgaf2vzA==The signature can be validated in PHP as follows:
Request Example
$cert = file_get_contents('ebanx-notifications-public.pem');$data = file_get_contents("php://input");$signature = base64_decode($_SERVER['HTTP_X_SIGNATURE_CONTENT']);// http://php.net/manual/en/function.openssl-verify.php$result = openssl_verify($data, $signature, $cert);if ($result === 1){echo "OK, signature is correct.";}else{echo "ERROR, the signature is incorrect.";}Get the enrollment code from the notification
The notification will contain the following parameters:
Parameter Description operation
The value is always enrollment_status_change.. notification_type
Event that triggered the notification. For now the value is always update. merchant_enrollment_code
Unique identifier associated with the recurrency. Here's a sample of a notification:
operation=enrollment_status_change¬ification_type=update&merchant_enrollment_code=test-enrollment-123Send an Enrollment Query
To check the latest status of an enrollment, you need to call the end-point /ws/userenrollments/query (from your server) using the merchant_enrollment_code received in the notification:
Environment Method URL Production https://ebanxpay.com/ws/userenrollments/query Sandbox https://sandbox.ebanxpay.com/ws/userenrollments/query Request
Request Fields
Parameter Accepted Values Required integration_key
Merchant Integration Key (Ex: testabc123) Yes payment_type_code
Payment method (Ex: mpconnect) Yes enrollment.merchant_enrollment_code
Unique identifier associated with the recurrency (Ex: test-enrollment-123) Yes enrollment.country
Two Letters Country Code (Ex: ar for Argentina Country Code) Yes Request Example
{"integration_key": "testabc123","operation": "enrollment","payment_type_code": "mpconnect","enrollment": {"merchant_enrollment_code": "test-enrollment-123","country": "br"}}Response
{"status": "SUCCESS","enrollment": {"status": "revoked"}Let EBANX know you received our response
Reply the notification with an
HTTP 200
status. We suggest to print any message showing that you got the notification, indicating that the notification was successful.
Getting help
We hope this article was enlightening, but in case we’ve failed to take out your doubts you have the following options to keep on seeking for answers:
- If you’re not our partner yet and would like to know more about our prices and conditions please fill our this form and our commercial team will get in touch with you.
- In case you’re already our partner please get in touch with our support team at integration@ebanx.com.