- my $edifact = Koha::Edifact::Order->new(
- {
- orderlines => \@orderlines,
- vendor => $vendor,
- ean => $ean_obj,
- is_response => $response,
- }
- );
- if ( !$edifact ) {
- return;
+ my $edifact_order_params = {
+ orderlines => \@orderlines,
+ vendor => $vendor,
+ ean => $ean_obj,
+ is_response => $response,
+ };
+
+ my $edifact;
+ if ( $vendor->plugin ) {
+ $edifact = Koha::Plugins::Handler->run(
+ {
+ class => $vendor->plugin,
+ method => 'edifact_order',
+ params => {
+ params => $edifact_order_params,
+ }
+ }
+ );
+ }
+ else {
+ $edifact = Koha::Edifact::Order->new($edifact_order_params);