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

4.0.12 - v3 upgrade #263

Merged
merged 31 commits into from
Sep 29, 2023
Merged

4.0.12 - v3 upgrade #263

merged 31 commits into from
Sep 29, 2023

Conversation

jordanleslie
Copy link
Contributor

@jordanleslie jordanleslie commented Sep 18, 2023

Description

Introduced a new class, KlaviyoV3Api dedicated to handling API requests and responses for Klaviyo V3. This class was modeled after @siddwarkhedkar Prestashop V3 PR.
This class is responsible for transforming request data to match the structure of the Klaviyo V3 API.

  • Updated API Endpoint URLs

  • Updated and centralized the URL endpoints for the Klaviyo V3 API within the KlaviyoV3Api class for consistency.

  • Added several new exception types tailored to specific error scenarios, improving the precision of error reporting and handling.

  • New Method handleApiResponse:

  • Introduced a new method called handleApiResponse in the KlaviyoV3Api class.
    This method consistently handles API responses, parsing JSON data, and throwing appropriate exceptions when necessary.

Manual Testing Steps

  1. Tested on version 2.3.7, 4.0.12

Pre-Submission Checklist:

  • You've updated the CHANGELOG following the steps here
  • Internal Only - If this is a release, please confirm the following:
    • The links in the changelog have been updated to point towards the new versions
    • The version has been incremented in the following places: module.xml and composer.json

NOTE: Please use the Changelogger cli tool to manage versioned file upgrades.

@jordanleslie jordanleslie changed the title M2 v3 upgrade - WIP M2 v3 upgrade Sep 19, 2023
Helper/Data.php Show resolved Hide resolved
Helper/Data.php Outdated Show resolved Hide resolved
KlaviyoV3Sdk/KlaviyoV3Api.php Outdated Show resolved Hide resolved
@jordanleslie jordanleslie requested review from siddwarkhedkar, smoucka and cykolln and removed request for siddwarkhedkar September 26, 2023 13:01
@jordanleslie jordanleslie marked this pull request as ready for review September 26, 2023 13:23
@jordanleslie jordanleslie requested a review from a team as a code owner September 26, 2023 13:23
This was referenced Sep 26, 2023
@ali-aslam ali-aslam self-requested a review September 26, 2023 16:24
KlaviyoV3Sdk/KlaviyoV3Api.php Show resolved Hide resolved
KlaviyoV3Sdk/KlaviyoV3Api.php Outdated Show resolved Hide resolved
@jordanleslie jordanleslie mentioned this pull request Sep 26, 2023
4 tasks
@jordanleslie jordanleslie changed the title M2 v3 upgrade 4.0.12 - v3 upgrade Sep 26, 2023
The endpoint is plural profile-subscription-bulk-create-jobs but the type field of the request body is singular. This issue was causing a 400 error
Some endpoints return a 202 and empty string when the response is successful. The retry block was erroneously retrying successful requests
siddwarkhedkar and others added 3 commits September 29, 2023 13:17
On successful addition to a profile, the endpoint returns a 204 with an empty response. And otherwise, any errors returned from the call will be handled by the handleAPIresponse method
@jordanleslie jordanleslie merged commit 7c7d8a9 into master Sep 29, 2023
3 checks passed
@jordanleslie jordanleslie deleted the m2_v3_upgrade branch September 29, 2023 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants