Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4 API: Use Traits from PHP SDK #37

Merged
merged 37 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
23d58f2
Copy methods from PHP SDK
n7studios Apr 12, 2024
8215523
Coding standards
n7studios Apr 12, 2024
cb6eb2d
PHPStan
n7studios Apr 12, 2024
d91b948
Experimenting with splitting methods into separate class
n7studios Apr 12, 2024
5c06289
Clean up API class
n7studios Apr 12, 2024
b14a908
Fetch all resources (forms, landing pages, tags etc) when more than 1…
n7studios Apr 12, 2024
2d21ff9
Add `wordpress` namespace API methods to main API class
n7studios Apr 12, 2024
fe53dc8
Use PHP SDK `ConvertKit_API_Traits` trait for API methods
n7studios Apr 12, 2024
2e043e8
Tests: Include traits class
n7studios Apr 15, 2024
7520bbf
Revert Resource class change for separate PR
n7studios Apr 15, 2024
8ef6689
Exclude Traits from Coding Standards
n7studios Apr 15, 2024
3a0fada
Add missing properties
n7studios Apr 15, 2024
a8ca885
Reinstate `mask_string` method
n7studios Apr 15, 2024
43a387d
Reinstate missing `api_key` property for PHPStan compat.
n7studios Apr 15, 2024
cbff0d2
Coding standards for tests
n7studios Apr 15, 2024
3a4bb30
Tests: Change `account` to `get_account` method to follow PHP SDK trait
n7studios Apr 15, 2024
4556b44
Add support to fetch all resources using pagination
n7studios Apr 15, 2024
dedd01a
Check for v3 shape errors in response when performing exchange
n7studios Apr 15, 2024
6706ef6
Added tests
n7studios Apr 15, 2024
b6e0487
Coding standards
n7studios Apr 15, 2024
7cf1fbf
Fix test description
n7studios Apr 15, 2024
2bcf141
Reinstate `CONVERTKIT_API_KEY` and `CONVERTKIT_API_SECRET` in GitHub …
n7studios Apr 15, 2024
f0e052b
Merge branch 'v4-api-exchange-api-key-and-secret' into v4-api-resources
n7studios Apr 15, 2024
bffb525
Merge pull request #38 from ConvertKit/v4-api-exchange-api-key-and-se…
n7studios Apr 16, 2024
19117e5
Merge remote-tracking branch 'origin/v4-api-methods' into v4-api-reso…
n7studios Apr 16, 2024
8add39b
Add tests for `refresh` method
n7studios Apr 16, 2024
bc4c3d3
PHP 7.4 compat.
n7studios Apr 16, 2024
6d91224
Improve WordPress endpoint detection for `profile`, so it doesn’t int…
n7studios Apr 17, 2024
7549b01
Added account tests
n7studios Apr 17, 2024
063ea9f
Added tests
n7studios Apr 17, 2024
b2832a3
Coding standards
n7studios Apr 17, 2024
e0b3760
Use `http_build_query` instead of `add_query_arg`
n7studios Apr 17, 2024
7f877c9
Remove named arguments for PHP 7.4 compat.
n7studios Apr 17, 2024
0bcc000
Run assertion against `$resources`, not `$result`
n7studios Apr 18, 2024
62f12d8
Merge pull request #40 from ConvertKit/v4-api-tests-accounts
n7studios Apr 18, 2024
c33a5a9
Merge pull request #41 from ConvertKit/v4-api-tests-broadcasts
n7studios Apr 18, 2024
cc3778d
Merge pull request #39 from ConvertKit/v4-api-resources
n7studios Apr 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.dist.testing
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ TEST_TABLE_PREFIX=wp_
TEST_SITE_WP_URL=http://127.0.0.1
TEST_SITE_WP_DOMAIN=127.0.0.1
TEST_SITE_ADMIN_EMAIL=wordpress@convertkit.local
CONVERTKIT_API_BROADCAST_ID="8697158"
CONVERTKIT_API_FORM_ID="2765139"
CONVERTKIT_API_LEGACY_FORM_ID="470099"
CONVERTKIT_API_LANDING_PAGE_ID="2765196"
Expand Down
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ TEST_TABLE_PREFIX=wp_
TEST_SITE_WP_URL=http://convertkit.local
TEST_SITE_WP_DOMAIN=convertkit.local
TEST_SITE_ADMIN_EMAIL=wordpress@convertkit.local
CONVERTKIT_API_KEY=
CONVERTKIT_API_SECRET=
CONVERTKIT_OAUTH_ACCESS_TOKEN=
CONVERTKIT_OAUTH_REFRESH_TOKEN=
CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA=
CONVERTKIT_OAUTH_REFRESH_TOKEN_NO_DATA=
CONVERTKIT_OAUTH_CLIENT_ID=
CONVERTKIT_OAUTH_REDIRECT_URI=
CONVERTKIT_API_BROADCAST_ID="8697158"
CONVERTKIT_API_FORM_ID="2765139"
CONVERTKIT_API_LEGACY_FORM_ID="470099"
CONVERTKIT_API_LANDING_PAGE_ID="2765196"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
DB_PASS: root
DB_HOST: localhost
INSTALL_PLUGINS: "woocommerce" # Don't include this repository's Plugin here.
CONVERTKIT_API_KEY: ${{ secrets.CONVERTKIT_API_KEY }}
CONVERTKIT_API_SECRET: ${{ secrets.CONVERTKIT_API_SECRET }}
CONVERTKIT_OAUTH_ACCESS_TOKEN: ${{ secrets.CONVERTKIT_OAUTH_ACCESS_TOKEN }}
CONVERTKIT_OAUTH_REFRESH_TOKEN: ${{ secrets.CONVERTKIT_OAUTH_REFRESH_TOKEN }}
CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA: ${{ secrets.CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA }}
Expand Down Expand Up @@ -111,6 +113,8 @@ jobs:
path: ${{ env.PLUGIN_DIR }}/.env.dist.testing
contents: |

CONVERTKIT_API_KEY=${{ env.CONVERTKIT_API_KEY }}
CONVERTKIT_API_SECRET=${{ env.CONVERTKIT_API_SECRET }}
CONVERTKIT_OAUTH_ACCESS_TOKEN=${{ env.CONVERTKIT_OAUTH_ACCESS_TOKEN }}
CONVERTKIT_OAUTH_REFRESH_TOKEN=${{ env.CONVERTKIT_OAUTH_REFRESH_TOKEN }}
CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA=${{ env.CONVERTKIT_OAUTH_ACCESS_TOKEN_NO_DATA }}
Expand Down
3 changes: 3 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<!-- Exclude minified Javascript files. -->
<exclude-pattern>*.min.js</exclude-pattern>

<!-- Exclude traits from the PHP SDK. -->
<exclude-pattern>class-convertkit-api-traits.php</exclude-pattern>

<!-- Check that code meets WordPress-Extra standards. -->
<rule ref="WordPress-Extra">
<!--
Expand Down
Loading
Loading