From cdcabb6b95ee2544a2a289a5eed649547f38c928 Mon Sep 17 00:00:00 2001 From: Yousaf Saqib Date: Sun, 3 May 2020 14:56:00 +0500 Subject: [PATCH 1/8] link_uri missing from clicks response --- src/Ctct/Components/Tracking/ClickActivity.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ctct/Components/Tracking/ClickActivity.php b/src/Ctct/Components/Tracking/ClickActivity.php index 0a7b0e9..fbd7dd9 100755 --- a/src/Ctct/Components/Tracking/ClickActivity.php +++ b/src/Ctct/Components/Tracking/ClickActivity.php @@ -32,6 +32,7 @@ public static function create(array $props) $click_activity->contact_id = parent::getValue($props, "contact_id"); $click_activity->email_address = parent::getValue($props, "email_address"); $click_activity->link_id = parent::getValue($props, "link_id"); + $click_activity->link_uri = parent::getValue($props, "link_uri"); $click_activity->click_date = parent::getValue($props, "click_date"); return $click_activity; } From ac9a4437d8e3e19b21a0cc19a7d65f920a2b98bd Mon Sep 17 00:00:00 2001 From: Yousaf Saqib Date: Sun, 3 May 2020 15:12:28 +0500 Subject: [PATCH 2/8] new attribute added in click reponse --- src/Ctct/Components/Tracking/ClickActivity.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Ctct/Components/Tracking/ClickActivity.php b/src/Ctct/Components/Tracking/ClickActivity.php index fbd7dd9..af8a439 100755 --- a/src/Ctct/Components/Tracking/ClickActivity.php +++ b/src/Ctct/Components/Tracking/ClickActivity.php @@ -17,6 +17,7 @@ class ClickActivity extends Component public $contact_id; public $email_address; public $link_id; + public $link_uri; public $click_date; /** From c82d2c56461a3d297efb91da7ed5b0adc2a09fbb Mon Sep 17 00:00:00 2001 From: Yousaf Saqib Date: Sun, 3 May 2020 15:32:09 +0500 Subject: [PATCH 3/8] adding trusty for build --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7982182..099a7f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,5 @@ install: matrix: allow_failures: - php: hhvm - fast_finish: true \ No newline at end of file + fast_finish: true + dist: trusty \ No newline at end of file From a11f972dd4622ba3f07617a2fec025d5ab818ed4 Mon Sep 17 00:00:00 2001 From: Yousaf Saqib Date: Sun, 3 May 2020 15:36:34 +0500 Subject: [PATCH 4/8] at the top --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 099a7f3..2261aa6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: php +dist: trusty php: - 5.4 - 5.5 @@ -17,5 +18,4 @@ install: matrix: allow_failures: - php: hhvm - fast_finish: true - dist: trusty \ No newline at end of file + fast_finish: true \ No newline at end of file From aa6ae13b8d4af00c04f2de158106ef83201c8d79 Mon Sep 17 00:00:00 2001 From: Yousaf Saqib Date: Fri, 11 Sep 2020 10:19:34 +0000 Subject: [PATCH 5/8] composer.json: name updated, php version upgraded, author added --- composer.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 8bc7064..b7adbd8 100755 --- a/composer.json +++ b/composer.json @@ -1,23 +1,27 @@ { - "name": "constantcontact/constantcontact", + "name": "constantcontact/cc-php", "type": "library", "description": "Constant Contact PHP SDK for v2", "keywords": ["constantcontact", "ctct", "email marketing", "constant contact"], "homepage": "http://developer.constantcontact.com", "license": "MIT", "require": { - "php": ">=5.4.0", + "php": "^7.0.0", "ext-curl": "*", "guzzlehttp/guzzle": "^5.1.0" }, "require-dev": { - "phpunit/phpunit": "4.4.1" + "phpunit/phpunit": "^4.4.1" }, "authors": [ { "name": "Constant Contact Web Services", "email": "webservices@constantcontact.com", "homepage": "http://developer.constantcontact.com" + },{ + "name": "Yousaf Saqib", + "email": "yousafsaqib979@gmail.com", + "homepage": "http://developer.constantcontact.com" } ], "autoload": { From fd3e27c8441799807e1273d0c3728a5a4cccafa9 Mon Sep 17 00:00:00 2001 From: Yousaf Saqib Date: Fri, 11 Sep 2020 10:34:10 +0000 Subject: [PATCH 6/8] php version downgraded --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b7adbd8..693e1f9 100755 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "homepage": "http://developer.constantcontact.com", "license": "MIT", "require": { - "php": "^7.0.0", + "php": "^5.0.0", "ext-curl": "*", "guzzlehttp/guzzle": "^5.1.0" }, From cde3dd7d5964cfb1f48cc97cc17952a675e9e21d Mon Sep 17 00:00:00 2001 From: Yousaf Saqib Date: Fri, 11 Sep 2020 11:07:42 +0000 Subject: [PATCH 7/8] namespace changed --- .travis.yml | 6 ++--- README.md | 17 +++++++----- composer.json | 26 ++++++++++++------- examples/addOrUpdateContact.php | 22 ++++++++-------- examples/createAndScheduleCampaign.php | 10 +++---- examples/getAccessToken.php | 6 ++--- examples/importFromFile.php | 4 +-- examples/uploadFile.php | 4 +-- src/{Ctct => }/Auth/CtctDataStore.php | 2 +- src/{Ctct => }/Auth/CtctOAuth2.php | 8 +++--- src/{Ctct => }/Auth/SessionDataStore.php | 2 +- .../Components/Account/AccountInfo.php | 4 +-- .../Account/VerifiedEmailAddress.php | 4 +-- .../Components/Activities/Activity.php | 4 +-- .../Components/Activities/ActivityError.php | 4 +-- .../Components/Activities/AddContacts.php | 8 +++--- .../Activities/AddContactsImportData.php | 8 +++--- .../Components/Activities/ExportContacts.php | 4 +-- src/{Ctct => }/Components/Component.php | 2 +- .../Components/Contacts/Address.php | 4 +-- .../Components/Contacts/Contact.php | 4 +-- .../Components/Contacts/ContactList.php | 4 +-- .../Components/Contacts/CustomField.php | 4 +-- .../Components/Contacts/EmailAddress.php | 4 +-- src/{Ctct => }/Components/Contacts/Note.php | 4 +-- .../Components/EmailMarketing/Campaign.php | 12 ++++----- .../EmailMarketing/CampaignPreview.php | 4 +-- .../EmailMarketing/ClickThroughDetails.php | 4 +-- .../EmailMarketing/MessageFooter.php | 4 +-- .../Components/EmailMarketing/Schedule.php | 4 +-- .../Components/EmailMarketing/TestSend.php | 4 +-- src/{Ctct => }/Components/Library/File.php | 4 +-- .../Components/Library/FileUploadStatus.php | 4 +-- src/{Ctct => }/Components/Library/Folder.php | 4 +-- .../Components/Library/Thumbnail.php | 4 +-- src/{Ctct => }/Components/ResultSet.php | 2 +- .../Components/Tracking/BounceActivity.php | 4 +-- .../Components/Tracking/ClickActivity.php | 4 +-- .../Components/Tracking/ForwardActivity.php | 4 +-- .../Components/Tracking/OpenActivity.php | 4 +-- .../Components/Tracking/SendActivity.php | 4 +-- .../Components/Tracking/TrackingActivity.php | 2 +- .../Components/Tracking/TrackingSummary.php | 4 +-- .../Tracking/UnsubscribeActivity.php | 4 +-- src/{Ctct => }/ConstantContact.php | 20 +++++++------- src/{Ctct => }/Exceptions/CtctException.php | 2 +- .../Exceptions/IllegalArgumentException.php | 2 +- src/{Ctct => }/Exceptions/OAuth2Exception.php | 2 +- src/{Ctct => }/Services/AccountService.php | 10 +++---- src/{Ctct => }/Services/ActivityService.php | 12 ++++----- src/{Ctct => }/Services/BaseService.php | 6 ++--- .../Services/CampaignScheduleService.php | 10 +++---- .../Services/CampaignTrackingService.php | 26 +++++++++---------- src/{Ctct => }/Services/ContactService.php | 10 +++---- .../Services/ContactTrackingService.php | 24 ++++++++--------- .../Services/EmailMarketingService.php | 12 ++++----- src/{Ctct => }/Services/LibraryService.php | 18 ++++++------- src/{Ctct => }/Services/ListService.php | 8 +++--- src/{Ctct => }/SplClassLoader.php | 2 +- src/{Ctct => }/Util/Config.php | 2 +- src/{Ctct => }/WebHooks/CTCTWebhookUtil.php | 4 +-- src/{Ctct => }/autoload.php | 0 ...Auth2UnitTest.php => CCOAuth2UnitTest.php} | 6 ++--- test/Services/AccountServiceUnitTest.php | 4 +-- test/Services/ActivityServiceUnitTest.php | 2 +- .../CampaignScheduleServiceUnitTest.php | 4 +-- .../CampaignTrackingServiceUnitTest.php | 16 ++++++------ test/Services/ContactServiceUnitTest.php | 4 +-- .../ContactTrackingServiceUnitTest.php | 16 ++++++------ .../Services/EmailCampaignServiceUnitTest.php | 6 ++--- test/Services/LibraryServiceUnitTest.php | 8 +++--- test/Services/ListServiceUnitTest.php | 6 ++--- test/bootstrap.php | 2 +- 73 files changed, 252 insertions(+), 241 deletions(-) rename src/{Ctct => }/Auth/CtctDataStore.php (95%) rename src/{Ctct => }/Auth/CtctOAuth2.php (94%) mode change 100755 => 100644 rename src/{Ctct => }/Auth/SessionDataStore.php (97%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Account/AccountInfo.php (95%) rename src/{Ctct => }/Components/Account/VerifiedEmailAddress.php (90%) rename src/{Ctct => }/Components/Activities/Activity.php (95%) rename src/{Ctct => }/Components/Activities/ActivityError.php (87%) rename src/{Ctct => }/Components/Activities/AddContacts.php (95%) rename src/{Ctct => }/Components/Activities/AddContactsImportData.php (87%) rename src/{Ctct => }/Components/Activities/ExportContacts.php (89%) rename src/{Ctct => }/Components/Component.php (91%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Contacts/Address.php (95%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Contacts/Contact.php (98%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Contacts/ContactList.php (94%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Contacts/CustomField.php (87%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Contacts/EmailAddress.php (95%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Contacts/Note.php (88%) mode change 100755 => 100644 rename src/{Ctct => }/Components/EmailMarketing/Campaign.php (96%) mode change 100755 => 100644 rename src/{Ctct => }/Components/EmailMarketing/CampaignPreview.php (91%) rename src/{Ctct => }/Components/EmailMarketing/ClickThroughDetails.php (90%) mode change 100755 => 100644 rename src/{Ctct => }/Components/EmailMarketing/MessageFooter.php (94%) mode change 100755 => 100644 rename src/{Ctct => }/Components/EmailMarketing/Schedule.php (90%) mode change 100755 => 100644 rename src/{Ctct => }/Components/EmailMarketing/TestSend.php (93%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Library/File.php (97%) rename src/{Ctct => }/Components/Library/FileUploadStatus.php (89%) rename src/{Ctct => }/Components/Library/Folder.php (93%) rename src/{Ctct => }/Components/Library/Thumbnail.php (87%) rename src/{Ctct => }/Components/ResultSet.php (94%) rename src/{Ctct => }/Components/Tracking/BounceActivity.php (92%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Tracking/ClickActivity.php (91%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Tracking/ForwardActivity.php (90%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Tracking/OpenActivity.php (90%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Tracking/SendActivity.php (90%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Tracking/TrackingActivity.php (93%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Tracking/TrackingSummary.php (92%) mode change 100755 => 100644 rename src/{Ctct => }/Components/Tracking/UnsubscribeActivity.php (92%) mode change 100755 => 100644 rename src/{Ctct => }/ConstantContact.php (79%) mode change 100755 => 100644 rename src/{Ctct => }/Exceptions/CtctException.php (91%) rename src/{Ctct => }/Exceptions/IllegalArgumentException.php (81%) mode change 100755 => 100644 rename src/{Ctct => }/Exceptions/OAuth2Exception.php (80%) mode change 100755 => 100644 rename src/{Ctct => }/Services/AccountService.php (93%) rename src/{Ctct => }/Services/ActivityService.php (96%) rename src/{Ctct => }/Services/BaseService.php (94%) mode change 100755 => 100644 rename src/{Ctct => }/Services/CampaignScheduleService.php (95%) mode change 100755 => 100644 rename src/{Ctct => }/Services/CampaignTrackingService.php (93%) mode change 100755 => 100644 rename src/{Ctct => }/Services/ContactService.php (96%) mode change 100755 => 100644 rename src/{Ctct => }/Services/ContactTrackingService.php (94%) mode change 100755 => 100644 rename src/{Ctct => }/Services/EmailMarketingService.php (94%) mode change 100755 => 100644 rename src/{Ctct => }/Services/LibraryService.php (96%) rename src/{Ctct => }/Services/ListService.php (95%) mode change 100755 => 100644 rename src/{Ctct => }/SplClassLoader.php (99%) rename src/{Ctct => }/Util/Config.php (99%) mode change 100755 => 100644 rename src/{Ctct => }/WebHooks/CTCTWebhookUtil.php (96%) rename src/{Ctct => }/autoload.php (100%) rename test/Auth/{CtctOAuth2UnitTest.php => CCOAuth2UnitTest.php} (96%) diff --git a/.travis.yml b/.travis.yml index 2261aa6..d6e8993 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ language: php dist: trusty php: - - 5.4 - - 5.5 - - 5.6 + - 7.2 + - 7.3 + - 7.4 - hhvm env: diff --git a/README.md b/README.md index 23ee188..5de0404 100755 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # Constant Contact PHP SDK -[![Build Status](https://secure.travis-ci.org/constantcontact/php-sdk.png?branch=master)](http://travis-ci.org/constantcontact/php-sdk) [![Latest Stable Version](https://poser.pugx.org/constantcontact/constantcontact/v/stable.svg)](https://packagist.org/packages/constantcontact/constantcontact) [![Latest Unstable Version](https://poser.pugx.org/constantcontact/constantcontact/v/unstable.svg)](https://packagist.org/packages/constantcontact/constantcontact) ### This library utilizes [GuzzlePHP](http://guzzle.readthedocs.org/) ## Installing via Composer (recommended) -[Composer](https://getcomposer.org/) is a dependency management tool for PHP that allows you to declare the dependencies your project needs and installs them into your project. In order to use the Constant Contact PHP SDK through composer, you must add "constantcontact/constantcontact" as a dependency in your project's composer.json file. + +[Composer](https://getcomposer.org/) is a dependency management tool for PHP that allows you to declare the dependencies your project needs and installs them into your project. In order to use the Constant Contact PHP SDK through composer, you must add "yousaf-saqib/cc-php-sdk" as a dependency in your project's composer.json file which is a fork of "constantcontact/constantcontact". ```javascript { "require": { - "constantcontact/constantcontact": "2.1.*" + "yousaf-saqib/cc-php-sdk": "2.1.*" } } ``` @@ -25,7 +25,7 @@ API Documentation is located at http://developer.constantcontact.com/docs/develo ## Usage The ConstantContact class contains the underlying services that hold the methods that use the API. ```php -use Ctct\ConstantContact; +use YousafSaqib\ConstantContact\ConstantContact; $cc = new ConstantContact('your api key'); $contacts = $cc->contactService->getContacts('your access token') @@ -37,6 +37,11 @@ $params = array("limit" => 500); $contacts = $cc->contactService->getContacts('your access token', $params); ``` ## Minimum Requirements -Use of this library requires PHP 5.4+, and PHP cURL extension (http://php.net/manual/en/book.curl.php) +Use of this library requires PHP 7.2+, and PHP cURL extension (http://php.net/manual/en/book.curl.php) + +If you are being required to use an older version of PHP, it is highly recommended that you update to at least 7.2 . + + +## Changes from Orignal Client -If you are being required to use an older version of PHP, it is highly recommended that you update to at least 5.4 - but you can use version 1.3.* via composer, or [manually](https://github.com/constantcontact/php-sdk/tree/v1-master). +- New attribute added in connstant contant campaign tracking activity which contains clicked uri information \ No newline at end of file diff --git a/composer.json b/composer.json index 693e1f9..cf44f86 100755 --- a/composer.json +++ b/composer.json @@ -1,32 +1,38 @@ { - "name": "constantcontact/cc-php", + "name": "yousaf-saqib/cc-php", "type": "library", "description": "Constant Contact PHP SDK for v2", - "keywords": ["constantcontact", "ctct", "email marketing", "constant contact"], + "keywords": [ + "constantcontact", + "ctct", + "email marketing", + "constant contact" + ], "homepage": "http://developer.constantcontact.com", "license": "MIT", "require": { - "php": "^5.0.0", - "ext-curl": "*", - "guzzlehttp/guzzle": "^5.1.0" + "guzzlehttp/guzzle": "^7.0", + "ext-curl": "^7.2", + "php": "^7.2" }, "require-dev": { - "phpunit/phpunit": "^4.4.1" + "phpunit/phpunit": "^8.5" }, "authors": [ { "name": "Constant Contact Web Services", "email": "webservices@constantcontact.com", "homepage": "http://developer.constantcontact.com" - },{ + }, + { "name": "Yousaf Saqib", "email": "yousafsaqib979@gmail.com", "homepage": "http://developer.constantcontact.com" } ], "autoload": { - "psr-0": { - "Ctct": "src" + "psr-4": { + "YousafSaqib\\ConstantContact\\": "src" } } -} +} \ No newline at end of file diff --git a/examples/addOrUpdateContact.php b/examples/addOrUpdateContact.php index 02a02e8..ea4da8a 100644 --- a/examples/addOrUpdateContact.php +++ b/examples/addOrUpdateContact.php @@ -8,19 +8,19 @@ @@ -155,7 +155,7 @@ echo '
';
     print_r($returnContact);
     echo '
'; -} ?> +}?> diff --git a/examples/createAndScheduleCampaign.php b/examples/createAndScheduleCampaign.php index bb035b0..84aa400 100644 --- a/examples/createAndScheduleCampaign.php +++ b/examples/createAndScheduleCampaign.php @@ -18,13 +18,13 @@ diff --git a/src/Ctct/autoload.php b/src/autoload.php similarity index 100% rename from src/Ctct/autoload.php rename to src/autoload.php diff --git a/test/Auth/CtctOAuth2UnitTest.php b/test/Auth/CCOAuth2UnitTest.php similarity index 96% rename from test/Auth/CtctOAuth2UnitTest.php rename to test/Auth/CCOAuth2UnitTest.php index 70d9c82..d9643c9 100644 --- a/test/Auth/CtctOAuth2UnitTest.php +++ b/test/Auth/CCOAuth2UnitTest.php @@ -1,13 +1,13 @@ Date: Fri, 11 Sep 2020 11:09:53 +0000 Subject: [PATCH 8/8] composer package name changed --- README.md | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5de0404..aade1e5 100755 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ```javascript { "require": { - "yousaf-saqib/cc-php-sdk": "2.1.*" + "yousaf-saqib/cc-php-sdk": "1.0.*" } } ``` diff --git a/composer.json b/composer.json index cf44f86..b92a621 100755 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "yousaf-saqib/cc-php", + "name": "yousaf-saqib/cc-php-sdk", "type": "library", "description": "Constant Contact PHP SDK for v2", "keywords": [