Drupal Module
Drupal module with configurable API client and reusable services.
Overview
Module settings keep API credentials and expose service methods to request GEO/IP profile for current visitor or custom IP addresses.
Setup Guide
- Download module ZIP.
- Install module in Drupal.
- Configure API URL and key in settings form.
- Use service calls in custom code.
Implementation Notes
- Install and activate the package in your CMS.
- Set API endpoint and API key in module settings.
- Validate client IP detection and User-Agent forwarding.
- Call lookup before auth/checkout/risk decisions.
- Add fallback handling for timeout/429/5xx responses.
Recommended flow: GEO/IP context first, business rules second.
Minimum CMS Version
Drupal 9.4+ / 10.x (PHP 8.1+)
README: implementation details
Drupal module quick flow:
1) Copy portcore_geoip -> web/modules/custom/
2) Enable module: drush en portcore_geoip
3) Configure /admin/config/services/portcore-geoip
Lookup:
$geo = portcore_geoip_lookup('2001:bc8:1da0:1e:da5e:d3ff:fe6f:dc87');
Optional context:
$geo = portcore_geoip_lookup('8.8.8.8', ['user_id' => 'crm_501', 'user_agent' => 'Custom-UA/1.0']);
Summary array:
$summary = portcore_geoip_summary_array($geo, FALSE);