Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dpd Info Services Bundle Laravel Package

rafalli/dpd-info-services-bundle

Symfony bundle for integrating DPD Info Services into PHP applications. It wraps DPD API access for retrieving parcel and shipping information, with configurable service setup to help add DPD delivery data to your app.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install via Composer: composer require <vendor>/<package> (check Packagist for exact name).
  • Ensure PHP 8.1+ and the SOAP extension are enabled (ext-soap).
  • Look first at the package’s README and composer.json for framework integration details. Since it supports Symfony 6.4–8.0, it may be framework‑agnostic; Laravel users should check for an auto‑discovered service provider or facade.
  • Publish any config file (e.g. php artisan vendor:publish) and set DPD InfoServices credentials (username, password, customer number, sandbox/production endpoint).
  • First use case: track a parcel by calling the tracking service with a parcel number, or retrieve the estimated delivery date for a shipment. Start with a simple tinker session or a one‑off artisan command to validate credentials.

Implementation Patterns

  • Inject the package’s main service class into controllers, jobs, or console commands rather than instantiating it directly. This keeps configuration and HTTP/SOAP client reuse consistent.
  • Wrap tracking calls in a queued job when processing many parcels (e.g. nightly sync). Use Laravel’s retry and backoff to handle transient SOAP faults.
  • Cache delivery‑date results for a short period (e.g. 15–60 minutes) because the API may be rate‑limited and the data rarely changes intraday.
  • Validate tracking numbers before calling the API (length, format, allowed characters) to avoid unnecessary SOAP requests and improve error messages.
  • For multi‑tenant apps, resolve credentials per tenant via a service container binding or a factory that creates a configured client instance.
  • Integrate with Laravel’s event system: dispatch a ParcelTracked event after a successful call, then update local shipment records or notify customers.
  • In tests, use Laravel’s Http::fake() only if the package uses Laravel’s HTTP client; for SOAP, look for a provided fake/mock client or inject a stub implementing the same interface.

Gotchas and Tips

  • SOAP WSDL caching can cause stale endpoint or type definitions after package upgrades. Disable WSDL cache in development (ini_set('soap.wsdl_cache_enabled', '0')) and clear it in production if you see unexpected type errors.
  • DPD’s SOAP faults often include detailed error codes in the fault string. Catch \SoapFault and log the full fault, not just the message, to debug authentication or validation issues.
  • Credentials and endpoints differ between sandbox and production. Use environment variables and never commit them; consider a dedicated config file with env() fallbacks.
  • Set explicit SOAP client timeouts (connection and response) to avoid hanging requests. Laravel’s default HTTP timeout does not apply to native SOAP calls.
  • The delivery‑date utility may return dates in a specific timezone or format. Normalise to your app’s timezone and use Carbon for consistency.
  • If the package does not provide a Laravel service provider, register a singleton binding in AppServiceProvider that configures the client from config/services.php.
  • Extension points: many SOAP packages allow you to pass a custom SoapClient or options array. Use this to add logging (via a SoapClient wrapper) or to adjust SSL verification in local testing.
  • Check the package’s issue tracker for DPD API changes—SOAP services are legacy and occasionally change without notice. Pin the major version in composer.json and review changelogs before upgrading.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core