Revision fba387a4
Von Jan Büren vor fast 3 Jahren hinzugefügt
SL/ShopConnector/Shopware6.pm | ||
---|---|---|
661 | 661 |
$client->addHeader('Authorization' => 'Bearer ' . $token); |
662 | 662 |
return $client; |
663 | 663 |
} |
664 |
# ua multiple form-data |
|
665 |
sub init_ua { |
|
666 |
my ($self) = @_; |
|
667 |
|
|
668 |
my $section = 'bekuplast_elo'; |
|
669 |
my $config = $::lx_office_conf{$section} || {}; |
|
670 |
my $client; |
|
671 |
# mandatory config parameters |
|
672 |
foreach (qw(user pass apikey)) { |
|
673 |
die "parameter '$_' in section '$section' must be set in config file" if !defined $config->{$_}; |
|
674 |
} |
|
675 |
$client = REST::Client->new(host => $self->host); |
|
676 |
# no test case available in ELO API |
|
677 |
# and set ua we need this, because ELO wants multippart/form-data |
|
678 |
my $ua = $self->client->getUseragent(); |
|
679 |
|
|
680 |
$ua->default_header(Authorization => 'Basic ' . encode_base64($config->{user} . ':' . $config->{pass}), |
|
681 |
apikey => $config->{apikey}, |
|
682 |
'Content-Type' => 'multipart/form-data', |
|
683 |
); |
|
684 |
|
|
685 |
return $ua; |
|
686 |
} |
|
687 |
|
|
688 | 664 |
|
689 | 665 |
sub import_data_to_shop_order { |
690 | 666 |
my ($self, $import) = @_; |
Auch abrufbar als: Unified diff
Toten Code entfernt