Skip to content

Purchase Data: Always return purchase response once purchase data is sent - #327

Draft
n7studios wants to merge 2 commits into
fix-purchase-data-success-notefrom
fix-purchase-data-return-value
Draft

n7studios wants to merge 2 commits into
fix-purchase-data-success-notefrom
fix-purchase-data-return-value

Conversation

@n7studios

Copy link
Copy Markdown
Contributor

Summary

When custom fields were mapped, send_purchase_data() returned the update subscriber response instead of the purchase data response. Sync Past Orders (REST API and WP-CLI) then:

  • reported the Order as failed if updating custom fields failed, even though the purchase data was sent
  • output an empty Kit Purchase ID via WP-CLI if updating custom fields succeeded
  • received null if no subscriber ID was returned

send_purchase_data() now always returns the purchase data response once the purchase data is sent. The custom fields update result is only used for the Order note.

Testing

  • RESTAPITest::testSyncPastOrderWhenCustomFieldsUpdateFails: when updating custom fields fails, the REST API route still returns success with the Kit Purchase ID.
  • SyncPastOrdersCLICest::testSyncPastOrdersWithCustomFields: when custom fields are mapped, the CLI output includes the Kit Purchase ID.

Checklist

@n7studios n7studios self-assigned this Oct 6, 2026
@n7studios n7studios added the bug label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant