[New Feature] Adding Commerce Partner Integration repair and update API endpoint#3091
Closed
jczhuoMeta wants to merge 16 commits intomainfrom
Closed
[New Feature] Adding Commerce Partner Integration repair and update API endpoint#3091jczhuoMeta wants to merge 16 commits intomainfrom
jczhuoMeta wants to merge 16 commits intomainfrom
Conversation
Contributor
|
@jczhuoMeta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
|
@jczhuoMeta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
…repair-and-update
Contributor
|
@jczhuoMeta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
facebook-github-bot
pushed a commit
that referenced
this pull request
May 1, 2025
…3091) Summary: ## Description 1. For sellers onboarded before the Shops release, they won't have CPI created for them 2. The extension will send configs to Meta to help Meta provide more reliable Shops integration ### Type of change Please delete options that are not relevant. - New feature (non-breaking change which adds functionality) ## Checklist - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have confirmed that my changes do not introduce any new PHPCS warnings or errors. - [x] I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors. - [x] I followed general Pull Request best practices. Meta employees to follow this [wiki]([url](https://fburl.com/wiki/2cgfduwc)). - [x] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes. - [x] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality. - [x] I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this [wiki]([url](https://fburl.com/wiki/nhx73tgs)). ## Changelog entry Add Commerce Integration repair and updating capability Test Plan: * Added new test ### Manual Using the following script in wp-console for testing: ``` $fb_plugin = facebook_for_woocommerce(); // Get the connection handler $connection = $fb_plugin->get_connection_handler(); echo "Commerce Partner Integration ID: " . $connection->get_commerce_partner_integration_id() . "\n"; // Test the repair_or_update_commerce_integration_data function try { $connection->repair_or_update_commerce_integration_data(); echo "Successfully executed repair_or_update_commerce_integration_data\n"; } catch (Exception $e) { echo "Error: " . $e->getMessage() . "\n"; } // Print out the current commerce integration data for verification echo "\nCurrent Commerce Integration Data:\n"; echo "Commerce Partner Integration ID: " . $connection->get_commerce_partner_integration_id() . "\n"; echo "Commerce Merchant Settings ID: " . $connection->get_commerce_merchant_settings_id() . "\n"; echo "Business Manager ID: " . $connection->get_business_manager_id() . "\n"; echo "External Business ID: " . $connection->get_external_business_id() . "\n"; ``` Output: ``` Commerce Partner Integration ID: 2477569805929631 Successfully executed repair_or_update_commerce_integration_data Current Commerce Integration Data: Commerce Partner Integration ID: 2477569805929631 Commerce Merchant Settings ID: 1119731910169300 Business Manager ID: 1507232916668297 External Business ID: woometa-67e6db5c280b9 ``` Tested cases: 1. Updating fields in existing CPI 2. Delete `wc_facebook_commerce_partner_integration_id` in wc db, the id will be retrieved from Meta and backfill into wc db 3. Deleted CPI ent from Meta side. Call repair endpoint it will create a new one **!---- (auto-generated) DO NOT EDIT OR PUT ANYTHING AFTER THIS LINE ----!** MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: www / Diff Version V3 https://internalfb.com/intern/testinfra/testrun/10696049195492144 MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: bloks / Diff Version V3 https://internalfb.com/intern/testinfra/testrun/9570149288637452 Reviewed By: carterbuce Differential Revision: D73615792 Pulled By: jczhuoMeta
ba60ed9 to
c097d20
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D73615792 |
8a674c0 to
3a3e0e4
Compare
# Conflicts: # includes/API.php
Contributor
|
@jczhuoMeta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
|
@jczhuoMeta has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
|
@jczhuoMeta merged this pull request in 71ba69f. |
This was referenced May 14, 2025
Closed
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of change
Please delete options that are not relevant.
Checklist
Changelog entry
Add Commerce Integration repair and updating capability
Test Plan
Manual
Using the following script in wp-console for testing:
Output:
Tested cases:
wc_facebook_commerce_partner_integration_idin wc db, the id will be retrieved from Meta and backfill into wc db