Overview
The EdfaPay Embedded Integration S2S (Server-to-Server) provides a robust solution for merchants to securely capture payment details directly within their customized checkout environments. This method facilitates the secure transmission of sensitive payment data from your backend server straight to EdfaPay's API.
This integration grants unparalleled control over the user experience while upholding stringent security standards through server-side hash authentication and strict PCI-compliant data handling protocols.
Integration Workflow
This section outlines the step-by-step process for integrating EdfaPay's Embedded S2S solution.
1. Collect Payment Data
Securely gather essential card and customer details via your custom checkout form.
2. Submit Transaction Request
Your backend server sends a secure SALE request to the EdfaPay S2S endpoint (https://app-api.edfapay.com/api/v1/payment-gateway/s2s/sale). This POST request must include all necessary transaction parameters, such as card details, order amount, currency, and a cryptographically generated hash.
3. Handle 3D Secure (Conditional)
If 3D Secure authentication is required, EdfaPay will return an html response. Your application (web or mobile) must render this HTML content within a WebView or an iframe to display the 3DS authentication challenge to the customer.
4. Receive Transaction Outcome
Upon successful authentication, EdfaPay redirects the user back to your designated successUrl and simultaneously dispatches a webhook notification containing the definitive transaction status.
Embedded Integration
Complete reference for the Embedded integration API endpoints and operations
- Embedded Card Payment SALE: Process secure card payments directly within your custom checkout environment using a
POSTrequest. - Captures: Finalize authorized payments by capturing the pre-approved funds using a
POSTrequest. - Credit Void: Cancel an authorized payment before it is captured by sending a
POSTrequest. - Refund: Reverse the amount of a successfully captured transaction using a
POSTrequest. - Recurring Payments: Charge customers on a recurring basis using a stored token with a
POSTrequest.
Core Advantages
- Complete Checkout Control: Maintain full autonomy over your customer's checkout journey, eliminating external redirects.
- Seamless Integration: Achieve a clean, cohesive, and effortless integration with your existing web or mobile platforms.
- Enhanced Security: Card data is processed with utmost security via S2S communication, reinforced by robust hash verification to guarantee data integrity and authenticity.
- Flexible Payment Operations: Supports a diverse range of payment functionalities, including secure tokenization, recurring payment profiles, and authorization-capture workflows.
Essential Integration Components
- Request Method: All requests must be POST requests, formatted as
application/json. - Mandatory Fields: Each request must precisely include fields such as
orderId,amount,currencycomprehensive card data, payer information, and a unique transactionhash. - 3D Secure Implementation: Should 3DS be triggered, your application is responsible for presenting EdfaPay's authentication page within an iframe or a WebView.
Important Note on Hash GenerationA cryptographically secure hash must be generated for every transaction request. This hash is formulated using your unique secret API key, the payer's email address, and the masked card PAN, which collectively ensures the authenticity and integrity of the request, safeguarding against unauthorized alterations.
Security & Validation AdvisoryAll card information must be collected securely within your frontend and subsequently transmitted exclusively to your backend server. It is paramount that this sensitive data is never submitted directly from the frontend to EdfaPay.
Webhooks for Transaction Status:
- Webhooks are an indispensable component for this integration.
- Your backend system must be diligently configured to receive and process payment status updates dispatched from EdfaPay. These webhooks serve as critical notifications for the final transaction status (e.g., successful, declined, refunded).
- Testing Tip: During staging and development phases, leverage tools suchs as Webhook.site to effectively simulate and inspect the behavior of incoming callbacks.