Skip to content

Commit

Permalink
Fix new API usage, and change to new UAT API
Browse files Browse the repository at this point in the history
  • Loading branch information
ekkeguembel committed Dec 21, 2023
1 parent 5f26380 commit cd46dec
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
return [
'name' => 'Print Mailing DPAG Integration by Leuchtfeuer',
'description' => 'Send postcards or letters via Print Mailing',
'version' => '5.0.0',
'version' => '5.1.0',
'author' => 'Leuchtfeuer Digital Marketing GmbH',

'menu' => [
Expand Down
2 changes: 1 addition & 1 deletion Helper/AudienceHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class AudienceHelper
{
private const AUDIENCE = 'https://api-eu.dhl.com/post/advertising/print-mailing';

private const TEST_AUDIENCE = 'https://api-uat.dhl.com/post/advertising/print-mailing';
private const TEST_AUDIENCE = 'https://api-uat-vzen.dhl.com/post/advertising/print-mailing';

private const FRONTEND = 'https://print-mailing.deutschepost.de';

Expand Down
28 changes: 14 additions & 14 deletions Service/PrintmailingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function createCampaign(TriggerCampaign $triggerCampaign): TriggerCampaig
{
$response = $this->client->request(
'POST',
'/automation/longtermcampaigns',
'/post/advertising/print-mailing/automation/v1/longtermcampaigns',
[
RequestOptions::JSON => $this->transformTriggerCampaign($triggerCampaign),
RequestOptions::HEADERS => [
Expand All @@ -113,7 +113,7 @@ public function getCampaign(TriggerCampaign $triggerCampaign): array
{
$response = $this->client->request(
'GET',
sprintf('/automation/longtermcampaigns/%d', $triggerCampaign->getTriggerId()),
sprintf('/post/advertising/print-mailing/automation/v1/longtermcampaigns/%d', $triggerCampaign->getTriggerId()),
[
RequestOptions::QUERY => [
'customerId' => $this->customerId,
Expand All @@ -135,7 +135,7 @@ public function updateCampaign(TriggerCampaign $triggerCampaign): void
{
$response = $this->client->request(
'PUT',
sprintf('/automation/longtermcampaigns/%d', $triggerCampaign->getTriggerId()),
sprintf('/post/advertising/print-mailing/automation/v1/longtermcampaigns/%d', $triggerCampaign->getTriggerId()),
[
RequestOptions::JSON => $this->transformTriggerCampaign($triggerCampaign, false),
RequestOptions::HEADERS => [
Expand All @@ -153,7 +153,7 @@ public function updateCampaignStage(TriggerCampaign $triggerCampaign, int $state
{
$response = $this->client->request(
'PUT',
sprintf('/automation/longtermcampaigns/%d/state', $triggerCampaign->getTriggerId()),
sprintf('/post/advertising/print-mailing/automation/v1/longtermcampaigns/%d/state', $triggerCampaign->getTriggerId()),
[
RequestOptions::JSON => [
'customerId' => $this->customerId,
Expand All @@ -174,7 +174,7 @@ public function listCampaigns(int $offset = 0, int $pageNumber = 0, int $pageSiz
{
$response = $this->client->request(
'GET',
'/automation/longtermcampaigns',
'/post/advertising/print-mailing/automation/v1/longtermcampaigns',
[
RequestOptions::QUERY => [
'customerId' => $this->customerId,
Expand Down Expand Up @@ -206,7 +206,7 @@ public function createMailing(TriggerCampaign &$triggerCampaign): void
{
$response = $this->client->request(
'POST',
'/automation/mailings',
'/post/advertising/print-mailing/automation/v1/mailings',
[
RequestOptions::JSON => [
'customerId' => $this->customerId,
Expand All @@ -230,7 +230,7 @@ public function getAddressVariables(): array
{
$response = $this->client->request(
'GET',
'/automation/mailings/addressvariables',
'/post/advertising/print-mailing/automation/v1/mailings/addressvariables',
[
RequestOptions::HEADERS => [
'Authorization' => 'Bearer '.$this->accessToken,
Expand All @@ -249,7 +249,7 @@ public function listMailings(TriggerCampaign $triggerCampaign): array
{
$response = $this->client->request(
'GET',
'/automation/mailings',
'/post/advertising/print-mailing/automation/v1/mailings',
[
RequestOptions::QUERY => [
'customerId' => $this->customerId,
Expand All @@ -272,7 +272,7 @@ public function deleteMailing(TriggerCampaign $triggerCampaign): void
{
$response = $this->client->request(
'DELETE',
'/automation/mailings',
'/post/advertising/print-mailing/automation/v1/mailings',
[
RequestOptions::QUERY => [
'customerId' => $this->customerId,
Expand All @@ -293,7 +293,7 @@ public function createVariableDefinitions(TriggerCampaign $triggerCampaign): voi
{
$response = $this->client->request(
'POST',
sprintf('/automation/mailings/%d/variabledefinitions', $triggerCampaign->getMailingId()),
sprintf('/post/advertising/print-mailing/automation/v1/mailings/%d/variabledefinitions', $triggerCampaign->getMailingId()),
[
RequestOptions::JSON => [
'customerId' => $this->customerId,
Expand All @@ -314,7 +314,7 @@ public function updateCampaignVariable(TriggerCampaign $triggerCampaign): void
{
$response = $this->client->request(
'PUT',
sprintf('/automation/mailings/%d/variabledefinitions', $triggerCampaign->getMailingId()),
sprintf('/post/advertising/print-mailing/automation/v1/mailings/%d/variabledefinitions', $triggerCampaign->getMailingId()),
[
RequestOptions::JSON => [
'customerId' => $this->customerId,
Expand All @@ -339,7 +339,7 @@ public function dataLookup(string $type = self::LOOKUP_ALL): array
{
$response = $this->client->request(
'GET',
'/automation/campaignlookups',
'/post/advertising/print-mailing/automation/v1/campaignlookups',
[
RequestOptions::HEADERS => [
'Authorization' => 'Bearer '.$this->accessToken,
Expand All @@ -360,7 +360,7 @@ public function createRecipient(TriggerCampaign $triggerCampaign, Lead $lead): v
{
$response = $this->client->request(
'POST',
'/automation/recipients/',
'/post/advertising/print-mailing/automation/v1/recipients/',
[
RequestOptions::JSON => [
'campaignId' => $triggerCampaign->getTriggerId(),
Expand Down Expand Up @@ -431,7 +431,7 @@ protected function getAccessToken(): string
{
$response = $this->client->request(
'POST',
'/user/authentication/partnersystem/credentialsbased',
'/post/advertising/print-mailing/user/v1/authentication/partnersystem/credentialsbased',
[
RequestOptions::JSON => [
'partnerSystemIdExt' => $this->partnerSystemIdExt,
Expand Down

0 comments on commit cd46dec

Please sign in to comment.