Callback & Notifications
Overview
Once the order has been placed and payment has been confirmed, you will be notified by ifthenpay via the usual channels, i.e. by push notification, if you have our app installed and have this option activated, by email, or you can check directly in our backoffice.
If you wish to be notified by callback, you must first ask ifthenpay to activate your callback (webhook).
In simpler terms: The callback URL is like a template. When a payment happens, the template is filled in with real information about that payment, and then the information is sent to your website.
ifthenpay offers free technical support to all customers through the following channels:
« go to index
Explanation
The following is an explanation of what a callback is and its purpose.
URL Breakdown:
- http://www.yoursite.com/callback.php: This is the basic address of a PHP script on your website. It's where the information from the payment gateway will be sent.
- ?key=[ANTI_PHISHING_KEY]&orderId=[ORDER_ID]&amount=[AMOUNT]&requestId=[REQUEST_ID]&payment_datetime=[PAYMENT_DATETIME]: This part is called a query string. It contains key-value pairs that provide additional information.
The Square Brackets []:
- The parts within the square brackets are placeholders. They will be replaced with actual values when the payment is processed.
- For example, [ANTI_PHISHING_KEY] will be replaced with a unique security key to prevent fraudulent transactions.
- [ORDER_ID] will be replaced with the specific order number.
- [AMOUNT] will be replaced with the total amount of the purchase.
- And so on.
What Happens During a Callback:
- Customer Completes Purchase: When a customer finishes buying something on your website, the payment gateway processes the transaction.
- Gateway Sends Request: The payment gateway sends a request to the URL you provided.
- Placeholders are Replaced: The gateway replaces the placeholders in the URL with the specific details of the transaction.
- Your Server Receives Data: Your server receives the request and processes the data, updating your database, sending emails, or performing other actions.
Why use a callback URL?
- Automation: It allows you to automate processes like updating order status or sending receipts.
- Security: The [ANTI_PHISHING_KEY] helps prevent fraudulent transactions.
- Flexibility: You can customize the information you receive for each transaction.
Common Use Cases:
- E-commerce: Updating order status, sending shipping notifications.
- Subscriptions: Managing recurring payments and cancellations.
- Donations: Processing donations and issuing receipts.
Multibanco
The description of the replacements is as follows:
- [ANTI_PHISHING_KEY]: Will be replaced with the anti-phishing key that validates the authenticity of the transaction.
- [ORDER_ID]: Will be replaced with the unique order ID associated with the transaction.
- [AMOUNT]: Will be replaced with the total amount of the transaction.
- [REQUEST_ID]: Will be replaced with the request ID that initiated the payment.
- [ENTITY]: Will be replaced with the multibanco entity that was used to process the payment.
- [REFERENCE]: Will be replaced with the multibanco that was used to process the payment.
- [PAYMENT_DATETIME]: Will be replaced with the date and time when the payment was made.
MB WAY
The description of the replacements is as follows:
- [ANTI_PHISHING_KEY]: Will be replaced with the anti-phishing key that validates the authenticity of the transaction.
- [ORDER_ID]: Will be replaced with the unique order ID associated with the transaction.
- [AMOUNT]: Will be replaced with the total amount of the transaction.
- [REQUEST_ID]: Will be replaced with the request ID that initiated the payment.
- [PAYMENT_DATETIME]: Will be replaced with the date and time when the payment was made.
Payshop
The description of the replacements is as follows:
- [ANTI_PHISHING_KEY]: Will be replaced with the anti-phishing key that validates the authenticity of the transaction.
- [ORDER_ID]: Will be replaced with the unique order ID associated with the transaction.
- [AMOUNT]: Will be replaced with the total amount of the transaction.
- [REFERENCE]: Will be replaced with the multibanco that was used to process the payment.
- [PAYMENT_DATETIME]: Will be replaced with the date and time when the payment was made.
PAY BY LINK & PINPAY
The description of the replacements is as follows:
- [ANTI_PHISHING_KEY]: Will be replaced with the anti-phishing key that validates the authenticity of the transaction.
- [ID]: Will be replaced with the order ID associated with the transaction.
- [AMOUNT]: Will be replaced with the total amount of the transaction.
- [PAYMENT_METHOD]: Will be replaced with the payment method that was used to process the payment.
- [PAYMENT_DATETIME]: Will be replaced with the date and time when the payment was made.