sequra_create_order_request_{address}_options

Hook Filter

Filter the address options.

Description

This filter allows modifying both the invoice_address and delivery_address inside options which is used to build the payload for the Order API calls.

ParameterTypeDescription
$addressSeQura\Core\BusinessLogic\Domain\Order\Models\OrderRequest\AddressAddress instance

Changelog

VersionDescription
3.0.0Introduced

Usage Example

This filter has two variants:

For the delivery address use sequra_create_order_request_delivery_address_options.

add_filter('sequra_create_order_request_delivery_address_options', function($address){
  return new \SeQura\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Address(
    $address->getCompany(), // Your custom value here.
    $address->getAddressLine1(), // Your custom value here.
    $address->getAddressLine2(), // Your custom value here.
    $address->getPostalCode(), // Your custom value here.
    $address->getCity(), // Your custom value here.
    $address->getCountryCode(), // Your custom value here.
    $address->getGivenNames(), // Your custom value here.
    $address->getSurnames(), // Your custom value here.
    $address->getPhone(), // Your custom value here.
    $address->getMobilePhone(), // Your custom value here.
    $address->getState(), // Your custom value here.
    $address->getExtra(), // Your custom value here.
    $address->getVatNumber(), // Your custom value here.
  );
});

For the invoice address use sequra_create_order_request_invoice_address_options.

add_filter('sequra_create_order_request_invoice_address_options', function($address){
  return new \SeQura\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Address(
    $address->getCompany(), // Your custom value here.
    $address->getAddressLine1(), // Your custom value here.
    $address->getAddressLine2(), // Your custom value here.
    $address->getPostalCode(), // Your custom value here.
    $address->getCity(), // Your custom value here.
    $address->getCountryCode(), // Your custom value here.
    $address->getGivenNames(), // Your custom value here.
    $address->getSurnames(), // Your custom value here.
    $address->getPhone(), // Your custom value here.
    $address->getMobilePhone(), // Your custom value here.
    $address->getState(), // Your custom value here.
    $address->getExtra(), // Your custom value here.
    $address->getVatNumber(), // Your custom value here.
  );
});